JsonPropertyName

This commit is contained in:
Mike Phares 2024-09-16 13:37:34 -07:00
parent 65e31b09cc
commit 11293968b8
10 changed files with 63 additions and 115 deletions

View File

@ -211,7 +211,7 @@ public class FileRead : Shared.FileRead, IFileRead
private static int? GetIdFromUrlIfChild(Relation relation) private static int? GetIdFromUrlIfChild(Relation relation)
{ {
int? result; int? result;
string[] segments = relation.Attributes.Name != "Child" ? Array.Empty<string>() : relation.URL.Split('/'); string[] segments = relation?.Attributes is null || relation.Attributes.Name != "Child" ? Array.Empty<string>() : relation.URL.Split('/');
if (segments.Length < 2) if (segments.Length < 2)
result = null; result = null;
else else

View File

@ -15,7 +15,7 @@ public class Attribute
Name = name; Name = name;
} }
public bool IsLocked { get; set; } // { init; get; } [JsonPropertyName("isLocked")] public bool IsLocked { get; set; }
public string Name { get; set; } // { init; get; } [JsonPropertyName("name")] public string Name { get; set; }
} }

View File

@ -16,12 +16,8 @@ public class CommentVersionRef
URL = url; URL = url;
} }
[JsonPropertyName("commentId")] [JsonPropertyName("commentId")] public int CommentId { get; } // { init; get; }
public int CommentId { get; } // { init; get; } [JsonPropertyName("url")] public string URL { get; } // { init; get; }
[JsonPropertyName("version")] public int Version { get; } // { init; get; }
[JsonPropertyName("version")]
public int Version { get; } // { init; get; }
[JsonPropertyName("url")]
public string URL { get; } // { init; get; }
} }

View File

@ -9,6 +9,5 @@ public class Links
Avatar avatar Avatar avatar
) => Avatar = avatar; ) => Avatar = avatar;
[JsonPropertyName("avatar")] [JsonPropertyName("avatar")] public Avatar Avatar { get; }
public Avatar Avatar { get; }
} }

View File

@ -17,8 +17,8 @@ public class Relation
Attributes = attributes; Attributes = attributes;
} }
public string Rel { get; set; } // { init; get; } [JsonPropertyName("attributes")] public Attribute Attributes { get; set; }
public string URL { get; set; } // { init; get; } [JsonPropertyName("rel")] public string Rel { get; set; }
public Attribute Attributes { get; set; } // { init; get; } [JsonPropertyName("url")] public string URL { get; set; }
} }

View File

@ -24,24 +24,12 @@ public class SystemAssignedTo
Descriptor = descriptor; Descriptor = descriptor;
} }
[JsonPropertyName("displayName")] [JsonPropertyName("_links")] public Links Links { get; }
public string DisplayName { get; } [JsonPropertyName("descriptor")] public string Descriptor { get; }
[JsonPropertyName("displayName")] public string DisplayName { get; }
[JsonPropertyName("id")] public string Id { get; }
[JsonPropertyName("imageUrl")] public string ImageUrl { get; }
[JsonPropertyName("uniqueName")] public string UniqueName { get; }
[JsonPropertyName("url")] public string Url { get; }
[JsonPropertyName("url")]
public string Url { get; }
[JsonPropertyName("_links")]
public Links Links { get; }
[JsonPropertyName("id")]
public string Id { get; }
[JsonPropertyName("uniqueName")]
public string UniqueName { get; }
[JsonPropertyName("imageUrl")]
public string ImageUrl { get; }
[JsonPropertyName("descriptor")]
public string Descriptor { get; }
} }

View File

@ -24,24 +24,12 @@ public class SystemChangedBy
Descriptor = descriptor; Descriptor = descriptor;
} }
[JsonPropertyName("displayName")] [JsonPropertyName("_links")] public Links Links { get; }
public string DisplayName { get; } [JsonPropertyName("descriptor")] public string Descriptor { get; }
[JsonPropertyName("displayName")] public string DisplayName { get; }
[JsonPropertyName("id")] public string Id { get; }
[JsonPropertyName("imageUrl")] public string ImageUrl { get; }
[JsonPropertyName("uniqueName")] public string UniqueName { get; }
[JsonPropertyName("url")] public string Url { get; }
[JsonPropertyName("url")]
public string Url { get; }
[JsonPropertyName("_links")]
public Links Links { get; }
[JsonPropertyName("id")]
public string Id { get; }
[JsonPropertyName("uniqueName")]
public string UniqueName { get; }
[JsonPropertyName("imageUrl")]
public string ImageUrl { get; }
[JsonPropertyName("descriptor")]
public string Descriptor { get; }
} }

