Skip to content

Commit

Permalink
Update generated code (#1951)
Browse files Browse the repository at this point in the history
* Update generated code for v1341

* Update generated code for v1347

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] authored Nov 20, 2024
1 parent e9c9289 commit 148f6ab
Show file tree
Hide file tree
Showing 38 changed files with 369 additions and 111 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1319
v1347
53 changes: 41 additions & 12 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,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 @@ -1442,8 +1471,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 @@ -1484,7 +1513,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: 1 addition & 1 deletion api_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
package stripe

const (
apiVersion string = "2024-10-28.acacia"
apiVersion string = "2024-11-20.acacia"
)
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
2 changes: 1 addition & 1 deletion billing_meterevent.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type BillingMeterEventParams struct {
EventName *string `form:"event_name"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period.
// A unique identifier for the event. If not provided, one will be generated. We strongly advise using UUID-like identifiers. We will enforce uniqueness within a rolling period of at least 24 hours. The enforcement of uniqueness primarily addresses issues arising from accidental retries or other problems occurring within extremely brief time intervals. This approach helps prevent duplicate entries and ensures data integrity in high-frequency operations.
Identifier *string `form:"identifier"`
// The payload of the event. This must contain the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage#payload-key-overrides).
Payload map[string]string `form:"payload"`
Expand Down
Loading

0 comments on commit 148f6ab

Please sign in to comment.