-
-
Notifications
You must be signed in to change notification settings - Fork 733
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* uhhhhhhhhhhhhhhhhhhh yes * uhhhhhhhhhhhhhhhhhhh yes * ~~i love git~~
- Loading branch information
Showing
20 changed files
with
2,973 additions
and
2,466 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
56 changes: 56 additions & 0 deletions
56
src/Discord.Net.Core/Entities/AppSubscriptions/ISubscription.cs
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,56 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Discord; | ||
|
||
/// <summary> | ||
/// Represents a subscription object. | ||
/// </summary> | ||
public interface ISubscription : ISnowflakeEntity | ||
{ | ||
/// <summary> | ||
/// Gets the ID of the user who is subscribed. | ||
/// </summary> | ||
ulong UserId { get; } | ||
|
||
/// <summary> | ||
/// Gets the SKUs subscribed to. | ||
/// </summary> | ||
IReadOnlyCollection<ulong> SKUIds { get; } | ||
|
||
/// <summary> | ||
/// Gets the entitlements granted for this subscription. | ||
/// </summary> | ||
IReadOnlyCollection<ulong> EntitlementIds { get; } | ||
|
||
/// <summary> | ||
/// Gets the start of the current subscription period. | ||
/// </summary> | ||
DateTimeOffset CurrentPeriodStart { get; } | ||
|
||
/// <summary> | ||
/// Gets end of the current subscription period. | ||
/// </summary> | ||
DateTimeOffset CurrentPeriodEnd { get; } | ||
|
||
/// <summary> | ||
/// Gets the current status of the subscription. | ||
/// </summary> | ||
SubscriptionStatus Status { get; } | ||
|
||
/// <summary> | ||
/// Gets when the subscription was canceled. | ||
/// </summary> | ||
/// <remarks> | ||
/// <see langword="null"/> if the subscription has not been canceled. | ||
/// </remarks> | ||
DateTimeOffset? CanceledAt { get; } | ||
|
||
/// <summary> | ||
/// Gets country code of the payment source used to purchase the subscription. | ||
/// </summary> | ||
/// <remarks> | ||
/// Requires an oauth scope. | ||
/// </remarks> | ||
string Country { get; } | ||
} |
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
19 changes: 19 additions & 0 deletions
19
src/Discord.Net.Core/Entities/AppSubscriptions/SubscriptionStatus.cs
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 @@ | ||
namespace Discord; | ||
|
||
public enum SubscriptionStatus | ||
{ | ||
/// <summary> | ||
/// Subscription is active and scheduled to renew. | ||
/// </summary> | ||
Active = 0, | ||
|
||
/// <summary> | ||
/// Subscription is active but will not renew. | ||
/// </summary> | ||
Ending = 1, | ||
|
||
/// <summary> | ||
/// Subscription is inactive and not being charged. | ||
/// </summary> | ||
Inactive = 2 | ||
} |
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
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,34 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
|
||
namespace Discord.API; | ||
|
||
internal class Subscription | ||
{ | ||
[JsonProperty("id")] | ||
public ulong Id { get; set; } | ||
|
||
[JsonProperty("user_id")] | ||
public ulong UserId { get; set; } | ||
|
||
[JsonProperty("sku_ids")] | ||
public ulong[] SKUIds { get; set; } | ||
|
||
[JsonProperty("entitlement_ids")] | ||
public ulong[] EntitlementIds { get; set; } | ||
|
||
[JsonProperty("current_period_start")] | ||
public DateTimeOffset CurrentPeriodStart { get; set; } | ||
|
||
[JsonProperty("current_period_end")] | ||
public DateTimeOffset CurrentPeriodEnd { get; set; } | ||
|
||
[JsonProperty("status")] | ||
public SubscriptionStatus Status { get; set; } | ||
|
||
[JsonProperty("canceled_at")] | ||
public DateTimeOffset? CanceledAt { get; set; } | ||
|
||
[JsonProperty("country")] | ||
public string Country { 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
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
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
Oops, something went wrong.