-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from usender/develop
Develop
- Loading branch information
Showing
69 changed files
with
461 additions
and
234 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,74 @@ | ||
namespace Sender.UniOne.ApiClient.Apis | ||
{ | ||
/// <summary> | ||
/// API endpoints | ||
/// </summary> | ||
public class ApiEndpoint | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
private const string PREFIX_ENDPOINT = "transactional/api/v1"; | ||
|
||
/// <summary> | ||
/// Uri | ||
/// </summary> | ||
internal string Uri { get; private set; } = PREFIX_ENDPOINT; | ||
|
||
protected ApiEndpoint(string url) | ||
{ | ||
Path(url); | ||
} | ||
|
||
/// <summary> | ||
/// Email endpoints | ||
/// </summary> | ||
internal static EmailEndpoint Email => new EmailEndpoint(); | ||
|
||
/// <summary> | ||
/// Template endpoints | ||
/// </summary> | ||
internal static TemplateEndpoint Template => new TemplateEndpoint(); | ||
|
||
/// <summary> | ||
/// Webhook endpoints | ||
/// </summary> | ||
internal static WebhookEndpoint Webhook => new WebhookEndpoint(); | ||
|
||
/// <summary> | ||
/// Unsubscribed endpoints | ||
/// </summary> | ||
internal static UnsubscribedEndpoint Unsubscribed => new UnsubscribedEndpoint(); | ||
|
||
/// <summary> | ||
/// Suppression endpoints | ||
/// </summary> | ||
internal static SuppressionEndpoint Suppression => new SuppressionEndpoint(); | ||
|
||
/// <summary> | ||
/// Domain endpoints | ||
/// </summary> | ||
internal static DomainEndpoint Domain => new DomainEndpoint(); | ||
|
||
/// <summary> | ||
/// Project endpoints | ||
/// </summary> | ||
internal static ProjectEndpoint Project => new ProjectEndpoint(); | ||
|
||
/// <summary> | ||
/// System endpoints | ||
/// </summary> | ||
internal static SystemEndpoint System => new SystemEndpoint(); | ||
|
||
/// <summary> | ||
/// Merge path | ||
/// </summary> | ||
/// <param name="url">Postfix of url</param> | ||
/// <returns></returns> | ||
protected ApiEndpoint Path(string url) | ||
{ | ||
Uri += "/" + url; | ||
return this; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
namespace Sender.UniOne.ApiClient.Apis | ||
{ | ||
internal class DomainEndpoint : ApiEndpoint | ||
{ | ||
internal DomainEndpoint() | ||
: base("domain") | ||
{ } | ||
|
||
internal ApiEndpoint GetDnsRecords => Path("get-dns-records.json"); | ||
|
||
internal ApiEndpoint ValidateVerificationRecord => Path("validate-verification-record.json"); | ||
|
||
internal ApiEndpoint ValidateDkim => Path("validate-dkim.json"); | ||
|
||
internal ApiEndpoint List => Path("list.json"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
namespace Sender.UniOne.ApiClient.Apis | ||
{ | ||
internal class EmailEndpoint : ApiEndpoint | ||
{ | ||
internal EmailEndpoint() | ||
: base("email") | ||
{ | ||
} | ||
|
||
internal ApiEndpoint Send => Path("send.json"); | ||
|
||
internal ApiEndpoint Subscribe => Path("subscribe.json"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,18 @@ | ||
namespace Sender.UniOne.ApiClient.Apis | ||
{ | ||
internal class ProjectEndpoint : ApiEndpoint | ||
{ | ||
internal ProjectEndpoint() | ||
: base("project") | ||
{ | ||
} | ||
|
||
internal ApiEndpoint Create => Path("create.json"); | ||
|
||
internal ApiEndpoint Update => Path("update.json"); | ||
|
||
internal ApiEndpoint Delete => Path("delete.json"); | ||
|
||
internal ApiEndpoint List => Path("list.json"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
namespace Sender.UniOne.ApiClient.Apis | ||
{ | ||
internal class SuppressionEndpoint : ApiEndpoint | ||
{ | ||
internal SuppressionEndpoint() | ||
: base("suppression") | ||
{ | ||
} | ||
|
||
internal ApiEndpoint Get => Path("get.json"); | ||
|
||
internal ApiEndpoint Delete => Path("delete.json"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
namespace Sender.UniOne.ApiClient.Apis | ||
{ | ||
internal class SystemEndpoint : ApiEndpoint | ||
{ | ||
internal SystemEndpoint() | ||
: base("system") | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// API end part of endpoint | ||
/// </summary> | ||
internal ApiEndpoint Info => Path("info.json"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
namespace Sender.UniOne.ApiClient.Apis | ||
{ | ||
internal class TemplateEndpoint : ApiEndpoint | ||
{ | ||
internal TemplateEndpoint() | ||
: base("template") | ||
{ } | ||
|
||
internal ApiEndpoint Get => Path("get.json"); | ||
|
||
internal ApiEndpoint Set => Path("set.json"); | ||
|
||
internal ApiEndpoint Delete => Path("delete.json"); | ||
|
||
internal ApiEndpoint List => Path("list.json"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
namespace Sender.UniOne.ApiClient.Apis | ||
{ | ||
internal class UnsubscribedEndpoint:ApiEndpoint | ||
{ | ||
internal UnsubscribedEndpoint() | ||
: base("unsubscribed") | ||
{ | ||
} | ||
|
||
internal ApiEndpoint Set => Path("set.json"); | ||
|
||
internal ApiEndpoint Check => Path("check.json"); | ||
|
||
internal ApiEndpoint List => Path("list.json"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
namespace Sender.UniOne.ApiClient.Apis | ||
{ | ||
internal class WebhookEndpoint : ApiEndpoint | ||
{ | ||
internal WebhookEndpoint() | ||
: base("webhook") | ||
{ } | ||
|
||
internal ApiEndpoint Set => Path("set.json"); | ||
|
||
internal ApiEndpoint Get => Path("get.json"); | ||
|
||
internal ApiEndpoint Delete => Path("delete.json"); | ||
|
||
internal ApiEndpoint List => Path("list.json"); | ||
} | ||
} |
Oops, something went wrong.