Skip to content

Commit

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

* Update generated code for v426

* Update generated code for v426

* Update generated code for v431

* Update generated code for v433

* Update generated code for v434

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] authored Jul 28, 2023
1 parent 8c08b96 commit 25492a8
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 16 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v425
v434
22 changes: 20 additions & 2 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,20 @@ type AccountParams struct {
Type *string `form:"type"`
}

// An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India.
type AccountBusinessProfileMonthlyEstimatedRevenueParams struct {
// A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
Amount *int64 `form:"amount"`
// 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"`
}

// Business information about the account.
type AccountBusinessProfileParams struct {
// [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.
MCC *string `form:"mcc"`
// An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India.
MonthlyEstimatedRevenue *AccountBusinessProfileMonthlyEstimatedRevenueParams `form:"monthly_estimated_revenue"`
// The customer-facing business name.
Name *string `form:"name"`
// Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes.
Expand Down Expand Up @@ -830,10 +840,18 @@ func (p *AccountExternalAccountParams) AppendTo(body *form.Values, keyParts []st
}
}

type AccountBusinessProfileMonthlyEstimatedRevenue struct {
// A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
Amount int64 `json:"amount"`
// 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"`
}

// Business information about the account.
type AccountBusinessProfile struct {
// [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.
MCC string `json:"mcc"`
MCC string `json:"mcc"`
MonthlyEstimatedRevenue *AccountBusinessProfileMonthlyEstimatedRevenue `json:"monthly_estimated_revenue"`
// The customer-facing business name.
Name string `json:"name"`
// Internal-only description of the product sold or service provided by the business. It's used by Stripe for risk and underwriting purposes.
Expand Down Expand Up @@ -1251,7 +1269,7 @@ type Account struct {
// This is an object representing a person associated with a Stripe account.
//
// A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account.
// See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform pre-filling and account onboarding steps.
// See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps.
//
// Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information)
Individual *Person `json:"individual"`
Expand Down
4 changes: 2 additions & 2 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,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.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.FinancialConnectionsSessions = &financialconnectionssession.Client{B: backends.API, Key: key}
a.IdentityVerificationReports = &identityverificationreport.Client{B: backends.API, Key: key}
Expand All @@ -391,7 +391,7 @@ func (a *API) Init(key string, backends *stripe.Backends) {
a.Prices = &price.Client{B: backends.API, Key: key}
a.Products = &product.Client{B: backends.API, Key: key}
a.PromotionCodes = &promotioncode.Client{B: backends.API, Key: key}
a.Quotes = &quote.Client{B: backends.API, PDFBackend: backends.Uploads, Key: key}
a.Quotes = &quote.Client{B: backends.API, BUploads: backends.Uploads, Key: key}
a.RadarEarlyFraudWarnings = &radarearlyfraudwarning.Client{B: backends.API, Key: key}
a.RadarValueListItems = &radarvaluelistitem.Client{B: backends.API, Key: key}
a.RadarValueLists = &radarvaluelist.Client{B: backends.API, Key: key}
Expand Down
7 changes: 7 additions & 0 deletions example/generated_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3251,3 +3251,10 @@ func TestTaxCalculationCreate(t *testing.T) {
assert.NotNil(t, result)
assert.Nil(t, err)
}

func TestQuotePDF(t *testing.T) {
params := &stripe.QuotePDFParams{}
result, err := quote.PDF("qt_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
assert.Nil(t, err)
}
11 changes: 8 additions & 3 deletions file/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ import (

// Client is used to invoke /files APIs.
type Client struct {
B stripe.Backend
Key string
B stripe.Backend
BUploads stripe.Backend
Key string
}

// New creates a new file.
Expand Down Expand Up @@ -98,5 +99,9 @@ func (i *Iter) FileList() *stripe.FileList {
}

func getC() Client {
return Client{stripe.GetBackend(stripe.UploadsBackend), stripe.Key}
return Client{
stripe.GetBackend(stripe.UploadsBackend),
stripe.GetBackend(stripe.UploadsBackend),
stripe.Key,
}
}
8 changes: 8 additions & 0 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,12 @@ type InvoiceStatusTransitions struct {
VoidedAt int64 `json:"voided_at"`
}

// 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 29, 2023.*
Metadata map[string]string `json:"metadata"`
}

// Indicates which line items triggered a threshold invoice.
type InvoiceThresholdReasonItemReason struct {
// The IDs of the line items that triggered the threshold invoice.
Expand Down Expand Up @@ -1326,6 +1332,8 @@ type Invoice struct {
StatusTransitions *InvoiceStatusTransitions `json:"status_transitions"`
// The subscription that this invoice was prepared for, if any.
Subscription *Subscription `json:"subscription"`
// Details about the subscription that created this invoice.
SubscriptionDetails *InvoiceSubscriptionDetails `json:"subscription_details"`
// Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
SubscriptionProrationDate int64 `json:"subscription_proration_date"`
// Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
Expand Down
4 changes: 2 additions & 2 deletions paymentintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,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.
//
Expand Down Expand Up @@ -2453,7 +2453,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.
//
Expand Down
2 changes: 1 addition & 1 deletion paymentmethod.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
2 changes: 1 addition & 1 deletion person.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ type PersonVerification struct {
// This is an object representing a person associated with a Stripe account.
//
// A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account.
// See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform pre-filling and account onboarding steps.
// See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps.
//
// Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information)
type Person struct {
Expand Down
14 changes: 12 additions & 2 deletions quote/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
type Client struct {
B stripe.Backend
PDFBackend stripe.Backend
BUploads stripe.Backend
Key string
}

Expand Down Expand Up @@ -107,7 +108,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.PDFBackend.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
}

Expand Down Expand Up @@ -220,5 +225,10 @@ func (i *LineItemIter) LineItemList() *stripe.LineItemList {
}

func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.GetBackend(stripe.UploadsBackend), stripe.Key}
return Client{
stripe.GetBackend(stripe.APIBackend),
stripe.GetBackend(stripe.UploadsBackend),
stripe.GetBackend(stripe.UploadsBackend),
stripe.Key,
}
}
4 changes: 2 additions & 2 deletions setupintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,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"`
}

Expand Down Expand Up @@ -1151,7 +1151,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 {
Expand Down

0 comments on commit 25492a8

Please sign in to comment.