diff --git a/Pleroma/Models/Account.cs b/Pleroma/Models/Account.cs
index 8ce75d4..33d9a32 100644
--- a/Pleroma/Models/Account.cs
+++ b/Pleroma/Models/Account.cs
@@ -79,6 +79,8 @@ public readonly struct AccountID(string id)
public static implicit operator AccountID(Relationship relationship) => new AccountID(relationship.ID);
+ public static implicit operator AccountID(AccountInfo userInfo) => new AccountID(userInfo.ID);
+
public readonly string ID = id;
public override string ToString() => ID;
diff --git a/Pleroma/Models/AccountInfo.cs b/Pleroma/Models/AccountInfo.cs
new file mode 100644
index 0000000..cd74ede
--- /dev/null
+++ b/Pleroma/Models/AccountInfo.cs
@@ -0,0 +1,63 @@
+namespace Uwaa.Pleroma;
+
+///
+/// Admin information about an account.
+///
+public class AccountInfo : ASObject
+{
+ [JsonPropertyName("actor_type")]
+ [JsonConverter(typeof(EnumLowerCaseConverter))]
+ public ActorType Type { get; set; }
+
+ [JsonPropertyName("avatar")]
+ public string Avatar { get; set; } = null!;
+
+ [JsonPropertyName("display_name")]
+ public string DisplayName { get; set; } = null!;
+
+ [JsonPropertyName("email")]
+ public string? Email { get; set; }
+
+ [JsonPropertyName("is_active")]
+ public bool IsActive { get; set; }
+
+ [JsonPropertyName("is_approved")]
+ public bool IsApproved { get; set; }
+
+ [JsonPropertyName("is_confirmed")]
+ public bool IsConfirmed { get; set; }
+
+ [JsonPropertyName("local")]
+ public bool Local { get; set; }
+
+ [JsonPropertyName("nickname")]
+ public string Nickname { get; set; } = null!;
+
+ [JsonPropertyName("registration_reason")]
+ public string? RegistrationReason { get; set; }
+
+ [JsonPropertyName("roles")]
+ public AccountRoles Roles { get; set; } = null!;
+
+ [JsonPropertyName("url")]
+ public string URL { get; set; } = null!;
+
+ [JsonPropertyName("tags")]
+ public string[] Tags { get; set; } = null!;
+
+ [JsonConstructor()]
+ internal AccountInfo()
+ {
+ }
+
+ public override string ToString() => $"@{Nickname}";
+}
+
+public class AccountRoles
+{
+ [JsonPropertyName("admin")]
+ public bool Admin { get; set; }
+
+ [JsonPropertyName("moderator")]
+ public bool Moderator { get; set; }
+}
\ No newline at end of file
diff --git a/Pleroma/Models/Page.cs b/Pleroma/Models/Page.cs
new file mode 100644
index 0000000..4d563e7
--- /dev/null
+++ b/Pleroma/Models/Page.cs
@@ -0,0 +1,16 @@
+namespace Uwaa.Pleroma;
+
+public class Page
+{
+ [JsonPropertyName("count")]
+ public int Count { get; set; }
+
+ [JsonPropertyName("page_size")]
+ public int PageSize { get; set; }
+}
+
+public class UsersPage
+{
+ [JsonPropertyName("users")]
+ public AccountInfo[] Users { get; set; } = null!;
+}
\ No newline at end of file
diff --git a/Pleroma/Pleroma.cs b/Pleroma/Pleroma.cs
index 2a0cc0f..d9e8745 100644
--- a/Pleroma/Pleroma.cs
+++ b/Pleroma/Pleroma.cs
@@ -17,7 +17,7 @@ public class Pleroma
NumberHandling = JsonNumberHandling.AllowReadingFromString,
};
- static string CreateQuery(Action generator)
+ internal static string CreateQuery(Action generator)
{
StringBuilder sb = new StringBuilder();
void addPair(string key, string value)
@@ -51,12 +51,17 @@ public class Pleroma
HttpClient.DefaultRequestHeaders.Authorization = AuthenticationHeaderValue.Parse(authorization);
}
- Task Retry(Func reqFactory)
+ public Pleroma(HttpClient client)
+ {
+ HttpClient = client;
+ }
+
+ internal Task Retry(Func reqFactory)
{
return Retry