complete refactor
This commit is contained in:
95
Blueberry.Redmine/Dto/CustomFieldList.cs
Normal file
95
Blueberry.Redmine/Dto/CustomFieldList.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Blueberry.Redmine.Dto
|
||||
{
|
||||
public class CustomFieldList
|
||||
{
|
||||
public class CustomField
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("customized_type")]
|
||||
public string CustomizedType { get; set; }
|
||||
|
||||
[JsonPropertyName("field_format")]
|
||||
public string FieldFormat { get; set; }
|
||||
|
||||
[JsonPropertyName("regexp")]
|
||||
public string Regexp { get; set; }
|
||||
|
||||
[JsonPropertyName("min_length")]
|
||||
public int? MinLength { get; set; }
|
||||
|
||||
[JsonPropertyName("max_length")]
|
||||
public int? MaxLength { get; set; }
|
||||
|
||||
[JsonPropertyName("is_required")]
|
||||
public bool IsRequired { get; set; }
|
||||
|
||||
[JsonPropertyName("is_filter")]
|
||||
public bool IsFilter { get; set; }
|
||||
|
||||
[JsonPropertyName("searchable")]
|
||||
public bool Searchable { get; set; }
|
||||
|
||||
[JsonPropertyName("multiple")]
|
||||
public bool Multiple { get; set; }
|
||||
|
||||
[JsonPropertyName("default_value")]
|
||||
public string DefaultValue { get; set; }
|
||||
|
||||
[JsonPropertyName("visible")]
|
||||
public bool Visible { get; set; }
|
||||
|
||||
[JsonPropertyName("possible_values")]
|
||||
public List<PossibleValue> PossibleValues { get; set; }
|
||||
|
||||
[JsonPropertyName("trackers")]
|
||||
public List<Tracker> Trackers { get; set; }
|
||||
|
||||
[JsonPropertyName("roles")]
|
||||
public List<Role> Roles { get; set; }
|
||||
}
|
||||
|
||||
public class PossibleValue
|
||||
{
|
||||
[JsonPropertyName("value")]
|
||||
public string Value { get; set; }
|
||||
|
||||
[JsonPropertyName("label")]
|
||||
public string Label { get; set; }
|
||||
}
|
||||
|
||||
public class Role
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Root
|
||||
{
|
||||
[JsonPropertyName("custom_fields")]
|
||||
public List<CustomField> CustomFields { get; set; }
|
||||
}
|
||||
|
||||
public class Tracker
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
197
Blueberry.Redmine/Dto/DetailedIssue.cs
Normal file
197
Blueberry.Redmine/Dto/DetailedIssue.cs
Normal file
@@ -0,0 +1,197 @@
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Blueberry.Redmine.Dto
|
||||
{
|
||||
public class DetailedIssue
|
||||
{
|
||||
public class AssignedTo
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Author
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class CustomField
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("value")]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
public class Detail
|
||||
{
|
||||
[JsonPropertyName("property")]
|
||||
public string Property { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("old_value")]
|
||||
public string OldValue { get; set; }
|
||||
|
||||
[JsonPropertyName("new_value")]
|
||||
public string NewValue { get; set; }
|
||||
}
|
||||
|
||||
public class Issue
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("project")]
|
||||
public Project Project { get; set; }
|
||||
|
||||
[JsonPropertyName("tracker")]
|
||||
public Tracker Tracker { get; set; }
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
public Status Status { get; set; }
|
||||
|
||||
[JsonPropertyName("priority")]
|
||||
public Priority Priority { get; set; }
|
||||
|
||||
[JsonPropertyName("author")]
|
||||
public Author Author { get; set; }
|
||||
|
||||
[JsonPropertyName("assigned_to")]
|
||||
public AssignedTo AssignedTo { get; set; }
|
||||
|
||||
[JsonPropertyName("subject")]
|
||||
public string Subject { get; set; }
|
||||
|
||||
[JsonPropertyName("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[JsonPropertyName("start_date")]
|
||||
public string StartDate { get; set; }
|
||||
|
||||
[JsonPropertyName("due_date")]
|
||||
public object DueDate { get; set; }
|
||||
|
||||
[JsonPropertyName("done_ratio")]
|
||||
public int DoneRatio { get; set; }
|
||||
|
||||
[JsonPropertyName("is_private")]
|
||||
public bool IsPrivate { get; set; }
|
||||
|
||||
[JsonPropertyName("estimated_hours")]
|
||||
public object EstimatedHours { get; set; }
|
||||
|
||||
[JsonPropertyName("total_estimated_hours")]
|
||||
public object TotalEstimatedHours { get; set; }
|
||||
|
||||
[JsonPropertyName("spent_hours")]
|
||||
public double SpentHours { get; set; }
|
||||
|
||||
[JsonPropertyName("total_spent_hours")]
|
||||
public double TotalSpentHours { get; set; }
|
||||
|
||||
[JsonPropertyName("custom_fields")]
|
||||
public List<CustomField> CustomFields { get; set; }
|
||||
|
||||
[JsonPropertyName("created_on")]
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("updated_on")]
|
||||
public DateTime UpdatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("closed_on")]
|
||||
public object ClosedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("journals")]
|
||||
public List<Journal> Journals { get; set; }
|
||||
}
|
||||
|
||||
public class Journal
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("user")]
|
||||
public User User { get; set; }
|
||||
|
||||
[JsonPropertyName("notes")]
|
||||
public string Notes { get; set; }
|
||||
|
||||
[JsonPropertyName("created_on")]
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("private_notes")]
|
||||
public bool PrivateNotes { get; set; }
|
||||
|
||||
[JsonPropertyName("details")]
|
||||
public List<Detail> Details { get; set; }
|
||||
}
|
||||
|
||||
public class Priority
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Project
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Root
|
||||
{
|
||||
[JsonPropertyName("issue")]
|
||||
public Issue Issue { get; set; }
|
||||
}
|
||||
|
||||
public class Status
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Tracker
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class User
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
9
Blueberry.Redmine/Dto/IResponseList.cs
Normal file
9
Blueberry.Redmine/Dto/IResponseList.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Blueberry.Redmine.Dto
|
||||
{
|
||||
public interface IResponseList
|
||||
{
|
||||
public int TotalCount { get; set; }
|
||||
public int Offset { get; set; }
|
||||
public int Limit { get; set; }
|
||||
}
|
||||
}
|
||||
183
Blueberry.Redmine/Dto/IssueList.cs
Normal file
183
Blueberry.Redmine/Dto/IssueList.cs
Normal file
@@ -0,0 +1,183 @@
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Blueberry.Redmine.Dto
|
||||
{
|
||||
public class IssueList
|
||||
{
|
||||
public class AssignedTo
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Author
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class CustomField
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("value")]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
public class Issue
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("project")]
|
||||
public Project Project { get; set; }
|
||||
public string ProjectName => Project.Name;
|
||||
|
||||
[JsonPropertyName("tracker")]
|
||||
public Tracker Tracker { get; set; }
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
public Status Status { get; set; }
|
||||
public string StatusName => Status.Name;
|
||||
|
||||
[JsonPropertyName("priority")]
|
||||
public Priority Priority { get; set; }
|
||||
public string PriorityName => Priority.Name;
|
||||
|
||||
[JsonPropertyName("author")]
|
||||
public Author Author { get; set; }
|
||||
|
||||
[JsonPropertyName("assigned_to")]
|
||||
public AssignedTo AssignedTo { get; set; }
|
||||
|
||||
[JsonPropertyName("subject")]
|
||||
public string Subject { get; set; }
|
||||
|
||||
[JsonPropertyName("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[JsonPropertyName("start_date")]
|
||||
public string StartDate { get; set; }
|
||||
|
||||
[JsonPropertyName("due_date")]
|
||||
public string DueDate { get; set; }
|
||||
|
||||
[JsonPropertyName("done_ratio")]
|
||||
public int DoneRatio { get; set; }
|
||||
|
||||
[JsonPropertyName("is_private")]
|
||||
public bool IsPrivate { get; set; }
|
||||
|
||||
[JsonPropertyName("estimated_hours")]
|
||||
public double? EstimatedHours { get; set; }
|
||||
|
||||
[JsonPropertyName("custom_fields")]
|
||||
public List<CustomField> CustomFields { get; set; }
|
||||
|
||||
[JsonPropertyName("created_on")]
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("updated_on")]
|
||||
public DateTime UpdatedOn { get; set; }
|
||||
public string LastUpdate
|
||||
{
|
||||
get
|
||||
{
|
||||
var span = DateTime.Now - UpdatedOn;
|
||||
|
||||
if (span.TotalMinutes < 1) return "épp most";
|
||||
if (span.TotalMinutes < 60) return $"{(int)span.TotalMinutes} perce";
|
||||
if (span.TotalHours < 24) return $"{(int)span.TotalHours} órája";
|
||||
if (span.TotalDays < 7) return $"{(int)span.TotalDays} napja";
|
||||
if (span.TotalDays < 30) return $"{(int)(span.TotalDays / 7)} hete";
|
||||
if (span.TotalDays < 365) return $"{(int)(span.TotalDays / 30)} hónapja";
|
||||
|
||||
return $"{(int)(span.TotalDays / 365)} éve";
|
||||
}
|
||||
}
|
||||
|
||||
[JsonPropertyName("closed_on")]
|
||||
public DateTime? ClosedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("parent")]
|
||||
public Parent Parent { get; set; }
|
||||
}
|
||||
|
||||
public class Parent
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
public class Priority
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Project
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class SimpleRoot
|
||||
{
|
||||
[JsonPropertyName("issue")]
|
||||
public Issue Issue { get; set; }
|
||||
}
|
||||
|
||||
public class Root : IResponseList
|
||||
{
|
||||
[JsonPropertyName("issues")]
|
||||
public List<Issue> Issues { get; set; }
|
||||
|
||||
[JsonPropertyName("total_count")]
|
||||
public int TotalCount { get; set; }
|
||||
|
||||
[JsonPropertyName("offset")]
|
||||
public int Offset { get; set; }
|
||||
|
||||
[JsonPropertyName("limit")]
|
||||
public int Limit { get; set; }
|
||||
}
|
||||
|
||||
public class Status
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Tracker
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
131
Blueberry.Redmine/Dto/NewIssue.cs
Normal file
131
Blueberry.Redmine/Dto/NewIssue.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Blueberry.Redmine.Dto
|
||||
{
|
||||
public class NewIssue
|
||||
{
|
||||
public class Author
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class CustomField
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("value")]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
public class Issue
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("project")]
|
||||
public Project Project { get; set; }
|
||||
|
||||
[JsonPropertyName("tracker")]
|
||||
public Tracker Tracker { get; set; }
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
public Status Status { get; set; }
|
||||
|
||||
[JsonPropertyName("priority")]
|
||||
public Priority Priority { get; set; }
|
||||
|
||||
[JsonPropertyName("author")]
|
||||
public Author Author { get; set; }
|
||||
|
||||
[JsonPropertyName("subject")]
|
||||
public string Subject { get; set; }
|
||||
|
||||
[JsonPropertyName("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[JsonPropertyName("start_date")]
|
||||
public string StartDate { get; set; }
|
||||
|
||||
[JsonPropertyName("due_date")]
|
||||
public object DueDate { get; set; }
|
||||
|
||||
[JsonPropertyName("done_ratio")]
|
||||
public int DoneRatio { get; set; }
|
||||
|
||||
[JsonPropertyName("is_private")]
|
||||
public bool IsPrivate { get; set; }
|
||||
|
||||
[JsonPropertyName("estimated_hours")]
|
||||
public double EstimatedHours { get; set; }
|
||||
|
||||
[JsonPropertyName("total_estimated_hours")]
|
||||
public double TotalEstimatedHours { get; set; }
|
||||
|
||||
[JsonPropertyName("custom_fields")]
|
||||
public List<CustomField> CustomFields { get; set; }
|
||||
|
||||
[JsonPropertyName("created_on")]
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("updated_on")]
|
||||
public DateTime UpdatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("closed_on")]
|
||||
public object ClosedOn { get; set; }
|
||||
}
|
||||
|
||||
public class Priority
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Project
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Root
|
||||
{
|
||||
[JsonPropertyName("issue")]
|
||||
public Issue Issue { get; set; }
|
||||
}
|
||||
|
||||
public class Status
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Tracker
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
32
Blueberry.Redmine/Dto/PriorityList.cs
Normal file
32
Blueberry.Redmine/Dto/PriorityList.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Blueberry.Redmine.Dto
|
||||
{
|
||||
public class PriorityList
|
||||
{
|
||||
public class IssuePriority
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("is_default")]
|
||||
public bool IsDefault { get; set; }
|
||||
|
||||
[JsonPropertyName("active")]
|
||||
public bool Active { get; set; }
|
||||
}
|
||||
|
||||
public class Root
|
||||
{
|
||||
[JsonPropertyName("issue_priorities")]
|
||||
public List<IssuePriority> IssuePriorities { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
83
Blueberry.Redmine/Dto/ProjectList.cs
Normal file
83
Blueberry.Redmine/Dto/ProjectList.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Blueberry.Redmine.Dto
|
||||
{
|
||||
public class ProjectList
|
||||
{
|
||||
public class CustomField
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("value")]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
public class Parent
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Project
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("identifier")]
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonPropertyName("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
[JsonPropertyName("is_public")]
|
||||
public bool IsPublic { get; set; }
|
||||
|
||||
[JsonPropertyName("inherit_members")]
|
||||
public bool InheritMembers { get; set; }
|
||||
|
||||
[JsonPropertyName("custom_fields")]
|
||||
public List<CustomField> CustomFields { get; set; }
|
||||
|
||||
[JsonPropertyName("created_on")]
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("updated_on")]
|
||||
public DateTime UpdatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("parent")]
|
||||
public Parent Parent { get; set; }
|
||||
}
|
||||
|
||||
public class Root : IResponseList
|
||||
{
|
||||
[JsonPropertyName("projects")]
|
||||
public List<Project> Projects { get; set; }
|
||||
|
||||
[JsonPropertyName("total_count")]
|
||||
public int TotalCount { get; set; }
|
||||
|
||||
[JsonPropertyName("offset")]
|
||||
public int Offset { get; set; }
|
||||
|
||||
[JsonPropertyName("limit")]
|
||||
public int Limit { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
89
Blueberry.Redmine/Dto/ProjectTrackers.cs
Normal file
89
Blueberry.Redmine/Dto/ProjectTrackers.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Blueberry.Redmine.Dto
|
||||
{
|
||||
public class ProjectTrackers
|
||||
{
|
||||
public class CustomField
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("value")]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
public class Parent
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Project
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("identifier")]
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonPropertyName("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[JsonPropertyName("homepage")]
|
||||
public string Homepage { get; set; }
|
||||
|
||||
[JsonPropertyName("parent")]
|
||||
public Parent Parent { get; set; }
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
[JsonPropertyName("is_public")]
|
||||
public bool IsPublic { get; set; }
|
||||
|
||||
[JsonPropertyName("inherit_members")]
|
||||
public bool InheritMembers { get; set; }
|
||||
|
||||
[JsonPropertyName("custom_fields")]
|
||||
public List<CustomField> CustomFields { get; set; }
|
||||
|
||||
[JsonPropertyName("trackers")]
|
||||
public List<Tracker> Trackers { get; set; }
|
||||
|
||||
[JsonPropertyName("created_on")]
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("updated_on")]
|
||||
public DateTime UpdatedOn { get; set; }
|
||||
}
|
||||
|
||||
public class Root
|
||||
{
|
||||
[JsonPropertyName("project")]
|
||||
public Project Project { get; set; }
|
||||
}
|
||||
|
||||
public class Tracker
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
29
Blueberry.Redmine/Dto/StatusList.cs
Normal file
29
Blueberry.Redmine/Dto/StatusList.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Blueberry.Redmine.Dto
|
||||
{
|
||||
public class StatusList
|
||||
{
|
||||
public class IssueStatus
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("is_closed")]
|
||||
public bool IsClosed { get; set; }
|
||||
}
|
||||
|
||||
public class Root
|
||||
{
|
||||
[JsonPropertyName("issue_statuses")]
|
||||
public List<IssueStatus> IssueStatuses { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
74
Blueberry.Redmine/Dto/UserInfo.cs
Normal file
74
Blueberry.Redmine/Dto/UserInfo.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Blueberry.Redmine.Dto
|
||||
{
|
||||
public class UserInfo
|
||||
{
|
||||
public class CustomField
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("value")]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
public class Root
|
||||
{
|
||||
[JsonPropertyName("user")]
|
||||
public User User { get; set; }
|
||||
}
|
||||
|
||||
public class User
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("login")]
|
||||
public string Login { get; set; }
|
||||
|
||||
[JsonPropertyName("admin")]
|
||||
public bool Admin { get; set; }
|
||||
|
||||
[JsonPropertyName("firstname")]
|
||||
public string Firstname { get; set; }
|
||||
|
||||
[JsonPropertyName("lastname")]
|
||||
public string Lastname { get; set; }
|
||||
|
||||
[JsonPropertyName("mail")]
|
||||
public string Mail { get; set; }
|
||||
|
||||
[JsonPropertyName("created_on")]
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("updated_on")]
|
||||
public DateTime UpdatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("last_login_on")]
|
||||
public DateTime LastLoginOn { get; set; }
|
||||
|
||||
[JsonPropertyName("passwd_changed_on")]
|
||||
public DateTime PasswdChangedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("twofa_scheme")]
|
||||
public object TwofaScheme { get; set; }
|
||||
|
||||
[JsonPropertyName("api_key")]
|
||||
public string ApiKey { get; set; }
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
[JsonPropertyName("custom_fields")]
|
||||
public List<CustomField> CustomFields { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
107
Blueberry.Redmine/Dto/UserTime.cs
Normal file
107
Blueberry.Redmine/Dto/UserTime.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Blueberry.Redmine.Dto
|
||||
{
|
||||
public class UserTime
|
||||
{
|
||||
public class Activity
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class CustomField
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("value")]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
public class Issue
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
public class Project
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class Root : IResponseList
|
||||
{
|
||||
[JsonPropertyName("time_entries")]
|
||||
public List<TimeEntry> TimeEntries { get; set; }
|
||||
|
||||
[JsonPropertyName("total_count")]
|
||||
public int TotalCount { get; set; }
|
||||
|
||||
[JsonPropertyName("offset")]
|
||||
public int Offset { get; set; }
|
||||
|
||||
[JsonPropertyName("limit")]
|
||||
public int Limit { get; set; }
|
||||
}
|
||||
|
||||
public class TimeEntry
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("project")]
|
||||
public Project Project { get; set; }
|
||||
|
||||
[JsonPropertyName("issue")]
|
||||
public Issue Issue { get; set; }
|
||||
|
||||
[JsonPropertyName("user")]
|
||||
public User User { get; set; }
|
||||
|
||||
[JsonPropertyName("activity")]
|
||||
public Activity Activity { get; set; }
|
||||
|
||||
[JsonPropertyName("hours")]
|
||||
public double Hours { get; set; }
|
||||
|
||||
[JsonPropertyName("comments")]
|
||||
public string Comments { get; set; }
|
||||
|
||||
[JsonPropertyName("spent_on")]
|
||||
public string SpentOn { get; set; }
|
||||
|
||||
[JsonPropertyName("created_on")]
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("updated_on")]
|
||||
public DateTime UpdatedOn { get; set; }
|
||||
|
||||
[JsonPropertyName("custom_fields")]
|
||||
public List<CustomField> CustomFields { get; set; }
|
||||
}
|
||||
|
||||
public class User
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
Reference in New Issue
Block a user