From addcc8f8cd63e6a4da3a487856c9e84932ca6d68 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 28 Jul 2023 10:09:51 -0700 Subject: [PATCH] Update generated code for beta (#1694) * Update generated code for v432 * Update generated code for v433 * Update generated code for v434 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- client/api.go | 4 ++-- file/client.go | 8 ++++++-- invoice.go | 2 +- order.go | 4 ++-- paymentintent.go | 4 ++-- paymentmethod.go | 2 +- quote/client.go | 6 +++++- setupintent.go | 4 ++-- tax/form/client.go | 9 +++++---- 10 files changed, 27 insertions(+), 18 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 03b8593a8e..e3059d5b46 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v431 \ No newline at end of file +v434 \ No newline at end of file diff --git a/client/api.go b/client/api.go index 96d63eb721..a2e339e649 100644 --- a/client/api.go +++ b/client/api.go @@ -422,7 +422,7 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.Events = &event.Client{B: backends.API, Key: key} a.FeeRefunds = &feerefund.Client{B: backends.API, Key: key} a.FileLinks = &filelink.Client{B: backends.API, Key: key} - a.Files = &file.Client{B: backends.API, BUploads: backends.Uploads, Key: key} + a.Files = &file.Client{B: backends.Uploads, BUploads: backends.Uploads, Key: key} a.FinancialConnectionsAccounts = &financialconnectionsaccount.Client{B: backends.API, Key: key} a.FinancialConnectionsInferredBalances = &financialconnectionsinferredbalance.Client{B: backends.API, Key: key} a.FinancialConnectionsSessions = &financialconnectionssession.Client{B: backends.API, Key: key} @@ -475,7 +475,7 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.SubscriptionSchedules = &subscriptionschedule.Client{B: backends.API, Key: key} a.TaxCalculations = &taxcalculation.Client{B: backends.API, Key: key} a.TaxCodes = &taxcode.Client{B: backends.API, Key: key} - a.TaxForms = &taxform.Client{B: backends.API, Key: key} + a.TaxForms = &taxform.Client{B: backends.API, BUploads: backends.Uploads, Key: key} a.TaxIDs = &taxid.Client{B: backends.API, Key: key} a.TaxRates = &taxrate.Client{B: backends.API, Key: key} a.TaxRegistrations = &taxregistration.Client{B: backends.API, Key: key} diff --git a/file/client.go b/file/client.go index b3ef32369a..959af39d05 100644 --- a/file/client.go +++ b/file/client.go @@ -41,7 +41,7 @@ func (c Client) New(params *stripe.FileParams) (*stripe.File, error) { } file := &stripe.File{} - err = c.BUploads.CallMultipart(http.MethodPost, "/v1/files", c.Key, boundary, bodyBuffer, ¶ms.Params, file) + err = c.B.CallMultipart(http.MethodPost, "/v1/files", c.Key, boundary, bodyBuffer, ¶ms.Params, file) return file, err } @@ -99,5 +99,9 @@ func (i *Iter) FileList() *stripe.FileList { } func getC() Client { - return Client{stripe.GetBackend(stripe.APIBackend), stripe.GetBackend(stripe.UploadsBackend), stripe.Key} + return Client{ + stripe.GetBackend(stripe.UploadsBackend), + stripe.GetBackend(stripe.UploadsBackend), + stripe.Key, + } } diff --git a/invoice.go b/invoice.go index c10b63a757..a0492ef1d5 100644 --- a/invoice.go +++ b/invoice.go @@ -1283,7 +1283,7 @@ type InvoiceSubscriptionDetailsPauseCollection struct { // Details about the subscription that created this invoice. type InvoiceSubscriptionDetails struct { - // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will reflect the metadata of the subscription at the time of invoice creation. *Note: This attribute is populated only for invoices created on or after June 28, 2023.* + // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will reflect the metadata of the subscription at the time of invoice creation. *Note: This attribute is populated only for invoices created on or after June 29, 2023.* Metadata map[string]string `json:"metadata"` // If specified, payment collection for this subscription will be paused. PauseCollection *InvoiceSubscriptionDetailsPauseCollection `json:"pause_collection"` diff --git a/order.go b/order.go index 75430bd4fa..d0c2a62597 100644 --- a/order.go +++ b/order.go @@ -863,7 +863,7 @@ type OrderPaymentSettingsPaymentMethodOptionsLinkParams struct { // // If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. CaptureMethod *string `form:"capture_method"` - // Token used for persistent Link logins. + // [Deprecated] This is a legacy parameter that no longer has any function. PersistentToken *string `form:"persistent_token"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // @@ -1346,7 +1346,7 @@ type OrderPaymentSettingsPaymentMethodOptionsKlarna struct { type OrderPaymentSettingsPaymentMethodOptionsLink struct { // Controls when the funds will be captured from the customer's account. CaptureMethod OrderPaymentSettingsPaymentMethodOptionsLinkCaptureMethod `json:"capture_method"` - // Token used for persistent Link logins. + // [Deprecated] This is a legacy parameter that no longer has any function. PersistentToken string `json:"persistent_token"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // diff --git a/paymentintent.go b/paymentintent.go index b4e9e14097..5e473e4f86 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -1514,7 +1514,7 @@ type PaymentIntentPaymentMethodOptionsLinkParams struct { // // If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. CaptureMethod *string `form:"capture_method"` - // Token used for persistent Link logins. + // [Deprecated] This is a legacy parameter that no longer has any function. PersistentToken *string `form:"persistent_token"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // @@ -2937,7 +2937,7 @@ type PaymentIntentPaymentMethodOptionsKonbini struct { type PaymentIntentPaymentMethodOptionsLink struct { // Controls when the funds will be captured from the customer's account. CaptureMethod PaymentIntentPaymentMethodOptionsLinkCaptureMethod `json:"capture_method"` - // Token used for persistent Link logins. + // [Deprecated] This is a legacy parameter that no longer has any function. PersistentToken string `json:"persistent_token"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // diff --git a/paymentmethod.go b/paymentmethod.go index f564bce9a5..cf21fb4fbd 100644 --- a/paymentmethod.go +++ b/paymentmethod.go @@ -807,7 +807,7 @@ type PaymentMethodLink struct { Country string `json:"country"` // Account owner's email address. Email string `json:"email"` - // Token used for persistent Link logins. + // [Deprecated] This is a legacy parameter that no longer has any function. PersistentToken string `json:"persistent_token"` } type PaymentMethodOXXO struct{} diff --git a/quote/client.go b/quote/client.go index 4d6c64a211..4a10f035ed 100644 --- a/quote/client.go +++ b/quote/client.go @@ -134,7 +134,11 @@ func PDF(id string, params *stripe.QuotePDFParams) (*stripe.APIStream, error) { func (c Client) PDF(id string, params *stripe.QuotePDFParams) (*stripe.APIStream, error) { path := stripe.FormatURLPath("/v1/quotes/%s/pdf", id) stream := &stripe.APIStream{} - err := c.BUploads.CallStreaming(http.MethodGet, path, c.Key, params, stream) + backend := c.PDFBackend + if backend == nil { + backend = c.BUploads + } + err := backend.CallStreaming(http.MethodGet, path, c.Key, params, stream) return stream, err } diff --git a/setupintent.go b/setupintent.go index e7922f0623..35869c16e9 100644 --- a/setupintent.go +++ b/setupintent.go @@ -611,7 +611,7 @@ type SetupIntentPaymentMethodOptionsCardParams struct { // If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. type SetupIntentPaymentMethodOptionsLinkParams struct { - // Token used for persistent Link logins. + // [Deprecated] This is a legacy parameter that no longer has any function. PersistentToken *string `form:"persistent_token"` } @@ -1192,7 +1192,7 @@ type SetupIntentPaymentMethodOptionsCard struct { RequestThreeDSecure SetupIntentPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"` } type SetupIntentPaymentMethodOptionsLink struct { - // Token used for persistent Link logins. + // [Deprecated] This is a legacy parameter that no longer has any function. PersistentToken string `json:"persistent_token"` } type SetupIntentPaymentMethodOptionsPaypal struct { diff --git a/tax/form/client.go b/tax/form/client.go index c5fa26201f..1f1cd856b5 100644 --- a/tax/form/client.go +++ b/tax/form/client.go @@ -16,8 +16,9 @@ import ( // Client is used to invoke /tax/forms APIs. type Client struct { - B stripe.Backend - Key string + B stripe.Backend + BUploads stripe.Backend + Key string } // Get returns the details of a tax form. @@ -42,7 +43,7 @@ func PDF(id string, params *stripe.TaxFormPDFParams) (*stripe.APIStream, error) func (c Client) PDF(id string, params *stripe.TaxFormPDFParams) (*stripe.APIStream, error) { path := stripe.FormatURLPath("/v1/tax/forms/%s/pdf", id) stream := &stripe.APIStream{} - err := c.B.CallStreaming(http.MethodGet, path, c.Key, params, stream) + err := c.BUploads.CallStreaming(http.MethodGet, path, c.Key, params, stream) return stream, err } @@ -86,5 +87,5 @@ func (i *Iter) TaxFormList() *stripe.TaxFormList { } func getC() Client { - return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} + return Client{stripe.GetBackend(stripe.APIBackend), stripe.GetBackend(stripe.UploadsBackend), stripe.Key} }