This commit is contained in:
2024-09-13 14:14:22 -07:00
parent 45502a30a9
commit 513e8ae4fc
7 changed files with 234 additions and 8 deletions

View File

@ -0,0 +1,21 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class Attribute
{
#nullable enable
[JsonConstructor]
public Attribute(bool isLocked,
string name)
{
IsLocked = isLocked;
Name = name;
}
public bool IsLocked { get; set; } // { init; get; }
public string Name { get; set; } // { init; get; }
}

View File

@ -0,0 +1,19 @@
using System.Collections.ObjectModel;
namespace Adaptation.FileHandlers.json.WorkItems;
public class Record
{
#nullable enable
public Record(WorkItem workItem, ReadOnlyDictionary<int, Record> children)
{
WorkItem = workItem;
Children = children;
}
public WorkItem WorkItem { get; set; }
public ReadOnlyDictionary<int, Record> Children { get; set; }
}

View File

@ -0,0 +1,24 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class Relation
{
#nullable enable
[JsonConstructor]
public Relation(string rel,
string url,
Attribute attributes)
{
Rel = rel;
URL = url;
Attributes = attributes;
}
public string Rel { get; set; } // { init; get; }
public string URL { get; set; } // { init; get; }
public Attribute Attributes { get; set; } // { init; get; }
}

View File

@ -9,7 +9,7 @@ public class Value
int id,
int rev,
Fields fields,
object[] relations,
Relation[] relations,
CommentVersionRef commentVersionRef,
string url
)
@ -32,7 +32,7 @@ public class Value
public Fields Fields { get; }
[JsonPropertyName("relations")]
public object[] Relations { get; }
public Relation[] Relations { get; }
[JsonPropertyName("commentVersionRef")]
public CommentVersionRef CommentVersionRef { get; }

View File

@ -22,7 +22,7 @@ public class WorkItem
string iterationPath,
int? parent,
int? priority,
object[]? relations,
Relation[]? relations,
string? requester,
DateTime? resolvedDate,
int revision,
@ -77,7 +77,7 @@ public class WorkItem
public string IterationPath { get; set; } // { init; get; }
public int? Parent { get; set; } // { init; get; }
public int? Priority { get; set; } // { init; get; }
public object[]? Relations { get; set; } // { init; get; }
public Relation[]? Relations { get; set; } // { init; get; }
public string? Requester { get; set; } // { init; get; }
public DateTime? ResolvedDate { get; set; } // { init; get; }
public int Revision { get; set; } // { init; get; }