Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Entitlements / SKUs #1552

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

Add Entitlements / SKUs #1552

wants to merge 29 commits into from

Conversation

jhoffi
Copy link
Contributor

@jhoffi jhoffi commented Aug 2, 2024

Implementation of Entitlements and SKUs.

@jhoffi jhoffi changed the title Add Entitlements Add Entitlements / SKUs Aug 2, 2024
restapi.go Outdated Show resolved Hide resolved
@jhoffi jhoffi marked this pull request as ready for review August 14, 2024 22:40
@jhoffi
Copy link
Contributor Author

jhoffi commented Aug 29, 2024

@FedorLap2006

Copy link

@glotchimo glotchimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, would love to see this get an owner review so it can land! Looking forward to being able to use this

@jhoffi jhoffi requested a review from glotchimo October 5, 2024 12:35
Copy link

@glotchimo glotchimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just curious about the use of pointers in Entitlement

// When the subscription was canceled. Only present if the subscription has been canceled.
CanceledAt *time.Time `json:"canceled_at,omitempty"`

// ISO3166-1 alpha-2 country code of the payment source used to purchase the subscription. Missing unless queried with a private OAuth scope.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for including country code type

structs.go Outdated
@@ -2467,7 +2509,7 @@ type Entitlement struct {

// The ID of the user that is granted access to the entitlement's sku
// Only available for user subscriptions.
UserID string `json:"user_id,omitempty"`
UserID *string `json:"user_id,omitempty"`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there ever a point at which we'd expect/want a default string value here? Wondering if the introduction of pointer risk is necessary or if we can roll with default values without losing any important data (no user has no ID, no guild has no ID, no entitlement has a start time at zero, etc.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, thank you. However, I would keep all the optional timestamps as pointers, since this is also done in other structs (e.g., Channel, Member, Invite).

@ralfizzle
Copy link

Is this approved can it be merged?

@glotchimo
Copy link

Is this approved can it be merged?

AFAIK we're waiting on maintainer approval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants