-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): add String-based API support (#235)
* feat(api): add String-based API support * chore: deprecate branch methods in Source Files section
- Loading branch information
Showing
54 changed files
with
1,885 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
using JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
|
||
#nullable enable | ||
|
||
namespace Crowdin.Api.Branches | ||
{ | ||
[PublicAPI] | ||
public class AddBranchRequest | ||
{ | ||
[JsonProperty("name")] | ||
#pragma warning disable CS8618 | ||
public string Name { get; set; } | ||
#pragma warning restore CS8618 | ||
|
||
[JsonProperty("title")] | ||
public string? Title { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
using System; | ||
using JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
|
||
namespace Crowdin.Api.Branches | ||
{ | ||
[PublicAPI] | ||
public class Branch | ||
{ | ||
[JsonProperty("id")] | ||
public int Id { get; set; } | ||
|
||
[JsonProperty("projectId")] | ||
public int ProjectId { get; set; } | ||
|
||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonProperty("title")] | ||
public string Title { get; set; } | ||
|
||
[JsonProperty("createdAt")] | ||
public DateTimeOffset CreatedAt { get; set; } | ||
|
||
[JsonProperty("updatedAt")] | ||
public DateTimeOffset? UpdatedAt { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
using System; | ||
using JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
|
||
namespace Crowdin.Api.Branches | ||
{ | ||
[PublicAPI] | ||
public class BranchCloneStatus | ||
{ | ||
[JsonProperty("identifier")] | ||
public string Identifier { get; set; } | ||
|
||
[JsonProperty("status")] | ||
public OperationStatus Status { get; set; } | ||
|
||
[JsonProperty("progress")] | ||
public int Progress { get; set; } | ||
|
||
[JsonProperty("attributes")] | ||
public object Attributes { get; set; } | ||
|
||
[JsonProperty("createdAt")] | ||
public DateTimeOffset CreatedAt { get; set; } | ||
|
||
[JsonProperty("updatedAt")] | ||
public DateTimeOffset? UpdatedAt { get; set; } | ||
|
||
[JsonProperty("startedAt")] | ||
public DateTimeOffset? StartedAt { get; set; } | ||
|
||
[JsonProperty("finishedAt")] | ||
public DateTimeOffset? FinishedAt { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
using System; | ||
using JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
|
||
namespace Crowdin.Api.Branches | ||
{ | ||
[PublicAPI] | ||
public class BranchMergeStatus | ||
{ | ||
[JsonProperty("identifier")] | ||
public string Identifier { get; set; } | ||
|
||
[JsonProperty("status")] | ||
public OperationStatus Status { get; set; } | ||
|
||
[JsonProperty("progress")] | ||
public int Progress { get; set; } | ||
|
||
[JsonProperty("attributes")] | ||
public AttributesData Attributes { get; set; } | ||
|
||
[JsonProperty("createdAt")] | ||
public DateTimeOffset CreatedAt { get; set; } | ||
|
||
[JsonProperty("updatedAt")] | ||
public DateTimeOffset? UpdatedAt { get; set; } | ||
|
||
[JsonProperty("startedAt")] | ||
public DateTimeOffset? StartedAt { get; set; } | ||
|
||
[JsonProperty("finishedAt")] | ||
public DateTimeOffset FinishedAt { get; set; } | ||
|
||
[PublicAPI] | ||
public class AttributesData | ||
{ | ||
[JsonProperty("sourceBranchId")] | ||
public int SourceBranchId { get; set; } | ||
|
||
[JsonProperty("deleteAfterMerge")] | ||
public bool DeleteAfterMerge { get; set; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
using System.ComponentModel; | ||
using JetBrains.Annotations; | ||
|
||
namespace Crowdin.Api.Branches | ||
{ | ||
[PublicAPI] | ||
public enum BranchMergeStatusId | ||
{ | ||
[Description("conflict")] | ||
Conflict, | ||
|
||
[Description("failed")] | ||
Failed, | ||
|
||
[Description("inProgress")] | ||
InProgress, | ||
|
||
[Description("merged")] | ||
Merged | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
using JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
|
||
namespace Crowdin.Api.Branches | ||
{ | ||
[PublicAPI] | ||
public class BranchMergeSummary | ||
{ | ||
[JsonProperty("status")] | ||
public BranchMergeStatusId Status { get; set; } | ||
|
||
[JsonProperty("sourceBranchId")] | ||
public int SourceBranchId { get; set; } | ||
|
||
[JsonProperty("targetBranchId")] | ||
public int TargetBranchId { get; set; } | ||
|
||
[JsonProperty("dryRun")] | ||
public bool DryRun { get; set; } | ||
|
||
[JsonProperty("details")] | ||
public DetailsData Details { get; set; } | ||
|
||
[PublicAPI] | ||
public class DetailsData | ||
{ | ||
[JsonProperty("added")] | ||
public int Added { get; set; } | ||
|
||
[JsonProperty("deleted")] | ||
public int Deleted { get; set; } | ||
|
||
[JsonProperty("updated")] | ||
public int Updated { get; set; } | ||
|
||
[JsonProperty("conflicted")] | ||
public int Conflicted { get; set; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
using System.ComponentModel; | ||
using JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
|
||
namespace Crowdin.Api.Branches | ||
{ | ||
[PublicAPI] | ||
public class BranchPatch : PatchEntry | ||
{ | ||
[JsonProperty("path")] | ||
public BranchPatchPath Path { get; set; } | ||
} | ||
|
||
[PublicAPI] | ||
public enum BranchPatchPath | ||
{ | ||
[Description("/name")] | ||
Name, | ||
|
||
[Description("/title")] | ||
Title, | ||
|
||
[Description("/exportPattern")] | ||
ExportPattern, | ||
|
||
[Description("/priority")] | ||
Priority | ||
} | ||
} |
Oops, something went wrong.