From 800fdf723236c017d7c113ed32576764c8d57127 Mon Sep 17 00:00:00 2001 From: Jesse Rosalia Date: Wed, 18 Mar 2026 21:22:39 -0700 Subject: [PATCH] Regenerate with decimal_string enabled for v2 APIs V2 API fields with `format: decimal` now generate as `float64` with proper struct tags (`json:",string"` and `form:",high_precision"`) instead of `*string`. Driven by sdk-codegen#3369. Co-Authored-By: Claude Opus 4.6 Committed-By-Agent: claude --- error.go | 28 ++++++++++++ example/generated_examples_test.go | 24 ++++++++++ invoiceitem.go | 2 +- invoicelineitem.go | 2 +- paymentintent.go | 17 ------- stripe.go | 11 +++++ v2core_account.go | 22 ++-------- v2core_account_params.go | 66 ++++------------------------ v2core_accountperson.go | 2 +- v2core_accounttoken_params.go | 44 +++---------------- v2core_eventdestination.go | 17 +++---- v2core_eventdestination_params.go | 12 ++++- v2coreaccounts_person_params.go | 6 +-- v2coreaccounts_persontoken_params.go | 4 +- 14 files changed, 105 insertions(+), 152 deletions(-) diff --git a/error.go b/error.go index c9eb29229e..daab6d68fd 100644 --- a/error.go +++ b/error.go @@ -20,6 +20,7 @@ const ( ErrorTypeInvalidRequest ErrorType = "invalid_request_error" // V2 error types + ErrorTypeRateLimit ErrorType = "rate_limit" ErrorTypeTemporarySessionExpired ErrorType = "temporary_session_expired" ) @@ -421,6 +422,33 @@ func (e *IdempotencyError) Error() string { // errorStructs: The beginning of the section generated from our OpenAPI spec +// RateLimitError is the Go struct corresponding to the error type "rate_limit". +// Account cannot exceed a configured concurrency rate limit on updates. +type RateLimitError struct { + APIResource + Code string `json:"code"` + DocURL *string `json:"doc_url,omitempty"` + Message string `json:"message"` + Type ErrorType `json:"type"` + UserMessage *string `json:"user_message,omitempty"` +} + +// Error serializes the error object to JSON and returns it as a string. +func (e *RateLimitError) Error() string { + ret, _ := json.Marshal(e) + return string(ret) +} + +// redact implements the redacter interface. +func (e *RateLimitError) redact() error { + return e +} + +// canRetry implements the retrier interface. +func (e *RateLimitError) canRetry() bool { + return false +} + // TemporarySessionExpiredError is the Go struct corresponding to the error type "temporary_session_expired". // The temporary session token has expired. type TemporarySessionExpiredError struct { diff --git a/example/generated_examples_test.go b/example/generated_examples_test.go index b085967227..817ab79396 100644 --- a/example/generated_examples_test.go +++ b/example/generated_examples_test.go @@ -13958,6 +13958,30 @@ func TestV2CoreEventDestinationPost5Client(t *testing.T) { assert.Nil(t, err) } +func TestRateLimitErrorService(t *testing.T) { + params := &stripe.V2CoreAccountListParams{} + testServer := MockServer( + t, http.MethodGet, "/v2/core/accounts", params, "{\"error\":{\"type\":\"rate_limit\",\"code\":\"account_rate_limit_exceeded\"}}") + defer testServer.Close() + backends := stripe.NewBackendsWithConfig( + &stripe.BackendConfig{URL: &testServer.URL}) + sc := client.New(TestAPIKey, backends) + result := sc.V2CoreAccounts.All(params) + assert.NotNil(t, result) +} + +func TestRateLimitErrorClient(t *testing.T) { + params := &stripe.V2CoreAccountListParams{} + testServer := MockServer( + t, http.MethodGet, "/v2/core/accounts", params, "{\"error\":{\"type\":\"rate_limit\",\"code\":\"account_rate_limit_exceeded\"}}") + defer testServer.Close() + backends := stripe.NewBackendsWithConfig( + &stripe.BackendConfig{URL: &testServer.URL}) + sc := stripe.NewClient(TestAPIKey, stripe.WithBackends(backends)) + result := sc.V2CoreAccounts.List(context.TODO(), params) + assert.NotNil(t, result) +} + func TestTemporarySessionExpiredErrorService(t *testing.T) { params := &stripe.V2BillingMeterEventStreamParams{ Events: []*stripe.V2BillingMeterEventStreamEventParams{ diff --git a/invoiceitem.go b/invoiceitem.go index 8f02706461..c15207051a 100644 --- a/invoiceitem.go +++ b/invoiceitem.go @@ -355,7 +355,7 @@ type InvoiceItemParent struct { } type InvoiceItemPricingPriceDetails struct { // The ID of the price this item is associated with. - Price string `json:"price"` + Price *Price `json:"price"` // The ID of the product this item is associated with. Product string `json:"product"` } diff --git a/invoicelineitem.go b/invoicelineitem.go index deb6fe4db0..ed1abbe79a 100644 --- a/invoicelineitem.go +++ b/invoicelineitem.go @@ -459,7 +459,7 @@ type InvoiceLineItemPretaxCreditAmount struct { } type InvoiceLineItemPricingPriceDetails struct { // The ID of the price this item is associated with. - Price string `json:"price"` + Price *Price `json:"price"` // The ID of the product this item is associated with. Product string `json:"product"` } diff --git a/paymentintent.go b/paymentintent.go index bbb60284e0..9e4f2834a1 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -1250,15 +1250,6 @@ const ( PaymentIntentPaymentMethodOptionsUSBankAccountVerificationMethodMicrodeposits PaymentIntentPaymentMethodOptionsUSBankAccountVerificationMethod = "microdeposits" ) -// Preferred transaction settlement speed -type PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeed string - -// List of values that PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeed can take -const ( - PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeedFastest PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeed = "fastest" - PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeedStandard PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeed = "standard" -) - // The client type that the end customer will pay from type PaymentIntentPaymentMethodOptionsWeChatPayClient string @@ -2741,8 +2732,6 @@ type PaymentIntentPaymentMethodOptionsUSBankAccountParams struct { MandateOptions *PaymentIntentPaymentMethodOptionsUSBankAccountMandateOptionsParams `form:"mandate_options"` // Additional fields for network related functions Networks *PaymentIntentPaymentMethodOptionsUSBankAccountNetworksParams `form:"networks"` - // Preferred transaction settlement speed - PreferredSettlementSpeed *string `form:"preferred_settlement_speed"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // // If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. @@ -5177,8 +5166,6 @@ type PaymentIntentCreatePaymentMethodOptionsUSBankAccountParams struct { MandateOptions *PaymentIntentCreatePaymentMethodOptionsUSBankAccountMandateOptionsParams `form:"mandate_options"` // Additional fields for network related functions Networks *PaymentIntentCreatePaymentMethodOptionsUSBankAccountNetworksParams `form:"networks"` - // Preferred transaction settlement speed - PreferredSettlementSpeed *string `form:"preferred_settlement_speed"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // // If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. @@ -6854,8 +6841,6 @@ type PaymentIntentUpdatePaymentMethodOptionsUSBankAccountParams struct { MandateOptions *PaymentIntentUpdatePaymentMethodOptionsUSBankAccountMandateOptionsParams `form:"mandate_options"` // Additional fields for network related functions Networks *PaymentIntentUpdatePaymentMethodOptionsUSBankAccountNetworksParams `form:"networks"` - // Preferred transaction settlement speed - PreferredSettlementSpeed *string `form:"preferred_settlement_speed"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // // If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. @@ -8208,8 +8193,6 @@ type PaymentIntentPaymentMethodOptionsUSBankAccountMandateOptions struct { type PaymentIntentPaymentMethodOptionsUSBankAccount struct { FinancialConnections *PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnections `json:"financial_connections"` MandateOptions *PaymentIntentPaymentMethodOptionsUSBankAccountMandateOptions `json:"mandate_options"` - // Preferred transaction settlement speed - PreferredSettlementSpeed PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeed `json:"preferred_settlement_speed"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // // If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. diff --git a/stripe.go b/stripe.go index c3eb8ebd08..6bc8818848 100644 --- a/stripe.go +++ b/stripe.go @@ -990,6 +990,17 @@ func (s *BackendImplementation) responseToErrorV2(res *http.Response, resBody [] // errorTypeSwitch: The beginning of the section generated from our OpenAPI spec switch *raw.Error.Type { + case "rate_limit": + tmp := struct { + Error *RateLimitError `json:"error"` + }{ + Error: &RateLimitError{}, + } + if err := s.unmarshalJSONVerbose(ctx, res.StatusCode, resBody, &tmp); err != nil { + return err + } + tmp.Error.SetLastResponse(newAPIResponse(res, resBody, nil)) + typedError = tmp.Error case "temporary_session_expired": tmp := struct { Error *TemporarySessionExpiredError `json:"error"` diff --git a/v2core_account.go b/v2core_account.go index b8c7996171..bc0cd98a46 100644 --- a/v2core_account.go +++ b/v2core_account.go @@ -3999,18 +3999,10 @@ type V2CoreAccountIdentityBusinessDetailsAddress struct { Town string `json:"town,omitempty"` } -// Annual revenue amount in minor currency units (for example, '123' for 1.23 USD). -type V2CoreAccountIdentityBusinessDetailsAnnualRevenueAmount struct { - // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - Currency Currency `json:"currency,omitempty"` - // A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - Value int64 `json:"value,omitempty"` -} - // The business gross annual revenue for its preceding fiscal year. type V2CoreAccountIdentityBusinessDetailsAnnualRevenue struct { // Annual revenue amount in minor currency units (for example, '123' for 1.23 USD). - Amount *V2CoreAccountIdentityBusinessDetailsAnnualRevenueAmount `json:"amount,omitempty"` + Amount Amount `json:"amount,omitempty"` // The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. FiscalYearEnd string `json:"fiscal_year_end,omitempty"` } @@ -4135,18 +4127,10 @@ type V2CoreAccountIdentityBusinessDetailsIDNumber struct { Type V2CoreAccountIdentityBusinessDetailsIDNumberType `json:"type"` } -// Estimated monthly revenue amount in minor currency units (for example, '123' for 1.23 USD). -type V2CoreAccountIdentityBusinessDetailsMonthlyEstimatedRevenueAmount struct { - // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - Currency Currency `json:"currency,omitempty"` - // A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - Value int64 `json:"value,omitempty"` -} - // An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. type V2CoreAccountIdentityBusinessDetailsMonthlyEstimatedRevenue struct { // Estimated monthly revenue amount in minor currency units (for example, '123' for 1.23 USD). - Amount *V2CoreAccountIdentityBusinessDetailsMonthlyEstimatedRevenueAmount `json:"amount,omitempty"` + Amount Amount `json:"amount,omitempty"` } // When the business was incorporated or registered. @@ -4416,7 +4400,7 @@ type V2CoreAccountIdentityIndividualRelationship struct { // Whether the individual is an owner of the Account's identity. Owner bool `json:"owner,omitempty"` // The percentage of the Account's identity that the individual owns. - PercentOwnership string `json:"percent_ownership,omitempty"` + PercentOwnership float64 `json:"percent_ownership,string,omitempty"` // Whether the individual is authorized as the primary representative of the Account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. Representative bool `json:"representative,omitempty"` // The individual's title (e.g., CEO, Support Engineer). diff --git a/v2core_account_params.go b/v2core_account_params.go index 6c15d6db45..75d2f8b588 100644 --- a/v2core_account_params.go +++ b/v2core_account_params.go @@ -763,18 +763,10 @@ type V2CoreAccountIdentityBusinessDetailsAddressParams struct { Town *string `form:"town" json:"town,omitempty"` } -// A non-negative integer representing the amount in the smallest currency unit. -type V2CoreAccountIdentityBusinessDetailsAnnualRevenueAmountParams struct { - // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - Currency *string `form:"currency" json:"currency,omitempty"` - // A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - Value *int64 `form:"value" json:"value,omitempty"` -} - // The business gross annual revenue for its preceding fiscal year. type V2CoreAccountIdentityBusinessDetailsAnnualRevenueParams struct { // A non-negative integer representing the amount in the smallest currency unit. - Amount *V2CoreAccountIdentityBusinessDetailsAnnualRevenueAmountParams `form:"amount" json:"amount,omitempty"` + Amount *Amount `form:"amount" json:"amount,omitempty"` // The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. FiscalYearEnd *string `form:"fiscal_year_end" json:"fiscal_year_end,omitempty"` } @@ -901,18 +893,10 @@ type V2CoreAccountIdentityBusinessDetailsIDNumberParams struct { Value *string `form:"value" json:"value"` } -// A non-negative integer representing the amount in the smallest currency unit. -type V2CoreAccountIdentityBusinessDetailsMonthlyEstimatedRevenueAmountParams struct { - // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - Currency *string `form:"currency" json:"currency,omitempty"` - // A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - Value *int64 `form:"value" json:"value,omitempty"` -} - // An estimate of the monthly revenue of the business. type V2CoreAccountIdentityBusinessDetailsMonthlyEstimatedRevenueParams struct { // A non-negative integer representing the amount in the smallest currency unit. - Amount *V2CoreAccountIdentityBusinessDetailsMonthlyEstimatedRevenueAmountParams `form:"amount" json:"amount,omitempty"` + Amount *Amount `form:"amount" json:"amount,omitempty"` } // When the business was incorporated or registered. @@ -1164,7 +1148,7 @@ type V2CoreAccountIdentityIndividualRelationshipParams struct { // Whether the person is an owner of the account's identity. Owner *bool `form:"owner" json:"owner,omitempty"` // The percent owned by the person of the account's legal entity. - PercentOwnership *string `form:"percent_ownership" json:"percent_ownership,omitempty"` + PercentOwnership *float64 `form:"percent_ownership,high_precision" json:"percent_ownership,string,omitempty"` // The person's title (e.g., CEO, Support Engineer). Title *string `form:"title" json:"title,omitempty"` } @@ -2089,18 +2073,10 @@ type V2CoreAccountCreateIdentityBusinessDetailsAddressParams struct { Town *string `form:"town" json:"town,omitempty"` } -// A non-negative integer representing the amount in the smallest currency unit. -type V2CoreAccountCreateIdentityBusinessDetailsAnnualRevenueAmountParams struct { - // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - Currency *string `form:"currency" json:"currency,omitempty"` - // A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - Value *int64 `form:"value" json:"value,omitempty"` -} - // The business gross annual revenue for its preceding fiscal year. type V2CoreAccountCreateIdentityBusinessDetailsAnnualRevenueParams struct { // A non-negative integer representing the amount in the smallest currency unit. - Amount *V2CoreAccountCreateIdentityBusinessDetailsAnnualRevenueAmountParams `form:"amount" json:"amount,omitempty"` + Amount *Amount `form:"amount" json:"amount,omitempty"` // The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. FiscalYearEnd *string `form:"fiscal_year_end" json:"fiscal_year_end,omitempty"` } @@ -2227,18 +2203,10 @@ type V2CoreAccountCreateIdentityBusinessDetailsIDNumberParams struct { Value *string `form:"value" json:"value"` } -// A non-negative integer representing the amount in the smallest currency unit. -type V2CoreAccountCreateIdentityBusinessDetailsMonthlyEstimatedRevenueAmountParams struct { - // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - Currency *string `form:"currency" json:"currency,omitempty"` - // A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - Value *int64 `form:"value" json:"value,omitempty"` -} - // An estimate of the monthly revenue of the business. type V2CoreAccountCreateIdentityBusinessDetailsMonthlyEstimatedRevenueParams struct { // A non-negative integer representing the amount in the smallest currency unit. - Amount *V2CoreAccountCreateIdentityBusinessDetailsMonthlyEstimatedRevenueAmountParams `form:"amount" json:"amount,omitempty"` + Amount *Amount `form:"amount" json:"amount,omitempty"` } // When the business was incorporated or registered. @@ -2490,7 +2458,7 @@ type V2CoreAccountCreateIdentityIndividualRelationshipParams struct { // Whether the person is an owner of the account's identity. Owner *bool `form:"owner" json:"owner,omitempty"` // The percent owned by the person of the account's legal entity. - PercentOwnership *string `form:"percent_ownership" json:"percent_ownership,omitempty"` + PercentOwnership *float64 `form:"percent_ownership,high_precision" json:"percent_ownership,string,omitempty"` // The person's title (e.g., CEO, Support Engineer). Title *string `form:"title" json:"title,omitempty"` } @@ -3429,18 +3397,10 @@ type V2CoreAccountUpdateIdentityBusinessDetailsAddressParams struct { Town *string `form:"town" json:"town,omitempty"` } -// A non-negative integer representing the amount in the smallest currency unit. -type V2CoreAccountUpdateIdentityBusinessDetailsAnnualRevenueAmountParams struct { - // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - Currency *string `form:"currency" json:"currency,omitempty"` - // A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - Value *int64 `form:"value" json:"value,omitempty"` -} - // The business gross annual revenue for its preceding fiscal year. type V2CoreAccountUpdateIdentityBusinessDetailsAnnualRevenueParams struct { // A non-negative integer representing the amount in the smallest currency unit. - Amount *V2CoreAccountUpdateIdentityBusinessDetailsAnnualRevenueAmountParams `form:"amount" json:"amount,omitempty"` + Amount *Amount `form:"amount" json:"amount,omitempty"` // The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. FiscalYearEnd *string `form:"fiscal_year_end" json:"fiscal_year_end,omitempty"` } @@ -3567,18 +3527,10 @@ type V2CoreAccountUpdateIdentityBusinessDetailsIDNumberParams struct { Value *string `form:"value" json:"value"` } -// A non-negative integer representing the amount in the smallest currency unit. -type V2CoreAccountUpdateIdentityBusinessDetailsMonthlyEstimatedRevenueAmountParams struct { - // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - Currency *string `form:"currency" json:"currency,omitempty"` - // A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - Value *int64 `form:"value" json:"value,omitempty"` -} - // An estimate of the monthly revenue of the business. type V2CoreAccountUpdateIdentityBusinessDetailsMonthlyEstimatedRevenueParams struct { // A non-negative integer representing the amount in the smallest currency unit. - Amount *V2CoreAccountUpdateIdentityBusinessDetailsMonthlyEstimatedRevenueAmountParams `form:"amount" json:"amount,omitempty"` + Amount *Amount `form:"amount" json:"amount,omitempty"` } // When the business was incorporated or registered. @@ -3830,7 +3782,7 @@ type V2CoreAccountUpdateIdentityIndividualRelationshipParams struct { // Whether the person is an owner of the account's identity. Owner *bool `form:"owner" json:"owner,omitempty"` // The percent owned by the person of the account's legal entity. - PercentOwnership *string `form:"percent_ownership" json:"percent_ownership,omitempty"` + PercentOwnership *float64 `form:"percent_ownership,high_precision" json:"percent_ownership,string,omitempty"` // The person's title (e.g., CEO, Support Engineer). Title *string `form:"title" json:"title,omitempty"` } diff --git a/v2core_accountperson.go b/v2core_accountperson.go index a7af6d71f0..0e11154442 100644 --- a/v2core_accountperson.go +++ b/v2core_accountperson.go @@ -332,7 +332,7 @@ type V2CoreAccountPersonRelationship struct { // Whether the individual is an owner of the Account's identity. Owner bool `json:"owner,omitempty"` // The percentage of the Account's identity that the individual owns. - PercentOwnership string `json:"percent_ownership,omitempty"` + PercentOwnership float64 `json:"percent_ownership,string,omitempty"` // Whether the individual is authorized as the primary representative of the Account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. Representative bool `json:"representative,omitempty"` // The individual's title (e.g., CEO, Support Engineer). diff --git a/v2core_accounttoken_params.go b/v2core_accounttoken_params.go index 26899a4b34..4d97ed27ab 100644 --- a/v2core_accounttoken_params.go +++ b/v2core_accounttoken_params.go @@ -80,18 +80,10 @@ type V2CoreAccountTokenIdentityBusinessDetailsAddressParams struct { Town *string `form:"town" json:"town,omitempty"` } -// A non-negative integer representing the amount in the smallest currency unit. -type V2CoreAccountTokenIdentityBusinessDetailsAnnualRevenueAmountParams struct { - // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - Currency *string `form:"currency" json:"currency,omitempty"` - // A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - Value *int64 `form:"value" json:"value,omitempty"` -} - // The business gross annual revenue for its preceding fiscal year. type V2CoreAccountTokenIdentityBusinessDetailsAnnualRevenueParams struct { // A non-negative integer representing the amount in the smallest currency unit. - Amount *V2CoreAccountTokenIdentityBusinessDetailsAnnualRevenueAmountParams `form:"amount" json:"amount,omitempty"` + Amount *Amount `form:"amount" json:"amount,omitempty"` // The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. FiscalYearEnd *string `form:"fiscal_year_end" json:"fiscal_year_end,omitempty"` } @@ -218,18 +210,10 @@ type V2CoreAccountTokenIdentityBusinessDetailsIDNumberParams struct { Value *string `form:"value" json:"value"` } -// A non-negative integer representing the amount in the smallest currency unit. -type V2CoreAccountTokenIdentityBusinessDetailsMonthlyEstimatedRevenueAmountParams struct { - // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - Currency *string `form:"currency" json:"currency,omitempty"` - // A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - Value *int64 `form:"value" json:"value,omitempty"` -} - // An estimate of the monthly revenue of the business. type V2CoreAccountTokenIdentityBusinessDetailsMonthlyEstimatedRevenueParams struct { // A non-negative integer representing the amount in the smallest currency unit. - Amount *V2CoreAccountTokenIdentityBusinessDetailsMonthlyEstimatedRevenueAmountParams `form:"amount" json:"amount,omitempty"` + Amount *Amount `form:"amount" json:"amount,omitempty"` } // When the business was incorporated or registered. @@ -481,7 +465,7 @@ type V2CoreAccountTokenIdentityIndividualRelationshipParams struct { // Whether the person is an owner of the account's identity. Owner *bool `form:"owner" json:"owner,omitempty"` // The percent owned by the person of the account's legal entity. - PercentOwnership *string `form:"percent_ownership" json:"percent_ownership,omitempty"` + PercentOwnership *float64 `form:"percent_ownership,high_precision" json:"percent_ownership,string,omitempty"` // The person's title (e.g., CEO, Support Engineer). Title *string `form:"title" json:"title,omitempty"` } @@ -700,18 +684,10 @@ type V2CoreAccountTokenCreateIdentityBusinessDetailsAddressParams struct { Town *string `form:"town" json:"town,omitempty"` } -// A non-negative integer representing the amount in the smallest currency unit. -type V2CoreAccountTokenCreateIdentityBusinessDetailsAnnualRevenueAmountParams struct { - // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - Currency *string `form:"currency" json:"currency,omitempty"` - // A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - Value *int64 `form:"value" json:"value,omitempty"` -} - // The business gross annual revenue for its preceding fiscal year. type V2CoreAccountTokenCreateIdentityBusinessDetailsAnnualRevenueParams struct { // A non-negative integer representing the amount in the smallest currency unit. - Amount *V2CoreAccountTokenCreateIdentityBusinessDetailsAnnualRevenueAmountParams `form:"amount" json:"amount,omitempty"` + Amount *Amount `form:"amount" json:"amount,omitempty"` // The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. FiscalYearEnd *string `form:"fiscal_year_end" json:"fiscal_year_end,omitempty"` } @@ -838,18 +814,10 @@ type V2CoreAccountTokenCreateIdentityBusinessDetailsIDNumberParams struct { Value *string `form:"value" json:"value"` } -// A non-negative integer representing the amount in the smallest currency unit. -type V2CoreAccountTokenCreateIdentityBusinessDetailsMonthlyEstimatedRevenueAmountParams struct { - // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - Currency *string `form:"currency" json:"currency,omitempty"` - // A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - Value *int64 `form:"value" json:"value,omitempty"` -} - // An estimate of the monthly revenue of the business. type V2CoreAccountTokenCreateIdentityBusinessDetailsMonthlyEstimatedRevenueParams struct { // A non-negative integer representing the amount in the smallest currency unit. - Amount *V2CoreAccountTokenCreateIdentityBusinessDetailsMonthlyEstimatedRevenueAmountParams `form:"amount" json:"amount,omitempty"` + Amount *Amount `form:"amount" json:"amount,omitempty"` } // When the business was incorporated or registered. @@ -1101,7 +1069,7 @@ type V2CoreAccountTokenCreateIdentityIndividualRelationshipParams struct { // Whether the person is an owner of the account's identity. Owner *bool `form:"owner" json:"owner,omitempty"` // The percent owned by the person of the account's legal entity. - PercentOwnership *string `form:"percent_ownership" json:"percent_ownership,omitempty"` + PercentOwnership *float64 `form:"percent_ownership,high_precision" json:"percent_ownership,string,omitempty"` // The person's title (e.g., CEO, Support Engineer). Title *string `form:"title" json:"title,omitempty"` } diff --git a/v2core_eventdestination.go b/v2core_eventdestination.go index 5a13fcb2b0..7baacd7eb6 100644 --- a/v2core_eventdestination.go +++ b/v2core_eventdestination.go @@ -17,15 +17,6 @@ const ( V2CoreEventDestinationEventPayloadThin V2CoreEventDestinationEventPayload = "thin" ) -// Where events should be routed from. -type V2CoreEventDestinationEventsFrom string - -// List of values that V2CoreEventDestinationEventsFrom can take -const ( - V2CoreEventDestinationEventsFromOtherAccounts V2CoreEventDestinationEventsFrom = "other_accounts" - V2CoreEventDestinationEventsFromSelf V2CoreEventDestinationEventsFrom = "self" -) - // Status. It can be set to either enabled or disabled. type V2CoreEventDestinationStatus string @@ -107,8 +98,12 @@ type V2CoreEventDestination struct { EnabledEvents []string `json:"enabled_events"` // Payload type of events being subscribed to. EventPayload V2CoreEventDestinationEventPayload `json:"event_payload"` - // Where events should be routed from. - EventsFrom []V2CoreEventDestinationEventsFrom `json:"events_from,omitempty"` + // Specifies which accounts' events route to this destination. + // `@self`: Receive events from the account that owns the event destination. + // `@accounts`: Receive events emitted from other accounts you manage which includes your v1 and v2 accounts. + // `@organization_members`: Receive events from accounts directly linked to the organization. + // `@organization_members/@accounts`: Receive events from all accounts connected to any platform accounts in the organization. + EventsFrom []string `json:"events_from,omitempty"` // Unique identifier for the object. ID string `json:"id"` // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. diff --git a/v2core_eventdestination_params.go b/v2core_eventdestination_params.go index 083e9241b4..037734dc3d 100644 --- a/v2core_eventdestination_params.go +++ b/v2core_eventdestination_params.go @@ -40,7 +40,11 @@ type V2CoreEventDestinationParams struct { EnabledEvents []*string `form:"enabled_events" json:"enabled_events,omitempty"` // Payload type of events being subscribed to. EventPayload *string `form:"event_payload" json:"event_payload,omitempty"` - // Where events should be routed from. + // Specifies which accounts' events route to this destination. + // `@self`: Receive events from the account that owns the event destination. + // `@accounts`: Receive events emitted from other accounts you manage which includes your v1 and v2 accounts. + // `@organization_members`: Receive events from accounts directly linked to the organization. + // `@organization_members/@accounts`: Receive events from all accounts connected to any platform accounts in the organization. EventsFrom []*string `form:"events_from" json:"events_from,omitempty"` // Additional fields to include in the response. Currently supports `webhook_endpoint.url`. Include []*string `form:"include" json:"include,omitempty"` @@ -105,7 +109,11 @@ type V2CoreEventDestinationCreateParams struct { EnabledEvents []*string `form:"enabled_events" json:"enabled_events"` // Payload type of events being subscribed to. EventPayload *string `form:"event_payload" json:"event_payload"` - // Where events should be routed from. + // Specifies which accounts' events route to this destination. + // `@self`: Receive events from the account that owns the event destination. + // `@accounts`: Receive events emitted from other accounts you manage which includes your v1 and v2 accounts. + // `@organization_members`: Receive events from accounts directly linked to the organization. + // `@organization_members/@accounts`: Receive events from all accounts connected to any platform accounts in the organization. EventsFrom []*string `form:"events_from" json:"events_from,omitempty"` // Additional fields to include in the response. Include []*string `form:"include" json:"include,omitempty"` diff --git a/v2coreaccounts_person_params.go b/v2coreaccounts_person_params.go index 7733fabf66..bd2e04e3d4 100644 --- a/v2coreaccounts_person_params.go +++ b/v2coreaccounts_person_params.go @@ -184,7 +184,7 @@ type V2CoreAccountsPersonRelationshipParams struct { // Indicates whether the person is an owner of the associated legal entity. Owner *bool `form:"owner" json:"owner,omitempty"` // The percentage of ownership the person has in the associated legal entity. - PercentOwnership *string `form:"percent_ownership" json:"percent_ownership,omitempty"` + PercentOwnership *float64 `form:"percent_ownership,high_precision" json:"percent_ownership,string,omitempty"` // Indicates whether the person is a representative of the associated legal entity. Representative *bool `form:"representative" json:"representative,omitempty"` // The title or position the person holds in the associated legal entity. @@ -480,7 +480,7 @@ type V2CoreAccountsPersonCreateRelationshipParams struct { // Indicates whether the person is an owner of the associated legal entity. Owner *bool `form:"owner" json:"owner,omitempty"` // The percentage of ownership the person has in the associated legal entity. - PercentOwnership *string `form:"percent_ownership" json:"percent_ownership,omitempty"` + PercentOwnership *float64 `form:"percent_ownership,high_precision" json:"percent_ownership,string,omitempty"` // Indicates whether the person is a representative of the associated legal entity. Representative *bool `form:"representative" json:"representative,omitempty"` // The title or position the person holds in the associated legal entity. @@ -790,7 +790,7 @@ type V2CoreAccountsPersonUpdateRelationshipParams struct { // Indicates whether the person is an owner of the associated legal entity. Owner *bool `form:"owner" json:"owner,omitempty"` // The percentage of ownership the person has in the associated legal entity. - PercentOwnership *string `form:"percent_ownership" json:"percent_ownership,omitempty"` + PercentOwnership *float64 `form:"percent_ownership,high_precision" json:"percent_ownership,string,omitempty"` // Indicates whether the person is a representative of the associated legal entity. Representative *bool `form:"representative" json:"representative,omitempty"` // The title or position the person holds in the associated legal entity. diff --git a/v2coreaccounts_persontoken_params.go b/v2coreaccounts_persontoken_params.go index 57a5472ef9..4671d3b672 100644 --- a/v2coreaccounts_persontoken_params.go +++ b/v2coreaccounts_persontoken_params.go @@ -169,7 +169,7 @@ type V2CoreAccountsPersonTokenRelationshipParams struct { // Indicates whether the person is an owner of the associated legal entity. Owner *bool `form:"owner" json:"owner,omitempty"` // The percentage of ownership the person has in the associated legal entity. - PercentOwnership *string `form:"percent_ownership" json:"percent_ownership,omitempty"` + PercentOwnership *float64 `form:"percent_ownership,high_precision" json:"percent_ownership,string,omitempty"` // Indicates whether the person is a representative of the associated legal entity. Representative *bool `form:"representative" json:"representative,omitempty"` // The title or position the person holds in the associated legal entity. @@ -459,7 +459,7 @@ type V2CoreAccountsPersonTokenCreateRelationshipParams struct { // Indicates whether the person is an owner of the associated legal entity. Owner *bool `form:"owner" json:"owner,omitempty"` // The percentage of ownership the person has in the associated legal entity. - PercentOwnership *string `form:"percent_ownership" json:"percent_ownership,omitempty"` + PercentOwnership *float64 `form:"percent_ownership,high_precision" json:"percent_ownership,string,omitempty"` // Indicates whether the person is a representative of the associated legal entity. Representative *bool `form:"representative" json:"representative,omitempty"` // The title or position the person holds in the associated legal entity.