443 lines
12 KiB
C#
443 lines
12 KiB
C#
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
using xApi.Helpers;
|
|
|
|
namespace xApi.Models
|
|
{
|
|
public class AzureConnectionDataDto
|
|
{
|
|
[JsonPropertyName("instanceId")]
|
|
public string? InstanceId { get; set; }
|
|
|
|
[JsonPropertyName("deploymentId")]
|
|
public string? DeploymentId { get; set; }
|
|
|
|
[JsonPropertyName("deploymentType")]
|
|
public string? DeploymentType { get; set; }
|
|
|
|
[JsonPropertyName("authorizedUser")]
|
|
public AzureUserDetailsDto? AuthorizedUser { get; set; }
|
|
|
|
[JsonPropertyName("authenticatedUser")]
|
|
public AzureUserDetailsDto? AuthenticatedUser { get; set; }
|
|
|
|
[JsonPropertyName("locationServiceData")]
|
|
public AzureLocationServiceDto? LocationServiceData { get; set; }
|
|
}
|
|
|
|
public class AzurePropertyValueDto
|
|
{
|
|
[JsonPropertyName("$type")]
|
|
public string? Type { get; set; }
|
|
|
|
[JsonPropertyName("$value")]
|
|
public string? Value { get; set; }
|
|
}
|
|
|
|
public class AzureUserDetailsDto
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public string? Id { get; set; }
|
|
|
|
[JsonPropertyName("isActive")]
|
|
public bool IsActive { get; set; }
|
|
|
|
[JsonPropertyName("metaTypeId")]
|
|
public int MetaTypeId { get; set; }
|
|
|
|
[JsonPropertyName("descriptor")]
|
|
public string? Descriptor { get; set; }
|
|
|
|
[JsonPropertyName("resourceVersion")]
|
|
public int ResourceVersion { get; set; }
|
|
|
|
[JsonPropertyName("subjectDescriptor")]
|
|
public string? SubjectDescriptor { get; set; }
|
|
|
|
[JsonPropertyName("providerDisplayName")]
|
|
public string? ProviderDisplayName { get; set; }
|
|
|
|
[JsonPropertyName("properties")]
|
|
public Dictionary<string, AzurePropertyValueDto>? Properties { get; set; }
|
|
}
|
|
|
|
public class AzureLocationServiceDto
|
|
{
|
|
[JsonPropertyName("lastChangeId")]
|
|
public int LastChangeId { get; set; }
|
|
|
|
[JsonPropertyName("lastChangeId64")]
|
|
public long LastChangeId64 { get; set; }
|
|
|
|
[JsonPropertyName("clientCacheTimeToLive")]
|
|
public int ClientCacheTimeToLive { get; set; }
|
|
|
|
[JsonPropertyName("defaultAccessMappingMoniker")]
|
|
public string? DefaultAccessMappingMoniker { get; set; }
|
|
}
|
|
|
|
public class AzureProjectDto
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public Guid Id { get; set; }
|
|
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; set; }
|
|
|
|
[JsonPropertyName("description")]
|
|
public string? Description { get; set; }
|
|
|
|
[JsonPropertyName("url")]
|
|
public string? Url { get; set; }
|
|
|
|
[JsonPropertyName("state")]
|
|
public string? State { get; set; }
|
|
|
|
[JsonPropertyName("revision")]
|
|
public int? Revision { get; set; }
|
|
|
|
[JsonPropertyName("visibility")]
|
|
public string? Visibility { get; set; }
|
|
|
|
[JsonPropertyName("lastUpdateTime")]
|
|
public DateTime LastUpdateTime { get; set; }
|
|
}
|
|
|
|
public class AzureRepositoryDto
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public Guid Id { get; set; }
|
|
|
|
[JsonPropertyName("size")]
|
|
public long Size { get; set; }
|
|
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; set; }
|
|
|
|
[JsonPropertyName("url")]
|
|
public string? Url { get; set; }
|
|
|
|
[JsonPropertyName("webUrl")]
|
|
public string? WebUrl { get; set; }
|
|
|
|
[JsonPropertyName("sshUrl")]
|
|
public string? SshUrl { get; set; }
|
|
|
|
[JsonPropertyName("isDisabled")]
|
|
public bool IsDisabled { get; set; }
|
|
|
|
[JsonPropertyName("remoteUrl")]
|
|
public string? RemoteUrl { get; set; }
|
|
|
|
[JsonPropertyName("defaultBranch")]
|
|
public string? DefaultBranch { get; set; }
|
|
|
|
[JsonPropertyName("project")]
|
|
public AzureProjectDto? Project { get; set; }
|
|
}
|
|
|
|
public class AzureWorkItemDto
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public int Id { get; set; }
|
|
|
|
[JsonPropertyName("rev")]
|
|
public int Rev { get; set; }
|
|
|
|
[JsonPropertyName("fields")]
|
|
public AzureWorkItemFieldsDto? Fields { get; set; }
|
|
|
|
[JsonPropertyName("_links")]
|
|
public AzureWorkItemLinksDto? Links { get; set; }
|
|
|
|
[JsonPropertyName("url")]
|
|
public string? Url { get; set; }
|
|
}
|
|
|
|
[JsonConverter(typeof(AzureWorkItemFieldsDtoConverter))]
|
|
public class AzureWorkItemFieldsDto
|
|
{
|
|
[JsonPropertyName("System.AreaPath")]
|
|
public string? AreaPath { get; set; }
|
|
|
|
[JsonPropertyName("System.TeamProject")]
|
|
public string? TeamProject { get; set; }
|
|
|
|
[JsonPropertyName("System.IterationPath")]
|
|
public string? IterationPath { get; set; }
|
|
|
|
[JsonPropertyName("System.WorkItemType")]
|
|
public string? WorkItemType { get; set; }
|
|
|
|
[JsonPropertyName("System.State")]
|
|
public string? State { get; set; }
|
|
|
|
[JsonPropertyName("System.Reason")]
|
|
public string? Reason { get; set; }
|
|
|
|
[JsonPropertyName("System.AssignedTo")]
|
|
public AzureAssigneeDto? AssignedTo { get; set; }
|
|
|
|
[JsonPropertyName("System.CreatedDate")]
|
|
public DateTimeOffset? CreatedDate { get; set; }
|
|
|
|
[JsonPropertyName("System.CreatedBy")]
|
|
public AzureAssigneeDto? CreatedBy { get; set; }
|
|
|
|
[JsonPropertyName("System.ChangedDate")]
|
|
public DateTimeOffset? ChangedDate { get; set; }
|
|
|
|
[JsonPropertyName("System.ChangedBy")]
|
|
public AzureAssigneeDto? ChangedBy { get; set; }
|
|
|
|
[JsonPropertyName("System.CommentCount")]
|
|
public int CommentCount { get; set; }
|
|
|
|
[JsonPropertyName("System.Title")]
|
|
public string? Title { get; set; }
|
|
|
|
[JsonPropertyName("System.BoardColumn")]
|
|
public string? BoardColumn { get; set; }
|
|
|
|
[JsonPropertyName("System.BoardColumnDone")]
|
|
public bool BoardColumnDone { get; set; }
|
|
|
|
[JsonPropertyName("System.Description")]
|
|
public string? Description { get; set; }
|
|
|
|
public Dictionary<string, string> OtherFields { get; set; }
|
|
= new(StringComparer.OrdinalIgnoreCase);
|
|
}
|
|
|
|
public class WorkItemRevisionDto
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public int Id { get; set; }
|
|
|
|
[JsonPropertyName("rev")]
|
|
public int Rev { get; set; }
|
|
|
|
[JsonPropertyName("fields")]
|
|
public AzureWorkItemFieldsDto? Fields { get; set; }
|
|
|
|
[JsonPropertyName("url")]
|
|
public string? Url { get; set; }
|
|
}
|
|
|
|
public class AzureWorkItemTypeDto
|
|
{
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; set; }
|
|
|
|
[JsonPropertyName("referenceName")]
|
|
public string? ReferenceName { get; set; }
|
|
|
|
[JsonPropertyName("description")]
|
|
public string? Description { get; set; }
|
|
|
|
[JsonPropertyName("color")]
|
|
public string? Color { get; set; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public AzureWorkItemTypeIconDto? Icon { get; set; }
|
|
|
|
[JsonPropertyName("isDisabled")]
|
|
public bool IsDisabled { get; set; }
|
|
|
|
[JsonPropertyName("xmlForm")]
|
|
public string? XmlForm { get; set; }
|
|
|
|
[JsonPropertyName("fields")]
|
|
public List<AzureWorkItemFieldDefinitionDto> Fields { get; set; } = [];
|
|
|
|
[JsonPropertyName("fieldInstances")]
|
|
public List<AzureWorkItemFieldDefinitionDto> FieldInstances { get; set; } = [];
|
|
|
|
[JsonPropertyName("transitions")]
|
|
public Dictionary<string, List<AzureWorkItemTransitionDto>> Transitions { get; set; } = [];
|
|
|
|
[JsonPropertyName("states")]
|
|
public List<AzureWorkItemStateDto> States { get; set; } = [];
|
|
|
|
[JsonPropertyName("url")]
|
|
public string? Url { get; set; }
|
|
}
|
|
|
|
public class AzureWorkItemFieldDto
|
|
{
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; set; }
|
|
|
|
[JsonPropertyName("referenceName")]
|
|
public string? ReferenceName { get; set; }
|
|
|
|
[JsonPropertyName("description")]
|
|
public string? Description { get; set; }
|
|
|
|
[JsonPropertyName("type")]
|
|
public string? Type { get; set; }
|
|
|
|
[JsonPropertyName("usage")]
|
|
public string? Usage { get; set; }
|
|
|
|
[JsonPropertyName("readOnly")]
|
|
public bool ReadOnly { get; set; }
|
|
|
|
[JsonPropertyName("canSortBy")]
|
|
public bool CanSortBy { get; set; }
|
|
|
|
[JsonPropertyName("isQueryable")]
|
|
public bool IsQueryable { get; set; }
|
|
|
|
[JsonPropertyName("supportedOperations")]
|
|
public List<AzureFieldSupportedOperationDto> SupportedOperations { get; set; } = new();
|
|
|
|
[JsonPropertyName("isIdentity")]
|
|
public bool IsIdentity { get; set; }
|
|
|
|
[JsonPropertyName("isPicklist")]
|
|
public bool IsPicklist { get; set; }
|
|
|
|
[JsonPropertyName("isPicklistSuggested")]
|
|
public bool IsPicklistSuggested { get; set; }
|
|
|
|
[JsonPropertyName("url")]
|
|
public string? Url { get; set; }
|
|
|
|
[JsonExtensionData]
|
|
public Dictionary<string, JsonElement>? AdditionalProperties { get; set; }
|
|
}
|
|
|
|
public class AzureFieldSupportedOperationDto
|
|
{
|
|
[JsonPropertyName("referenceName")]
|
|
public string? ReferenceName { get; set; }
|
|
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; set; }
|
|
}
|
|
|
|
public class AzureWorkItemFieldDefinitionDto
|
|
{
|
|
[JsonPropertyName("defaultValue")]
|
|
public JsonElement? DefaultValue { get; set; }
|
|
|
|
[JsonPropertyName("helpText")]
|
|
public string? HelpText { get; set; }
|
|
|
|
[JsonPropertyName("alwaysRequired")]
|
|
public bool AlwaysRequired { get; set; }
|
|
|
|
[JsonPropertyName("referenceName")]
|
|
public string? ReferenceName { get; set; }
|
|
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; set; }
|
|
|
|
[JsonPropertyName("url")]
|
|
public string? Url { get; set; }
|
|
|
|
[JsonExtensionData]
|
|
public Dictionary<string, JsonElement>? AdditionalProperties { get; set; }
|
|
}
|
|
|
|
public class AzureWorkItemTransitionDto
|
|
{
|
|
[JsonPropertyName("to")]
|
|
public string? To { get; set; }
|
|
|
|
[JsonPropertyName("actions")]
|
|
public List<string>? Actions { get; set; }
|
|
}
|
|
|
|
public class AzureWorkItemStateDto
|
|
{
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; set; }
|
|
|
|
[JsonPropertyName("color")]
|
|
public string? Color { get; set; }
|
|
|
|
[JsonPropertyName("category")]
|
|
public string? Category { get; set; }
|
|
}
|
|
|
|
public class AzureWorkItemTypeIconDto
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public string? Id { get; set; }
|
|
|
|
[JsonPropertyName("url")]
|
|
public string? Url { get; set; }
|
|
}
|
|
|
|
public class AzureAssigneeDto
|
|
{
|
|
[JsonPropertyName("displayName")]
|
|
public string? DisplayName { get; set; }
|
|
|
|
[JsonPropertyName("url")]
|
|
public string? Url { get; set; }
|
|
|
|
[JsonPropertyName("_links")]
|
|
public AzureAssigneeLinksDto? Links { get; set; }
|
|
|
|
[JsonPropertyName("id")]
|
|
public string? Id { get; set; }
|
|
|
|
[JsonPropertyName("uniqueName")]
|
|
public string? UniqueName { get; set; }
|
|
|
|
[JsonPropertyName("imageUrl")]
|
|
public string? ImageUrl { get; set; }
|
|
|
|
[JsonPropertyName("descriptor")]
|
|
public string? Descriptor { get; set; }
|
|
}
|
|
|
|
public class AzureAssigneeLinksDto
|
|
{
|
|
[JsonPropertyName("avatar")]
|
|
public AzureItemLinkDto? Avatar { get; set; }
|
|
}
|
|
|
|
public class AzureWorkItemLinksDto
|
|
{
|
|
[JsonPropertyName("self")]
|
|
public AzureItemLinkDto? Self { get; set; }
|
|
|
|
[JsonPropertyName("workItemUpdates")]
|
|
public AzureItemLinkDto? WorkItemUpdates { get; set; }
|
|
|
|
[JsonPropertyName("workItemRevisions")]
|
|
public AzureItemLinkDto? WorkItemRevisions { get; set; }
|
|
|
|
[JsonPropertyName("workItemComments")]
|
|
public AzureItemLinkDto? WorkItemComments { get; set; }
|
|
|
|
[JsonPropertyName("html")]
|
|
public AzureItemLinkDto? Html { get; set; }
|
|
|
|
[JsonPropertyName("workItemType")]
|
|
public AzureItemLinkDto? WorkItemType { get; set; }
|
|
|
|
[JsonPropertyName("fields")]
|
|
public AzureItemLinkDto? Fields { get; set; }
|
|
}
|
|
|
|
public class AzureItemLinkDto
|
|
{
|
|
[JsonPropertyName("href")]
|
|
public string? Href { get; set; }
|
|
}
|
|
|
|
public class AzureListDto<T>
|
|
where T : class
|
|
{
|
|
[JsonPropertyName("count")]
|
|
public int Count { get; set; }
|
|
|
|
[JsonPropertyName("value")]
|
|
public List<T> Value { get; set; } = [];
|
|
}
|
|
} |