-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Application installation API support (#216)
- Loading branch information
Showing
11 changed files
with
764 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
using System; | ||
|
||
namespace Crowdin.Api.Applications | ||
{ | ||
[PublicAPI] | ||
public class Application | ||
{ | ||
private Application() { } | ||
|
||
[JsonProperty("identifier")] | ||
public string Identifier { get; set; } | ||
|
||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonProperty("description")] | ||
public string Description { get; set; } | ||
|
||
[JsonProperty("logo")] | ||
public string Logo { get; set; } | ||
|
||
[JsonProperty("baseUrl")] | ||
public string BaseUrl { get; set; } | ||
|
||
[JsonProperty("manifestUrl")] | ||
public string ManifestUrl { get; set; } | ||
|
||
[JsonProperty("scopes")] | ||
public string[] Scopes { get; set; } | ||
|
||
[JsonProperty("modules")] | ||
public ApplicationModule[] Modules { get; set; } | ||
|
||
[JsonProperty("createdAt")] | ||
public DateTimeOffset CreatedAt { get; set; } | ||
|
||
[JsonProperty("permissions")] | ||
public ApplicationPermissions Permissions { get; set; } | ||
|
||
[JsonProperty("defaultPermissions")] | ||
public JObject DefaultPermissions { get; set; } | ||
|
||
[JsonProperty("limitReached")] | ||
public bool LimitReached { 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 JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace Crowdin.Api.Applications | ||
{ | ||
[PublicAPI] | ||
public class ApplicationModule | ||
{ | ||
[JsonProperty("key")] | ||
public string Key { get; set; } | ||
|
||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("data")] | ||
public JObject Data { get; set; } | ||
|
||
[JsonProperty("authenticationType")] | ||
public string AuthenticationType { 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,17 @@ | ||
using JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
using System; | ||
|
||
namespace Crowdin.Api.Applications | ||
{ | ||
[PublicAPI] | ||
public class ApplicationPermissions | ||
{ | ||
[JsonProperty("user")] | ||
public ApplicationUser User { get; set; } | ||
|
||
[JsonProperty("project")] | ||
public ApplicationProject Project { 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,26 @@ | ||
using JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
|
||
namespace Crowdin.Api.Applications | ||
{ | ||
[PublicAPI] | ||
public class ApplicationProject | ||
{ | ||
[JsonProperty("value")] | ||
public ApplicationProjectValue Value { get; set; } | ||
|
||
[JsonProperty("ids")] | ||
public ICollection<int> Ids { get; set; } | ||
} | ||
|
||
[PublicAPI] | ||
public enum ApplicationProjectValue | ||
{ | ||
[Description("own")] | ||
Own, | ||
[Description("restricted")] | ||
Restricted | ||
} | ||
} |
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,36 @@ | ||
using JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
|
||
namespace Crowdin.Api.Applications | ||
{ | ||
[PublicAPI] | ||
public class ApplicationUser | ||
{ | ||
[JsonProperty("value")] | ||
public ApplicationUserValue Value { get; set; } | ||
|
||
[JsonProperty("ids")] | ||
public ICollection<int> Ids { get; set; } | ||
} | ||
|
||
[PublicAPI] | ||
public enum ApplicationUserValue | ||
{ | ||
[Description("owner")] | ||
Owner, | ||
|
||
[Description("managers")] | ||
Managers, | ||
|
||
[Description("all")] | ||
All, | ||
|
||
[Description("guests")] | ||
Guests, | ||
|
||
[Description("restricted")] | ||
Restricted | ||
} | ||
} |
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,19 @@ | ||
using JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
|
||
#nullable enable | ||
|
||
namespace Crowdin.Api.Applications | ||
{ | ||
[PublicAPI] | ||
public class InstallApplicationRequest | ||
{ | ||
[JsonProperty("url")] | ||
#pragma warning disable CS8618 | ||
public string Url { get; set; } | ||
#pragma warning restore CS8618 | ||
|
||
[JsonProperty("permissions")] | ||
public ApplicationPermissions? Permissions { 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,20 @@ | ||
using JetBrains.Annotations; | ||
using Newtonsoft.Json; | ||
using System.ComponentModel; | ||
|
||
namespace Crowdin.Api.Applications | ||
{ | ||
[PublicAPI] | ||
public class InstallationPatch: PatchEntry | ||
{ | ||
[JsonProperty("path")] | ||
public InstallationPatchPath Path { get; set; } | ||
} | ||
|
||
[PublicAPI] | ||
public enum InstallationPatchPath | ||
{ | ||
[Description("/permissions")] | ||
Permissions | ||
} | ||
} |
Oops, something went wrong.