View File

@ -24,24 +24,12 @@ public class SystemCreatedBy
Descriptor = descriptor; Descriptor = descriptor;
} }
[JsonPropertyName("displayName")] [JsonPropertyName("_links")] public Links Links { get; }
public string DisplayName { get; } [JsonPropertyName("descriptor")] public string Descriptor { get; }
[JsonPropertyName("displayName")] public string DisplayName { get; }
[JsonPropertyName("id")] public string Id { get; }
[JsonPropertyName("imageUrl")] public string ImageUrl { get; }
[JsonPropertyName("uniqueName")] public string UniqueName { get; }
[JsonPropertyName("url")] public string Url { get; }
[JsonPropertyName("url")]
public string Url { get; }
[JsonPropertyName("_links")]
public Links Links { get; }
[JsonPropertyName("id")]
public string Id { get; }
[JsonPropertyName("uniqueName")]
public string UniqueName { get; }
[JsonPropertyName("imageUrl")]
public string ImageUrl { get; }
[JsonPropertyName("descriptor")]
public string Descriptor { get; }
} }

View File

@ -22,21 +22,10 @@ public class Value
Url = url; Url = url;
} }
[JsonPropertyName("id")] [JsonPropertyName("commentVersionRef")] public CommentVersionRef CommentVersionRef { get; }
public int Id { get; } [JsonPropertyName("fields")] public Fields Fields { get; }
[JsonPropertyName("id")] public int Id { get; }
[JsonPropertyName("rev")] [JsonPropertyName("relations")] public Relation[] Relations { get; }
public int Rev { get; } [JsonPropertyName("rev")] public int Rev { get; }
[JsonPropertyName("url")] public string Url { get; }
[JsonPropertyName("fields")]
public Fields Fields { get; }
[JsonPropertyName("relations")]
public Relation[] Relations { get; }
[JsonPropertyName("commentVersionRef")]
public CommentVersionRef CommentVersionRef { get; }
[JsonPropertyName("url")]
public string Url { get; }
} }

View File

@ -64,31 +64,31 @@ public class WorkItem
WeightedShortestJobFirst = weightedShortestJobFirst; WeightedShortestJobFirst = weightedShortestJobFirst;
} }
public string AreaPath { get; set; } // { init; get; } public string AreaPath { get; set; }
public string? AssignedTo { get; set; } // { init; get; } public string? AssignedTo { get; set; }
public int? BusinessValue { get; set; } // { init; get; } public int? BusinessValue { get; set; }
public DateTime ChangedDate { get; set; } // { init; get; } public DateTime ChangedDate { get; set; }
public DateTime? ClosedDate { get; set; } // { init; get; } public DateTime? ClosedDate { get; set; }
public int CommentCount { get; set; } // { init; get; } public int CommentCount { get; set; }
public DateTime CreatedDate { get; set; } // { init; get; } public DateTime CreatedDate { get; set; }
public string Description { get; set; } // { init; get; } public string Description { get; set; }
public float? Effort { get; set; } // { init; get; } public float? Effort { get; set; }
public int Id { get; set; } // { init; get; } public int Id { get; set; }
public string IterationPath { get; set; } // { init; get; } public string IterationPath { get; set; }
public int? Parent { get; set; } // { init; get; } public int? Parent { get; set; }
public int? Priority { get; set; } // { init; get; } public int? Priority { get; set; }
public Relation[]? Relations { get; set; } // { init; get; } public Relation[]? Relations { get; set; }
public string? Requester { get; set; } // { init; get; } public string? Requester { get; set; }
public DateTime? ResolvedDate { get; set; } // { init; get; } public DateTime? ResolvedDate { get; set; }
public int Revision { get; set; } // { init; get; } public int Revision { get; set; }
public int? RiskReductionMinusOpportunityEnablement { get; set; } // { init; get; } public int? RiskReductionMinusOpportunityEnablement { get; set; }
public DateTime? StartDate { get; set; } // { init; get; } public DateTime? StartDate { get; set; }
public string State { get; set; } // { init; get; } public string State { get; set; }
public string Tags { get; set; } // { init; get; } public string Tags { get; set; }
public DateTime? TargetDate { get; set; } // { init; get; } public DateTime? TargetDate { get; set; }
public float? TimeCriticality { get; set; } // { init; get; } public float? TimeCriticality { get; set; }
public string Title { get; set; } // { init; get; } public string Title { get; set; }
public string WorkItemType { get; set; } // { init; get; } public string WorkItemType { get; set; }
public float? WeightedShortestJobFirst { get; set; } // { init; get; } public float? WeightedShortestJobFirst { get; set; }
} }