pleroma: add JsonConstructor attribs
This commit is contained in:
parent
e5273860a6
commit
02ddd4c918
10 changed files with 16 additions and 0 deletions
|
@ -11,6 +11,11 @@ public class ASObject
|
||||||
[JsonPropertyName("id")]
|
[JsonPropertyName("id")]
|
||||||
public string ID { get; set; } = null!;
|
public string ID { get; set; } = null!;
|
||||||
|
|
||||||
|
[JsonConstructor()]
|
||||||
|
internal ASObject()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString() => ID;
|
public override string ToString() => ID;
|
||||||
|
|
||||||
public override bool Equals(object? obj) => Equals(obj as ASObject);
|
public override bool Equals(object? obj) => Equals(obj as ASObject);
|
||||||
|
|
|
@ -53,6 +53,7 @@ public class Account : ASObject
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonConstructor()]
|
||||||
internal Account()
|
internal Account()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ public class AccountField
|
||||||
|
|
||||||
public DateTime? VerifiedAt { get; set; }
|
public DateTime? VerifiedAt { get; set; }
|
||||||
|
|
||||||
|
[JsonConstructor()]
|
||||||
internal AccountField()
|
internal AccountField()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ public class Attachment
|
||||||
[JsonPropertyName("url")]
|
[JsonPropertyName("url")]
|
||||||
public string URL { get; set; } = null!;
|
public string URL { get; set; } = null!;
|
||||||
|
|
||||||
|
[JsonConstructor()]
|
||||||
internal Attachment()
|
internal Attachment()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ public class Context
|
||||||
[JsonPropertyName("descendants")]
|
[JsonPropertyName("descendants")]
|
||||||
public Status[] Descendants { get; set; } = null!;
|
public Status[] Descendants { get; set; } = null!;
|
||||||
|
|
||||||
|
[JsonConstructor()]
|
||||||
internal Context()
|
internal Context()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ public class Hashtag
|
||||||
[JsonPropertyName("url")]
|
[JsonPropertyName("url")]
|
||||||
public string URL { get; set; } = null!;
|
public string URL { get; set; } = null!;
|
||||||
|
|
||||||
|
[JsonConstructor()]
|
||||||
internal Hashtag()
|
internal Hashtag()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ public class Mention
|
||||||
[JsonPropertyName("username")]
|
[JsonPropertyName("username")]
|
||||||
public string Username { get; set; } = null!;
|
public string Username { get; set; } = null!;
|
||||||
|
|
||||||
|
[JsonConstructor()]
|
||||||
internal Mention()
|
internal Mention()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ public class Relationship
|
||||||
[JsonPropertyName("subscribing")]
|
[JsonPropertyName("subscribing")]
|
||||||
public bool Subscribing { get; set; }
|
public bool Subscribing { get; set; }
|
||||||
|
|
||||||
|
[JsonConstructor()]
|
||||||
internal Relationship()
|
internal Relationship()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ public class SearchResults
|
||||||
[JsonPropertyName("statuses")]
|
[JsonPropertyName("statuses")]
|
||||||
public Status[]? Statuses { get; set; }
|
public Status[]? Statuses { get; set; }
|
||||||
|
|
||||||
|
[JsonConstructor()]
|
||||||
internal SearchResults()
|
internal SearchResults()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,6 +140,7 @@ public class Status : ASObject
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string Content => Pleroma?.Content?.Plain ?? HtmlContent;
|
public string Content => Pleroma?.Content?.Plain ?? HtmlContent;
|
||||||
|
|
||||||
|
[JsonConstructor()]
|
||||||
internal Status()
|
internal Status()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -170,6 +171,7 @@ public class PleromaStatusData
|
||||||
[JsonPropertyName("quote_id")]
|
[JsonPropertyName("quote_id")]
|
||||||
public string? QuoteID { get; set; }
|
public string? QuoteID { get; set; }
|
||||||
|
|
||||||
|
[JsonConstructor()]
|
||||||
internal PleromaStatusData()
|
internal PleromaStatusData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -180,6 +182,7 @@ public class PleromaStatusContent
|
||||||
[JsonPropertyName("text/plain")]
|
[JsonPropertyName("text/plain")]
|
||||||
public string Plain { get; set; } = null!;
|
public string Plain { get; set; } = null!;
|
||||||
|
|
||||||
|
[JsonConstructor()]
|
||||||
internal PleromaStatusContent()
|
internal PleromaStatusContent()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue