Inititial Commit

This commit is contained in:
2023-04-22 21:42:57 -07:00
parent 660b89c129
commit c7995ffd4f
58 changed files with 1312 additions and 905 deletions

View File

@ -20,7 +20,7 @@ namespace Adaptation.FileHandlers.json;
public class FileRead : Shared.FileRead, IFileRead
{
private long? _TickOffset;
private string _Json;
private readonly string _API;
private readonly string _Query;
private readonly string _Project;
@ -28,17 +28,18 @@ public class FileRead : Shared.FileRead, IFileRead
private readonly HttpClient _HttpClient;
private readonly WorkItemTrackingHttpClient _WorkItemTrackingHttpClient;
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) :
base(new Description(), false, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted)
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) :
base(new Description(), false, smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null)
{
_MinFileLength = 10;
_Json = string.Empty;
_NullData = string.Empty;
_Logistics = new(this);
if (_FileParameter is null)
throw new Exception(cellInstanceConnectionName);
if (_ModelObjectParameterDefinitions is null)
throw new Exception(cellInstanceConnectionName);
if (_IsDuplicator)
if (!_IsDuplicator)
throw new Exception(cellInstanceConnectionName);
string cellInstanceNamed = string.Concat("CellInstance.", cellInstanceName);
MediaTypeWithQualityHeaderValue mediaTypeWithQualityHeaderValue = new("application/json");
@ -50,7 +51,7 @@ public class FileRead : Shared.FileRead, IFileRead
string baseAddress = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, $"{cellInstanceNamed}.HttpClient.BaseAddress");
byte[] bytes = Encoding.ASCII.GetBytes($":{pat}");
string base64 = Convert.ToBase64String(bytes);
_HttpClient = new() { BaseAddress = new(baseAddress) };
_HttpClient = new(new HttpClientHandler() { UseDefaultCredentials = true }) { BaseAddress = new(baseAddress) };
_HttpClient.DefaultRequestHeaders.Authorization = new("Basic", base64);
_HttpClient.DefaultRequestHeaders.Accept.Add(mediaTypeWithQualityHeaderValue);
VssBasicCredential credential = new("", pat);
@ -127,19 +128,19 @@ public class FileRead : Shared.FileRead, IFileRead
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
_TickOffset ??= new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks;
_Logistics = new Logistics(this, _TickOffset.Value, reportFullPath, useSplitForMID: true);
SetFileParameterLotIDToLogisticsMID();
if (_Logistics.FileInfo.Length < _MinFileLength)
_Logistics = new Logistics(this);
string json = File.ReadAllText(reportFullPath);
if (_Json == json)
results.Item4.Add(_Logistics.FileInfo);
else
{
IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4, _HttpClient, _BasePage, _API, _Query, _WorkItemTrackingHttpClient, _Project);
IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4, _HttpClient, _BasePage, _API, _Query, _WorkItemTrackingHttpClient, _Project, json);
if (iProcessData is not ProcessData _)
throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks));
if (!iProcessData.Details.Any())
throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks));
results = iProcessData.GetResults(this, _Logistics, results.Item4);
_Json = json;
}
return results;
}

View File

@ -11,6 +11,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
@ -23,11 +24,11 @@ public class ProcessData : IProcessData
List<object> Shared.Properties.IProcessData.Details => _Details;
public ProcessData(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection, HttpClient httpClient, string basePage, string api, string query, WorkItemTrackingHttpClient workItemTrackingHttpClient, string project)
public ProcessData(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection, HttpClient httpClient, string basePage, string api, string query, WorkItemTrackingHttpClient workItemTrackingHttpClient, string project, string json)
{
fileInfoCollection.Clear();
_Details = new List<object>();
Parse(fileRead, logistics, fileInfoCollection, httpClient, basePage, api, query, workItemTrackingHttpClient, project);
Parse(fileRead, logistics, fileInfoCollection, httpClient, basePage, api, query, workItemTrackingHttpClient, project, json);
}
string IProcessData.GetCurrentReactor(IFileRead fileRead, Logistics logistics, Dictionary<string, string> reactors)
@ -40,45 +41,33 @@ public class ProcessData : IProcessData
#nullable enable
private static Root GetRoot(HttpClient httpClient, string basePage, string api, int id)
{
Root result;
Task<HttpResponseMessage> httpResponseMessageTask = httpClient.GetAsync(string.Concat(basePage, api, "/workItems/", id));
httpResponseMessageTask.Wait();
if (!httpResponseMessageTask.Result.IsSuccessStatusCode)
throw new Exception(httpResponseMessageTask.Result.StatusCode.ToString());
Task<Stream> streamTask = httpResponseMessageTask.Result.Content.ReadAsStreamAsync();
streamTask.Wait();
if (!streamTask.Result.CanRead)
{
JsonElement? jsonElement = JsonSerializer.Deserialize<JsonElement>(streamTask.Result);
if (jsonElement is null)
throw new NullReferenceException(nameof(jsonElement));
}
Root? root = JsonSerializer.Deserialize<Root>(streamTask.Result, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true });
streamTask.Result.Dispose();
if (root is null || root.Fields is null)
throw new NullReferenceException(nameof(root));
result = root;
return result;
}
private static void AddPatch(JsonPatchDocument document, string path, object value) => document.Add(new JsonPatchOperation { From = null, Operation = Operation.Add, Path = path, Value = value });
private void Parse(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection, HttpClient httpClient, string basePage, string api, string query, WorkItemTrackingHttpClient workItemTrackingHttpClient, string project)
private static Dictionary<string, FIBacklogMesa> GetFIBacklogMesaCollection(string json, string keySection)
{
if (fileRead is null)
throw new NullReferenceException();
if (logistics is null)
throw new NullReferenceException();
if (fileInfoCollection is null)
throw new NullReferenceException();
Root raw;
ViewModels.WorkItem view;
string json = File.ReadAllText(logistics.ReportFullPath);
FIBacklogMesa[]? fIBacklogMesaCollection = JsonSerializer.Deserialize<FIBacklogMesa[]>(json, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true });
if (fIBacklogMesaCollection is null || !fIBacklogMesaCollection.Any())
Dictionary<string, FIBacklogMesa> results = new();
string key;
FIBacklogMesa[]? fiBacklogMesaCollection;
fiBacklogMesaCollection = JsonSerializer.Deserialize<FIBacklogMesa[]>(json, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true });
if (fiBacklogMesaCollection is null || !fiBacklogMesaCollection.Any())
throw new NullReferenceException();
foreach (FIBacklogMesa fIBacklogMesa in fiBacklogMesaCollection)
{
if (string.IsNullOrEmpty(fIBacklogMesa.Requestor))
continue;
if (string.IsNullOrEmpty(fIBacklogMesa.Req))
continue;
key = $"{fIBacklogMesa.Requestor.Split(' ').First()}{keySection}{fIBacklogMesa.Req}";
if (results.ContainsKey(key))
continue;
results.Add(key, fIBacklogMesa);
}
return results;
}
private static string GetIds(HttpClient httpClient, string basePage, string api, string query)
{
StringBuilder result = new();
Task<HttpResponseMessage> httpResponseMessageTask = httpClient.GetAsync(string.Concat(basePage, api, query));
httpResponseMessageTask.Wait();
if (!httpResponseMessageTask.Result.IsSuccessStatusCode)
@ -86,35 +75,101 @@ public class ProcessData : IProcessData
Task<Stream> streamTask = httpResponseMessageTask.Result.Content.ReadAsStreamAsync();
streamTask.Wait();
if (!streamTask.Result.CanRead)
{
JsonElement? jsonElement = JsonSerializer.Deserialize<JsonElement>(streamTask.Result);
if (jsonElement is null)
throw new NullReferenceException(nameof(jsonElement));
}
throw new NullReferenceException(nameof(streamTask));
WIQL.Root? root = JsonSerializer.Deserialize<WIQL.Root>(streamTask.Result, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true });
streamTask.Result.Dispose();
if (root is null || root.WorkItems is null)
throw new NullReferenceException(nameof(root));
foreach (WIQL.WorkItem workItem in root.WorkItems)
_ = result.Append(workItem.Id).Append(',');
if (result.Length > 0)
_ = result.Remove(result.Length - 1, 1);
return result.ToString();
}
private static Value[] GetWorkItems(HttpClient httpClient, string basePage, string api, string ids)
{
Value[]? results;
// List<Value> results = new();
// Value? value;
Task<HttpResponseMessage> httpResponseMessageTask = httpClient.GetAsync(string.Concat(basePage, api, $"/workitems?ids={ids}"));
httpResponseMessageTask.Wait();
if (!httpResponseMessageTask.Result.IsSuccessStatusCode)
throw new Exception(httpResponseMessageTask.Result.StatusCode.ToString());
Task<Stream> streamTask = httpResponseMessageTask.Result.Content.ReadAsStreamAsync();
streamTask.Wait();
if (!streamTask.Result.CanRead)
throw new NullReferenceException(nameof(streamTask));
JsonElement? jsonElement = JsonSerializer.Deserialize<JsonElement>(streamTask.Result);
if (jsonElement is null || jsonElement.Value.ValueKind != JsonValueKind.Object)
throw new NullReferenceException(nameof(jsonElement));
results = JsonSerializer.Deserialize<Value[]>(jsonElement.Value.EnumerateObject().Last().Value);
if (results is null || !results.Any())
throw new NullReferenceException(nameof(results));
return results;
}
private static Value[] GetExtra(string keySection, IReadOnlyList<Value> workItems, Dictionary<string, FIBacklogMesa> keyToFIBacklogMesa)
{
List<Value> results = new();
foreach (Value value in workItems)
{
raw = GetRoot(httpClient, basePage, api, workItem.Id);
view = new(raw);
_Details.Add(view);
if (workItem.Id == 308759)
break;
if (!value.Fields.SystemTitle.Contains(keySection))
continue;
if (keyToFIBacklogMesa.Remove(value.Fields.SystemTitle))
continue;
results.Add(value);
}
JsonPatchDocument document = new();
AddPatch(document, "/fields/System.Title", "Title");
AddPatch(document, "/fields/System.Description", "Description");
AddPatch(document, "/fields/System.AssignedTo", "Mike.Phares@infineon.com");
AddPatch(document, "/fields/System.AreaPath", string.Concat(project, @"\OI"));
AddPatch(document, "/fields/System.IterationPath", string.Concat(project, @"\CMP"));
return results.ToArray();
}
private static string GetDescription(FIBacklogMesa fiBacklogMesa, DateTime dateTime) =>
$"Req:{fiBacklogMesa.Req}; Submitted:{(dateTime == DateTime.MinValue ? fiBacklogMesa.Submitted : dateTime.ToString("d-MMM-yy"))}; Requestor:{fiBacklogMesa.Requestor}; AssignedTo:{fiBacklogMesa.AssignedTo}; SecondResource:{fiBacklogMesa.SecondResource}; Systems:{fiBacklogMesa.SystemS}; ";
private void Parse(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection, HttpClient httpClient, string basePage, string api, string query, WorkItemTrackingHttpClient workItemTrackingHttpClient, string project, string json)
{
if (fileRead is null)
throw new NullReferenceException();
if (logistics is null)
throw new NullReferenceException();
if (fileInfoCollection is null)
throw new NullReferenceException();
int counter = 0;
DateTime dateTime;
string description;
string keySection = " UAT for ";
string ids = GetIds(httpClient, basePage, api, query);
Value[] workItems = GetWorkItems(httpClient, basePage, api, ids);
Task<Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.WorkItem> workItemTask;
workItemTask = workItemTrackingHttpClient.CreateWorkItemAsync(document, project, "Bug");
workItemTask.Wait();
if (workItemTask.Result is null)
Dictionary<string, FIBacklogMesa> keyToFIBacklogMesa = GetFIBacklogMesaCollection(json, keySection);
int count = keyToFIBacklogMesa.Count;
Value[] extra = GetExtra(keySection, workItems, keyToFIBacklogMesa);
if (count != extra.Length)
{ }
// workItemTask = workItemTrackingHttpClient.UpdateWorkItemAsync(document, project, "Bug");
if (count != keyToFIBacklogMesa.Count)
{ }
_Details.AddRange(workItems);
foreach (KeyValuePair<string, FIBacklogMesa> keyValuePair in keyToFIBacklogMesa)
{
if (counter > 5)
break;
JsonPatchDocument document = new();
if (!DateTime.TryParse(keyValuePair.Value.Submitted, out dateTime))
dateTime = DateTime.MinValue;
AddPatch(document, "/fields/System.AreaPath", project);
description = GetDescription(keyValuePair.Value, dateTime);
AddPatch(document, "/fields/System.Title", keyValuePair.Key);
AddPatch(document, "/fields/System.Description", description);
AddPatch(document, "/fields/System.IterationPath", $"{project}\\(Default)");
// AddPatch(document, "/fields/System.AssignedTo", "Mike.Phares@infineon.com");
if (!fileRead.IsEAFHosted)
continue;
workItemTask = workItemTrackingHttpClient.CreateWorkItemAsync(document, project, "Task");
workItemTask.Wait();
counter++;
if (workItemTask.Result is null)
continue;
}
}
}

View File

@ -1,79 +0,0 @@
using Adaptation.FileHandlers.json.WorkItems;
using System;
namespace Adaptation.FileHandlers.json.ViewModels;
public class WorkItem
{
public string AreaPath { get; set; } // { init; get; }
public string AssignedToDisplayName { get; set; } // { init; get; }
public int CommentCount { get; set; } // { init; get; }
public string CreatedDate { get; set; } // { init; get; }
public string ClosedDate { get; set; } // { init; get; }
public string Description { get; set; } // { init; get; }
public string Discussion { get; set; } // { init; get; }
public string Effort { get; set; } // { init; get; }
public string HypertextReference { get; set; } // { init; get; }
public int Id { get; set; } // { init; get; }
public string IterationPath { get; set; } // { init; get; }
public string Req { get; set; } // { init; get; }
public string ResolvedDate { get; set; } // { init; get; }
public string Priority { get; set; } // { init; get; }
public string State { get; set; } // { init; get; }
public string Tags { get; set; } // { init; get; }
public string TargetDate { get; set; } // { init; get; }
public string Title { get; set; } // { init; get; }
public string WorkItemType { get; set; } // { init; get; }
public WorkItem(Root raw)
{
string req;
string[] words;
if (string.IsNullOrEmpty(raw.Fields.SystemHistory))
words = Array.Empty<string>();
else
words = raw.Fields.SystemHistory.Split(' ');
if (words.Length < 3 || words[0] != "Req" || words[1] != ":")
req = raw.Id.ToString();
else
req = words[2].Split('<')[0];
string systemAreaPath = raw.Fields.SystemAreaPath.Replace(@"Mesa_FI\", string.Empty);
string iterationPath = raw.Fields.SystemIterationPath.Replace(@"Mesa_FI\", string.Empty);
string hypertextReference = string.IsNullOrEmpty(raw.Links?.Html?.Href) ? string.Empty : raw.Links.Html.Href;
string systemAssignedToDisplayName = raw.Fields.SystemAssignedTo is null ? string.Empty : raw.Fields.SystemAssignedTo.DisplayName;
string effort = raw.Fields.MicrosoftVSTSSchedulingEffort < 0.1 ? "" : Math.Floor(raw.Fields.MicrosoftVSTSSchedulingEffort).ToString("0");
string createdDate = raw.Fields.SystemCreatedDate == DateTime.MinValue ? string.Empty : raw.Fields.SystemCreatedDate.ToString("dd-MMM-yy");
string closedDate = raw.Fields.MicrosoftVSTSCommonClosedDate == DateTime.MinValue ? string.Empty : raw.Fields.MicrosoftVSTSCommonClosedDate.ToString("dd-MMM-yy");
string resolvedDate = raw.Fields.MicrosoftVSTSCommonResolvedDate == DateTime.MinValue ? string.Empty : raw.Fields.MicrosoftVSTSCommonResolvedDate.ToString("dd-MMM-yy");
string targetDate = raw.Fields.MicrosoftVSTSSchedulingTargetDate == DateTime.MinValue ? string.Empty : raw.Fields.MicrosoftVSTSSchedulingTargetDate.ToString("dd-MMM-yy");
string priority = raw.Fields.SystemWorkItemType == "Bug" ? "BugFix" : raw.Fields.MicrosoftVSTSCommonPriority switch
{
1 => "High",
2 => "Med",
3 => "Low",
4 => "TBD",
_ => throw new NotImplementedException(),
};
AreaPath = systemAreaPath;
AssignedToDisplayName = systemAssignedToDisplayName;
CommentCount = raw.Fields.SystemCommentCount;
CreatedDate = createdDate;
ClosedDate = closedDate;
Description = raw.Fields.SystemDescription;
Discussion = raw.Fields.SystemHistory;
Effort = effort;
HypertextReference = hypertextReference;
Id = raw.Id;
IterationPath = iterationPath;
Priority = priority;
Req = req;
ResolvedDate = resolvedDate;
State = raw.Fields.SystemState;
Tags = raw.Fields.SystemTags;
TargetDate = targetDate;
Title = raw.Fields.SystemTitle;
WorkItemType = raw.Fields.SystemWorkItemType;
}
}

View File

@ -9,5 +9,5 @@ public class Avatar
string href
) => Href = href;
public string Href { get; set; } // { init; get; }
public string Href { get; } // { init; get; }
}

View File

@ -6,39 +6,25 @@ namespace Adaptation.FileHandlers.json.WorkItems;
public class Fields
{
[JsonConstructor]
public Fields(string systemAreaPath,
public Fields(
string systemAreaPath,
string systemTeamProject,
string systemIterationPath,
string systemWorkItemType,
string systemState,
string systemReason,
User systemAssignedTo,
SystemAssignedTo systemAssignedTo,
DateTime systemCreatedDate,
User systemCreatedBy,
SystemCreatedBy systemCreatedBy,
DateTime systemChangedDate,
User systemChangedBy,
SystemChangedBy systemChangedBy,
int systemCommentCount,
string systemTitle,
string systemBoardColumn,
bool systemBoardColumnDone,
DateTime microsoftVSTSCommonStateChangeDate,
DateTime microsoftVSTSCommonActivatedDate,
User microsoftVSTSCommonActivatedBy,
DateTime microsoftVSTSCommonResolvedDate,
User microsoftVSTSCommonResolvedBy,
DateTime microsoftVSTSCommonClosedDate,
User microsoftVSTSCommonClosedBy,
int microsoftVSTSCommonPriority,
double microsoftVSTSSchedulingEffort,
DateTime microsoftVSTSSchedulingTargetDate,
double microsoftVSTSCommonStackRank,
string microsoftVSTSCommonValueArea,
string wEF81590F0A22C04FEF834957660F5F0C58KanbanColumn,
bool wEF81590F0A22C04FEF834957660F5F0C58KanbanColumnDone,
string systemDescription,
string systemHistory,
string systemTags,
string href)
string systemTags
)
{
SystemAreaPath = systemAreaPath;
SystemTeamProject = systemTeamProject;
@ -53,123 +39,60 @@ public class Fields
SystemChangedBy = systemChangedBy;
SystemCommentCount = systemCommentCount;
SystemTitle = systemTitle;
SystemBoardColumn = systemBoardColumn;
SystemBoardColumnDone = systemBoardColumnDone;
MicrosoftVSTSCommonStateChangeDate = microsoftVSTSCommonStateChangeDate;
MicrosoftVSTSCommonActivatedDate = microsoftVSTSCommonActivatedDate;
MicrosoftVSTSCommonActivatedBy = microsoftVSTSCommonActivatedBy;
MicrosoftVSTSCommonResolvedDate = microsoftVSTSCommonResolvedDate;
MicrosoftVSTSCommonResolvedBy = microsoftVSTSCommonResolvedBy;
MicrosoftVSTSCommonClosedDate = microsoftVSTSCommonClosedDate;
MicrosoftVSTSCommonClosedBy = microsoftVSTSCommonClosedBy;
MicrosoftVSTSCommonPriority = microsoftVSTSCommonPriority;
MicrosoftVSTSSchedulingEffort = microsoftVSTSSchedulingEffort;
MicrosoftVSTSSchedulingTargetDate = microsoftVSTSSchedulingTargetDate;
MicrosoftVSTSCommonStackRank = microsoftVSTSCommonStackRank;
MicrosoftVSTSCommonValueArea = microsoftVSTSCommonValueArea;
WEF81590F0A22C04FEF834957660F5F0C58KanbanColumn = wEF81590F0A22C04FEF834957660F5F0C58KanbanColumn;
WEF81590F0A22C04FEF834957660F5F0C58KanbanColumnDone = wEF81590F0A22C04FEF834957660F5F0C58KanbanColumnDone;
SystemDescription = systemDescription;
SystemHistory = systemHistory;
SystemTags = systemTags;
Href = href;
}
[JsonPropertyName("System.AreaPath")]
public string SystemAreaPath { get; set; } // { init; get; }
public string SystemAreaPath { get; } // { init; get; }
[JsonPropertyName("System.TeamProject")]
public string SystemTeamProject { get; set; } // { init; get; }
public string SystemTeamProject { get; } // { init; get; }
[JsonPropertyName("System.IterationPath")]
public string SystemIterationPath { get; set; } // { init; get; }
public string SystemIterationPath { get; } // { init; get; }
[JsonPropertyName("System.WorkItemType")]
public string SystemWorkItemType { get; set; } // { init; get; }
public string SystemWorkItemType { get; } // { init; get; }
[JsonPropertyName("System.State")]
public string SystemState { get; set; } // { init; get; }
public string SystemState { get; } // { init; get; }
[JsonPropertyName("System.Reason")]
public string SystemReason { get; set; } // { init; get; }
public string SystemReason { get; } // { init; get; }
[JsonPropertyName("System.AssignedTo")]
public User SystemAssignedTo { get; set; } // { init; get; }
public SystemAssignedTo SystemAssignedTo { get; } // { init; get; }
[JsonPropertyName("System.CreatedDate")]
public DateTime SystemCreatedDate { get; set; } // { init; get; }
public DateTime SystemCreatedDate { get; } // { init; get; }
[JsonPropertyName("System.CreatedBy")]
public User SystemCreatedBy { get; set; } // { init; get; }
public SystemCreatedBy SystemCreatedBy { get; } // { init; get; }
[JsonPropertyName("System.ChangedDate")]
public DateTime SystemChangedDate { get; set; } // { init; get; }
public DateTime SystemChangedDate { get; } // { init; get; }
[JsonPropertyName("System.ChangedBy")]
public User SystemChangedBy { get; set; } // { init; get; }
public SystemChangedBy SystemChangedBy { get; } // { init; get; }
[JsonPropertyName("System.CommentCount")]
public int SystemCommentCount { get; set; } // { init; get; }
public int SystemCommentCount { get; } // { init; get; }
[JsonPropertyName("System.Title")]
public string SystemTitle { get; set; } // { init; get; }
[JsonPropertyName("System.BoardColumn")]
public string SystemBoardColumn { get; set; } // { init; get; }
[JsonPropertyName("System.BoardColumnDone")]
public bool SystemBoardColumnDone { get; set; } // { init; get; }
public string SystemTitle { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.StateChangeDate")]
public DateTime MicrosoftVSTSCommonStateChangeDate { get; set; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.ActivatedDate")]
public DateTime MicrosoftVSTSCommonActivatedDate { get; set; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.ActivatedBy")]
public User MicrosoftVSTSCommonActivatedBy { get; set; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.ResolvedDate")]
public DateTime MicrosoftVSTSCommonResolvedDate { get; set; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.ResolvedBy")]
public User MicrosoftVSTSCommonResolvedBy { get; set; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.ClosedDate")]
public DateTime MicrosoftVSTSCommonClosedDate { get; }
[JsonPropertyName("Microsoft.VSTS.Common.ClosedBy")]
public User MicrosoftVSTSCommonClosedBy { get; }
public DateTime MicrosoftVSTSCommonStateChangeDate { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.Priority")]
public int MicrosoftVSTSCommonPriority { get; set; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Scheduling.Effort")]
public double MicrosoftVSTSSchedulingEffort { get; set; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Scheduling.TargetDate")]
public DateTime MicrosoftVSTSSchedulingTargetDate { get; set; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.StackRank")]
public double MicrosoftVSTSCommonStackRank { get; set; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.ValueArea")]
public string MicrosoftVSTSCommonValueArea { get; set; } // { init; get; }
[JsonPropertyName("WEF_81590F0A22C04FEF834957660F5F0C58_Kanban.Column")]
public string WEF81590F0A22C04FEF834957660F5F0C58KanbanColumn { get; set; } // { init; get; }
[JsonPropertyName("WEF_81590F0A22C04FEF834957660F5F0C58_Kanban.Column.Done")]
public bool WEF81590F0A22C04FEF834957660F5F0C58KanbanColumnDone { get; set; } // { init; get; }
public int MicrosoftVSTSCommonPriority { get; } // { init; get; }
[JsonPropertyName("System.Description")]
public string SystemDescription { get; set; } // { init; get; }
[JsonPropertyName("System.History")]
public string SystemHistory { get; set; } // { init; get; }
public string SystemDescription { get; } // { init; get; }
[JsonPropertyName("System.Tags")]
public string SystemTags { get; set; } // { init; get; }
public string Href { get; set; } // { init; get; }
public string SystemTags { get; } // { init; get; }
}

View File

@ -9,5 +9,5 @@ public class Html
string href
) => Href = href;
public string Href { get; set; } // { init; get; }
public string Href { get; } // { init; get; }
}

View File

@ -6,32 +6,9 @@ public class Links
{
[JsonConstructor]
public Links(
Avatar avatar,
Self self,
WorkItemUpdates workItemUpdates,
WorkItemRevisions workItemRevisions,
WorkItemComments workItemComments,
Html html,
WorkItemType workItemType,
Fields fields
)
{
Avatar = avatar;
Self = self;
WorkItemUpdates = workItemUpdates;
WorkItemRevisions = workItemRevisions;
WorkItemComments = workItemComments;
Html = html;
WorkItemType = workItemType;
Fields = fields;
}
Avatar avatar
) => Avatar = avatar;
public Avatar Avatar { get; set; } // { init; get; }
public Self Self { get; set; } // { init; get; }
public WorkItemUpdates WorkItemUpdates { get; set; } // { init; get; }
public WorkItemRevisions WorkItemRevisions { get; set; } // { init; get; }
public WorkItemComments WorkItemComments { get; set; } // { init; get; }
public Html Html { get; set; } // { init; get; }
public WorkItemType WorkItemType { get; set; } // { init; get; }
public Fields Fields { get; set; } // { init; get; }
[JsonPropertyName("avatar")]
public Avatar Avatar { get; }
}

View File

@ -1,30 +0,0 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class Root
{
[JsonConstructor]
public Root(
int id,
int rev,
Fields fields,
Links links,
string url
)
{
Id = id;
Rev = rev;
Fields = fields;
Links = links;
Url = url;
}
public int Id { get; set; } // { init; get; }
public int Rev { get; set; } // { init; get; }
public Fields Fields { get; set; } // { init; get; }
[JsonPropertyName("_links")]
public Links Links { get; set; } // { init; get; }
public string Url { get; set; } // { init; get; }
}

View File

@ -1,13 +0,0 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class Self
{
[JsonConstructor]
public Self(
string href
) => Href = href;
public string Href { get; set; } // { init; get; }
}

View File

@ -0,0 +1,47 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class SystemAssignedTo
{
[JsonConstructor]
public SystemAssignedTo(
string displayName,
string url,
Links links,
string id,
string uniqueName,
string imageUrl,
string descriptor
)
{
DisplayName = displayName;
Url = url;
Links = links;
Id = id;
UniqueName = uniqueName;
ImageUrl = imageUrl;
Descriptor = descriptor;
}
[JsonPropertyName("displayName")]
public string DisplayName { 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

@ -0,0 +1,47 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class SystemChangedBy
{
[JsonConstructor]
public SystemChangedBy(
string displayName,
string url,
Links links,
string id,
string uniqueName,
string imageUrl,
string descriptor
)
{
DisplayName = displayName;
Url = url;
Links = links;
Id = id;
UniqueName = uniqueName;
ImageUrl = imageUrl;
Descriptor = descriptor;
}
[JsonPropertyName("displayName")]
public string DisplayName { 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

@ -0,0 +1,47 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class SystemCreatedBy
{
[JsonConstructor]
public SystemCreatedBy(
string displayName,
string url,
Links links,
string id,
string uniqueName,
string imageUrl,
string descriptor
)
{
DisplayName = displayName;
Url = url;
Links = links;
Id = id;
UniqueName = uniqueName;
ImageUrl = imageUrl;
Descriptor = descriptor;
}
[JsonPropertyName("displayName")]
public string DisplayName { 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

@ -1,34 +0,0 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class User
{
[JsonConstructor]
public User(
string displayName,
string url,
Links links,
string id,
string uniqueName,
string imageUrl,
string descriptor
)
{
DisplayName = displayName;
Url = url;
Links = links;
Id = id;
UniqueName = uniqueName;
ImageUrl = imageUrl;
Descriptor = descriptor;
}
public string DisplayName { get; set; } // { init; get; }
public string Url { get; set; } // { init; get; }
public Links Links { get; set; } // { init; get; }
public string Id { get; set; } // { init; get; }
public string UniqueName { get; set; } // { init; get; }
public string ImageUrl { get; set; } // { init; get; }
public string Descriptor { get; set; } // { init; get; }
}

View File

@ -0,0 +1,32 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class Value
{
[JsonConstructor]
public Value(
int id,
int rev,
Fields fields,
string url
)
{
Id = id;
Rev = rev;
Fields = fields;
Url = url;
}
[JsonPropertyName("id")]
public int Id { get; }
[JsonPropertyName("rev")]
public int Rev { get; }
[JsonPropertyName("fields")]
public Fields Fields { get; }
[JsonPropertyName("url")]
public string Url { get; }
}

View File

@ -1,13 +0,0 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class WorkItemComments
{
[JsonConstructor]
public WorkItemComments(
string href
) => Href = href;
public string Href { get; set; } // { init; get; }
}

View File

@ -1,13 +0,0 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class WorkItemRevisions
{
[JsonConstructor]
public WorkItemRevisions(
string href
) => Href = href;
public string Href { get; set; } // { init; get; }
}

View File

@ -1,13 +0,0 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class WorkItemType
{
[JsonConstructor]
public WorkItemType(
string href
) => Href = href;
public string Href { get; set; } // { init; get; }
}

View File

@ -1,13 +0,0 @@
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WorkItems;
public class WorkItemUpdates
{
[JsonConstructor]
public WorkItemUpdates(
string href
) => Href = href;
public string Href { get; set; } // { init; get; }
}