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

Update generated code for beta #1947

Open
wants to merge 4 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@


## 81.0.0 - 2024-10-29

Historically, when upgrading webhooks to a new API version, you also had to upgrade your SDK version. Your webhook's API version needed to match the API version pinned by the SDK you were using to ensure successful deserialization of events. With the `2024-09-30.acacia` release, Stripe follows a [new API release process](https://stripe.com/blog/introducing-stripes-new-api-release-process). As a result, you can safely upgrade your webhook endpoints to any API version within a biannual release (like `acacia`) without upgrading the SDK.

However, [a bug](https://github.com/stripe/stripe-go/pull/1940) in the `80.x.y` SDK releases meant that webhook version upgrades from the SDK's pinned `2024-09-30.acacia` version to the new `2024-10-28.acacia` version would fail. Therefore, we are shipping SDK support for `2024-10-28.acacia` as a major version to enforce the idea that an SDK upgrade is also required. Future API versions in the `acacia` line will be released as minor versions.

* [#1931](https://github.com/stripe/stripe-go/pull/1931) This release changes the pinned API version to `2024-10-28.acacia`.
* Add support for new resource `V2.EventDestinations`
* Add support for `New`, `Retrieve`, `Update`, `List`, `Delete`, `Disable`, `Enable` and `Ping` methods on resource `V2.EventDestinations`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1319
v1322
53 changes: 41 additions & 12 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,48 @@ const (
AccountExternalAccountTypeCard AccountExternalAccountType = "card"
)

// If the account is disabled, this string describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). Can be `action_required.requested_capabilities`, `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.incomplete_verification`, `rejected.listed`, `rejected.other`, `rejected.terms_of_service`, `under_review`, or `other`.
// This is typed as an enum for consistency with `requirements.disabled_reason`.
type AccountFutureRequirementsDisabledReason string

// List of values that AccountFutureRequirementsDisabledReason can take
const (
AccountFutureRequirementsDisabledReasonActionRequiredRequestedCapabilities AccountFutureRequirementsDisabledReason = "action_required.requested_capabilities"
AccountFutureRequirementsDisabledReasonListed AccountFutureRequirementsDisabledReason = "listed"
AccountFutureRequirementsDisabledReasonOther AccountFutureRequirementsDisabledReason = "other"
AccountFutureRequirementsDisabledReasonPlatformPaused AccountFutureRequirementsDisabledReason = "platform_paused"
AccountFutureRequirementsDisabledReasonRejectedFraud AccountFutureRequirementsDisabledReason = "rejected.fraud"
AccountFutureRequirementsDisabledReasonRejectedIncompleteVerification AccountFutureRequirementsDisabledReason = "rejected.incomplete_verification"
AccountFutureRequirementsDisabledReasonRejectedListed AccountFutureRequirementsDisabledReason = "rejected.listed"
AccountFutureRequirementsDisabledReasonRejectedOther AccountFutureRequirementsDisabledReason = "rejected.other"
AccountFutureRequirementsDisabledReasonRejectedPlatformFraud AccountFutureRequirementsDisabledReason = "rejected.platform_fraud"
AccountFutureRequirementsDisabledReasonRejectedPlatformOther AccountFutureRequirementsDisabledReason = "rejected.platform_other"
AccountFutureRequirementsDisabledReasonRejectedPlatformTermsOfService AccountFutureRequirementsDisabledReason = "rejected.platform_terms_of_service"
AccountFutureRequirementsDisabledReasonRejectedTermsOfService AccountFutureRequirementsDisabledReason = "rejected.terms_of_service"
AccountFutureRequirementsDisabledReasonRequirementsPastDue AccountFutureRequirementsDisabledReason = "requirements.past_due"
AccountFutureRequirementsDisabledReasonRequirementsPendingVerification AccountFutureRequirementsDisabledReason = "requirements.pending_verification"
AccountFutureRequirementsDisabledReasonUnderReview AccountFutureRequirementsDisabledReason = "under_review"
)

// If the account is disabled, this enum describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification).
type AccountRequirementsDisabledReason string

// List of values that AccountRequirementsDisabledReason can take
const (
AccountRequirementsDisabledReasonFieldsNeeded AccountRequirementsDisabledReason = "fields_needed"
AccountRequirementsDisabledReasonListed AccountRequirementsDisabledReason = "listed"
AccountRequirementsDisabledReasonOther AccountRequirementsDisabledReason = "other"
AccountRequirementsDisabledReasonRejectedFraud AccountRequirementsDisabledReason = "rejected.fraud"
AccountRequirementsDisabledReasonRejectedListed AccountRequirementsDisabledReason = "rejected.listed"
AccountRequirementsDisabledReasonRejectedOther AccountRequirementsDisabledReason = "rejected.other"
AccountRequirementsDisabledReasonRejectedTermsOfService AccountRequirementsDisabledReason = "rejected.terms_of_service"
AccountRequirementsDisabledReasonUnderReview AccountRequirementsDisabledReason = "under_review"
AccountRequirementsDisabledReasonActionRequiredRequestedCapabilities AccountRequirementsDisabledReason = "action_required.requested_capabilities"
AccountRequirementsDisabledReasonListed AccountRequirementsDisabledReason = "listed"
AccountRequirementsDisabledReasonOther AccountRequirementsDisabledReason = "other"
AccountRequirementsDisabledReasonPlatformPaused AccountRequirementsDisabledReason = "platform_paused"
AccountRequirementsDisabledReasonRejectedFraud AccountRequirementsDisabledReason = "rejected.fraud"
AccountRequirementsDisabledReasonRejectedIncompleteVerification AccountRequirementsDisabledReason = "rejected.incomplete_verification"
AccountRequirementsDisabledReasonRejectedListed AccountRequirementsDisabledReason = "rejected.listed"
AccountRequirementsDisabledReasonRejectedOther AccountRequirementsDisabledReason = "rejected.other"
AccountRequirementsDisabledReasonRejectedPlatformFraud AccountRequirementsDisabledReason = "rejected.platform_fraud"
AccountRequirementsDisabledReasonRejectedPlatformOther AccountRequirementsDisabledReason = "rejected.platform_other"
AccountRequirementsDisabledReasonRejectedPlatformTermsOfService AccountRequirementsDisabledReason = "rejected.platform_terms_of_service"
AccountRequirementsDisabledReasonRejectedTermsOfService AccountRequirementsDisabledReason = "rejected.terms_of_service"
AccountRequirementsDisabledReasonRequirementsPastDue AccountRequirementsDisabledReason = "requirements.past_due"
AccountRequirementsDisabledReasonRequirementsPendingVerification AccountRequirementsDisabledReason = "requirements.pending_verification"
AccountRequirementsDisabledReasonUnderReview AccountRequirementsDisabledReason = "under_review"
)

// How frequently funds will be paid out. One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`.
Expand Down Expand Up @@ -1659,8 +1688,8 @@ type AccountFutureRequirements struct {
CurrentDeadline int64 `json:"current_deadline"`
// Fields that need to be collected to keep the account enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash.
CurrentlyDue []string `json:"currently_due"`
// This is typed as a string for consistency with `requirements.disabled_reason`.
DisabledReason string `json:"disabled_reason"`
// This is typed as an enum for consistency with `requirements.disabled_reason`.
DisabledReason AccountFutureRequirementsDisabledReason `json:"disabled_reason"`
// Fields that are `currently_due` and need to be collected again because validation or verification failed.
Errors []*AccountFutureRequirementsError `json:"errors"`
// Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well.
Expand Down Expand Up @@ -1701,7 +1730,7 @@ type AccountRequirements struct {
CurrentDeadline int64 `json:"current_deadline"`
// Fields that need to be collected to keep the account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled.
CurrentlyDue []string `json:"currently_due"`
// If the account is disabled, this string describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). Can be `action_required.requested_capabilities`, `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.incomplete_verification`, `rejected.listed`, `rejected.other`, `rejected.terms_of_service`, `under_review`, or `other`.
// If the account is disabled, this enum describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification).
DisabledReason AccountRequirementsDisabledReason `json:"disabled_reason"`
// Fields that are `currently_due` and need to be collected again because validation or verification failed.
Errors []*AccountRequirementsError `json:"errors"`
Expand Down
2 changes: 2 additions & 0 deletions accountsession.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ type AccountSessionComponentsIssuingCardsListFeaturesParams struct {
CardManagement *bool `form:"card_management"`
// Whether to allow card spend dispute management features.
CardSpendDisputeManagement *bool `form:"card_spend_dispute_management"`
// Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts.
DisableStripeUserAuthentication *bool `form:"disable_stripe_user_authentication"`
// Whether to allow spend control management features.
SpendControlManagement *bool `form:"spend_control_management"`
}
Expand Down
12 changes: 6 additions & 6 deletions billing/creditgrant/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,38 +64,38 @@ func (c Client) Update(id string, params *stripe.BillingCreditGrantParams) (*str
return creditgrant, err
}

// Expires a credit grant
// Expires a credit grant.
func Expire(id string, params *stripe.BillingCreditGrantExpireParams) (*stripe.BillingCreditGrant, error) {
return getC().Expire(id, params)
}

// Expires a credit grant
// Expires a credit grant.
func (c Client) Expire(id string, params *stripe.BillingCreditGrantExpireParams) (*stripe.BillingCreditGrant, error) {
path := stripe.FormatURLPath("/v1/billing/credit_grants/%s/expire", id)
creditgrant := &stripe.BillingCreditGrant{}
err := c.B.Call(http.MethodPost, path, c.Key, params, creditgrant)
return creditgrant, err
}

// Voids a credit grant
// Voids a credit grant.
func VoidGrant(id string, params *stripe.BillingCreditGrantVoidGrantParams) (*stripe.BillingCreditGrant, error) {
return getC().VoidGrant(id, params)
}

// Voids a credit grant
// Voids a credit grant.
func (c Client) VoidGrant(id string, params *stripe.BillingCreditGrantVoidGrantParams) (*stripe.BillingCreditGrant, error) {
path := stripe.FormatURLPath("/v1/billing/credit_grants/%s/void", id)
creditgrant := &stripe.BillingCreditGrant{}
err := c.B.Call(http.MethodPost, path, c.Key, params, creditgrant)
return creditgrant, err
}

// Retrieve a list of credit grants
// Retrieve a list of credit grants.
func List(params *stripe.BillingCreditGrantListParams) *Iter {
return getC().List(params)
}

// Retrieve a list of credit grants
// Retrieve a list of credit grants.
func (c Client) List(listParams *stripe.BillingCreditGrantListParams) *Iter {
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
Expand Down
2 changes: 1 addition & 1 deletion billing_creditbalancesummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (

// The billing credit applicability scope for which to fetch credit balance summary.
type BillingCreditBalanceSummaryFilterApplicabilityScopeParams struct {
// The price type to which credit grants can apply to. We currently only support `metered` price type.
// The price type for which credit grants can apply. We currently only support the `metered` price type.
PriceType *string `form:"price_type"`
}

Expand Down
33 changes: 16 additions & 17 deletions billing_creditgrant.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ const (
BillingCreditGrantAmountTypeMonetary BillingCreditGrantAmountType = "monetary"
)

// The price type to which credit grants can apply to. We currently only support `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
// The price type for which credit grants can apply. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
type BillingCreditGrantApplicabilityConfigScopePriceType string

// List of values that BillingCreditGrantApplicabilityConfigScopePriceType can take
const (
BillingCreditGrantApplicabilityConfigScopePriceTypeMetered BillingCreditGrantApplicabilityConfigScopePriceType = "metered"
)

// The category of this credit grant. This is for tracking purposes and will not be displayed to the customer.
// The category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
type BillingCreditGrantCategory string

// List of values that BillingCreditGrantCategory can take
Expand All @@ -33,7 +33,7 @@ const (
BillingCreditGrantCategoryPromotional BillingCreditGrantCategory = "promotional"
)

// Retrieve a list of credit grants
// Retrieve a list of credit grants.
type BillingCreditGrantListParams struct {
ListParams `form:"*"`
// Only return credit grants for this customer.
Expand Down Expand Up @@ -65,7 +65,7 @@ type BillingCreditGrantAmountParams struct {

// Specify the scope of this applicability config.
type BillingCreditGrantApplicabilityConfigScopeParams struct {
// The price type to which credit grants can apply to. We currently only support `metered` price type.
// The price type for which credit grants can apply. We currently only support the `metered` price type.
PriceType *string `form:"price_type"`
}

Expand All @@ -84,17 +84,17 @@ type BillingCreditGrantParams struct {
ApplicabilityConfig *BillingCreditGrantApplicabilityConfigParams `form:"applicability_config"`
// The category of this credit grant.
Category *string `form:"category"`
// ID of the customer to whom the billing credits should be granted.
// ID of the customer to receive the billing credits.
Customer *string `form:"customer"`
// The time when the billing credits become effective i.e when they are eligible to be used. Defaults to the current timestamp if not specified.
// The time when the billing credits become effectivewhen they're eligible for use. Defaults to the current timestamp if not specified.
EffectiveAt *int64 `form:"effective_at"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// The time when the billing credits created by this credit grant will expire. If set to empty, the billing credits will never expire.
// The time when the billing credits created by this credit grant expire. If set to empty, the billing credits never expire.
ExpiresAt *int64 `form:"expires_at"`
// Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (ex: cost basis) in a structured format.
// Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object (for example, cost basis) in a structured format.
Metadata map[string]string `form:"metadata"`
// A descriptive name shown in dashboard.
// A descriptive name shown in the Dashboard.
Name *string `form:"name"`
}

Expand All @@ -112,7 +112,7 @@ func (p *BillingCreditGrantParams) AddMetadata(key string, value string) {
p.Metadata[key] = value
}

// Expires a credit grant
// Expires a credit grant.
type BillingCreditGrantExpireParams struct {
Params `form:"*"`
// Specifies which fields in the response should be expanded.
Expand All @@ -124,7 +124,7 @@ func (p *BillingCreditGrantExpireParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
}

// Voids a credit grant
// Voids a credit grant.
type BillingCreditGrantVoidGrantParams struct {
Params `form:"*"`
// Specifies which fields in the response should be expanded.
Expand All @@ -150,7 +150,7 @@ type BillingCreditGrantAmount struct {
Type BillingCreditGrantAmountType `json:"type"`
}
type BillingCreditGrantApplicabilityConfigScope struct {
// The price type to which credit grants can apply to. We currently only support `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
// The price type for which credit grants can apply. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
PriceType BillingCreditGrantApplicabilityConfigScopePriceType `json:"price_type"`
}
type BillingCreditGrantApplicabilityConfig struct {
Expand All @@ -160,20 +160,19 @@ type BillingCreditGrantApplicabilityConfig struct {
// A credit grant is an API resource that documents the allocation of some billing credits to a customer.
//
// Related guide: [Billing credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits)
// end
type BillingCreditGrant struct {
APIResource
Amount *BillingCreditGrantAmount `json:"amount"`
ApplicabilityConfig *BillingCreditGrantApplicabilityConfig `json:"applicability_config"`
// The category of this credit grant. This is for tracking purposes and will not be displayed to the customer.
// The category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
Category BillingCreditGrantCategory `json:"category"`
// Time at which the object was created. Measured in seconds since the Unix epoch.
Created int64 `json:"created"`
// ID of the customer to whom the billing credits are granted.
// ID of the customer receiving the billing credits.
Customer *Customer `json:"customer"`
// The time when the billing credits become effective i.e when they are eligible to be used.
// The time when the billing credits become effectivewhen they're eligible for use.
EffectiveAt int64 `json:"effective_at"`
// The time when the billing credits will expire. If not present, the billing credits will never expire.
// The time when the billing credits expire. If not present, the billing credits don't expire.
ExpiresAt int64 `json:"expires_at"`
// Unique identifier for the object.
ID string `json:"id"`
Expand Down
Loading
Loading