Skip to content

Commit

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

* Update generated code for v486

* Update generated code for v487

* Update generated code for v488

* Update generated code for v489

* Update generated code for v490

* Update generated code for v491

* Update generated code for v492

* Update generated code for v493

* Update generated code for v495

* Update generated code for v497

* Update generated code for v499

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] authored Aug 31, 2023
1 parent d43de36 commit 1c611e8
Show file tree
Hide file tree
Showing 13 changed files with 360 additions and 16 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v482
v499
69 changes: 69 additions & 0 deletions accountsession.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//
//
// File generated from our OpenAPI spec
//
//

package stripe

// Configuration for the account onboarding embedded component.
type AccountSessionComponentsAccountOnboardingParams struct {
// Whether the embedded component is enabled.
Enabled *bool `form:"enabled"`
}

// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not).
type AccountSessionComponentsParams struct {
// Configuration for the account onboarding embedded component.
AccountOnboarding *AccountSessionComponentsAccountOnboardingParams `form:"account_onboarding"`
}

// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.
type AccountSessionParams struct {
Params `form:"*"`
// The identifier of the account to create an Account Session for.
Account *string `form:"account"`
// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not).
Components *AccountSessionComponentsParams `form:"components"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}

// AddExpand appends a new field to expand.
func (p *AccountSessionParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
}

type AccountSessionComponentsAccountOnboarding struct {
// Whether the embedded component is enabled.
Enabled bool `json:"enabled"`
}
type AccountSessionComponents struct {
AccountOnboarding *AccountSessionComponentsAccountOnboarding `json:"account_onboarding"`
}

// An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components.
//
// We recommend that you create an AccountSession each time you need to display an embedded component
// to your user. Do not save AccountSessions to your database as they expire relatively
// quickly, and cannot be used more than once.
//
// Related guide: [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components)
type AccountSession struct {
APIResource
// The ID of the account the AccountSession was created for
Account string `json:"account"`
// The client secret of this AccountSession. Used on the client to set up secure access to the given `account`.
//
// The client secret can be used to provide access to `account` from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret.
//
// Refer to our docs to [setup Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled.
ClientSecret string `json:"client_secret"`
Components *AccountSessionComponents `json:"components"`
// The timestamp at which this AccountSession will expire.
ExpiresAt int64 `json:"expires_at"`
// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
Livemode bool `json:"livemode"`
// String representing the object's type. Objects of the same type share the same value.
Object string `json:"object"`
}
42 changes: 42 additions & 0 deletions accountsession/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
//
// File generated from our OpenAPI spec
//
//

// Package accountsession provides the /account_sessions APIs
package accountsession

import (
"net/http"

stripe "github.com/stripe/stripe-go/v75"
)

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

// New creates a new account session.
func New(params *stripe.AccountSessionParams) (*stripe.AccountSession, error) {
return getC().New(params)
}

// New creates a new account session.
func (c Client) New(params *stripe.AccountSessionParams) (*stripe.AccountSession, error) {
accountsession := &stripe.AccountSession{}
err := c.B.Call(
http.MethodPost,
"/v1/account_sessions",
c.Key,
params,
accountsession,
)
return accountsession, err
}

func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}
12 changes: 9 additions & 3 deletions balancetransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const (
BalanceTransactionStatusPending BalanceTransactionStatus = "pending"
)

// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead.
// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead.
type BalanceTransactionType string

// List of values that BalanceTransactionType can take
Expand All @@ -90,6 +90,12 @@ const (
BalanceTransactionTypeIssuingAuthorizationRelease BalanceTransactionType = "issuing_authorization_release"
BalanceTransactionTypeIssuingDispute BalanceTransactionType = "issuing_dispute"
BalanceTransactionTypeIssuingTransaction BalanceTransactionType = "issuing_transaction"
BalanceTransactionTypeObligationInbound BalanceTransactionType = "obligation_inbound"
BalanceTransactionTypeObligationOutbound BalanceTransactionType = "obligation_outbound"
BalanceTransactionTypeObligationPayout BalanceTransactionType = "obligation_payout"
BalanceTransactionTypeObligationPayoutFailure BalanceTransactionType = "obligation_payout_failure"
BalanceTransactionTypeObligationReversalInbound BalanceTransactionType = "obligation_reversal_inbound"
BalanceTransactionTypeObligationReversalOutbound BalanceTransactionType = "obligation_reversal_outbound"
BalanceTransactionTypePayment BalanceTransactionType = "payment"
BalanceTransactionTypePaymentFailureRefund BalanceTransactionType = "payment_failure_refund"
BalanceTransactionTypePaymentRefund BalanceTransactionType = "payment_refund"
Expand Down Expand Up @@ -127,7 +133,7 @@ type BalanceTransactionListParams struct {
Payout *string `form:"payout"`
// Only returns the original transaction.
Source *string `form:"source"`
// Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
// Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
Type *string `form:"type"`
}

Expand Down Expand Up @@ -198,7 +204,7 @@ type BalanceTransaction struct {
Source *BalanceTransactionSource `json:"source"`
// If the transaction's net funds are available in the Stripe balance yet. Either `available` or `pending`.
Status BalanceTransactionStatus `json:"status"`
// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead.
// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead.
Type BalanceTransactionType `json:"type"`
}
type BalanceTransactionSource struct {
Expand Down
4 changes: 2 additions & 2 deletions bankaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ type BankAccountFutureRequirementsError struct {
Requirement string `json:"requirement"`
}

// Information about upcoming new requirements for the bank account, including what information needs to be collected.
// Information about the [upcoming new requirements for the bank account](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when.
type BankAccountFutureRequirements struct {
// Fields that need to be collected to keep the external 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"`
Expand Down Expand Up @@ -403,7 +403,7 @@ type BankAccount struct {
Deleted bool `json:"deleted"`
// Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
Fingerprint string `json:"fingerprint"`
// Information about upcoming new requirements for the bank account, including what information needs to be collected.
// Information about the [upcoming new requirements for the bank account](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when.
FutureRequirements *BankAccountFutureRequirements `json:"future_requirements"`
// Unique identifier for the object.
ID string `json:"id"`
Expand Down
4 changes: 3 additions & 1 deletion capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ type CapabilityParams struct {
Account *string `form:"-"` // Included in URL
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
// To request a new capability for an account, pass true. There can be a delay before the requested capability becomes active. If the capability has any activation requirements, the response includes them in the `requirements` arrays.
//
// If a capability isn't permanent, you can remove it from the account by passing false. Most capabilities are permanent after they've been requested. Attempting to remove a permanent capability returns an error.
Requested *bool `form:"requested"`
}

Expand Down
6 changes: 3 additions & 3 deletions checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ type CheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferParams struct
//
// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
RequestedAddressTypes []*string `form:"requested_address_types"`
// The list of bank transfer types that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
// The list of bank transfer types that this PaymentIntent is allowed to use for funding.
Type *string `form:"type"`
}

Expand Down Expand Up @@ -1682,7 +1682,7 @@ type CheckoutSessionParams struct {
// If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout.
// If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer.
//
// If blank for Checkout Sessions in `payment` or `subscription` mode, Checkout will create a new Customer object based on information provided during the payment flow.
// If blank for Checkout Sessions in `subscription` mode or with `customer_creation` set as `always` in `payment` mode, Checkout will create a new Customer object based on information provided during the payment flow.
//
// You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse.
Customer *string `form:"customer"`
Expand Down Expand Up @@ -2442,7 +2442,7 @@ type CheckoutSession struct {
// Currency conversion details for automatic currency conversion sessions
CurrencyConversion *CheckoutSessionCurrencyConversion `json:"currency_conversion"`
// The ID of the customer for this Session.
// For Checkout Sessions in `payment` or `subscription` mode, Checkout
// For Checkout Sessions in `subscription` mode or Checkout Sessions with `customer_creation` set as `always` in `payment` mode, Checkout
// will create a new customer object based on information provided
// during the payment flow unless an existing customer was provided when
// the Session was created.
Expand Down
4 changes: 4 additions & 0 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
stripe "github.com/stripe/stripe-go/v75"
"github.com/stripe/stripe-go/v75/account"
"github.com/stripe/stripe-go/v75/accountlink"
"github.com/stripe/stripe-go/v75/accountsession"
"github.com/stripe/stripe-go/v75/applepaydomain"
"github.com/stripe/stripe-go/v75/applicationfee"
appssecret "github.com/stripe/stripe-go/v75/apps/secret"
Expand Down Expand Up @@ -122,6 +123,8 @@ type API struct {
AccountLinks *accountlink.Client
// Accounts is the client used to invoke /accounts APIs.
Accounts *account.Client
// AccountSessions is the client used to invoke /account_sessions APIs.
AccountSessions *accountsession.Client
// ApplePayDomains is the client used to invoke /apple_pay/domains APIs.
ApplePayDomains *applepaydomain.Client
// ApplicationFees is the client used to invoke /application_fees APIs.
Expand Down Expand Up @@ -342,6 +345,7 @@ func (a *API) Init(key string, backends *stripe.Backends) {

a.AccountLinks = &accountlink.Client{B: backends.API, Key: key}
a.Accounts = &account.Client{B: backends.API, Key: key}
a.AccountSessions = &accountsession.Client{B: backends.API, Key: key}
a.ApplePayDomains = &applepaydomain.Client{B: backends.API, Key: key}
a.ApplicationFees = &applicationfee.Client{B: backends.API, Key: key}
a.AppsSecrets = &appssecret.Client{B: backends.API, Key: key}
Expand Down
Loading

0 comments on commit 1c611e8

Please sign in to comment.