Skip to content

Commit

Permalink
Update generated code for v466
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Aug 16, 2023
1 parent a6d06b3 commit 34dca93
Show file tree
Hide file tree
Showing 214 changed files with 3,536 additions and 722 deletions.
38 changes: 35 additions & 3 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package stripe

import (
"encoding/json"
"github.com/stripe/stripe-go/v74/form"
"github.com/stripe/stripe-go/v75/form"

Check failure on line 11 in account.go

View workflow job for this annotation

GitHub Actions / Lint

no required module provides package github.com/stripe/stripe-go/v75/form; to add it:

Check failure on line 11 in account.go

View workflow job for this annotation

GitHub Actions / Test: go v1.18

no required module provides package github.com/stripe/stripe-go/v75/form; to add it:
)

// The business type.
Expand Down Expand Up @@ -165,12 +165,16 @@ type AccountParams struct {
Documents *AccountDocumentsParams `form:"documents"`
// The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent.
Email *string `form:"email"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation.
//
// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs.
ExternalAccount *AccountExternalAccountParams `form:"external_account"`
// Information about the person represented by the account. This field is null unless `business_type` is set to `individual`.
Individual *PersonParams `form:"individual"`
// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
Metadata map[string]string `form:"metadata"`
// Options for customizing how the account functions within Stripe.
Settings *AccountSettingsParams `form:"settings"`
// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance).
Expand All @@ -179,6 +183,20 @@ type AccountParams struct {
Type *string `form:"type"`
}

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

// AddMetadata adds a new key-value pair to the Metadata.
func (p *AccountParams) AddMetadata(key string, value string) {
if p.Metadata == nil {
p.Metadata = make(map[string]string)
}

p.Metadata[key] = value
}

// 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).
Expand Down Expand Up @@ -737,8 +755,8 @@ type AccountSettingsPayoutsScheduleParams struct {
}

// AppendTo implements custom encoding logic for AccountSettingsPayoutsScheduleParams.
func (a *AccountSettingsPayoutsScheduleParams) AppendTo(body *form.Values, keyParts []string) {
if BoolValue(a.DelayDaysMinimum) {
func (p *AccountSettingsPayoutsScheduleParams) AppendTo(body *form.Values, keyParts []string) {
if BoolValue(p.DelayDaysMinimum) {
body.Add(form.FormatKey(append(keyParts, "delay_days")), "minimum")
}
}
Expand Down Expand Up @@ -806,13 +824,22 @@ type AccountListParams struct {
ListParams `form:"*"`
Created *int64 `form:"created"`
CreatedRange *RangeQueryParams `form:"created"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}

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

// With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
//
// Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
type AccountRejectParams struct {
Params `form:"*"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`.
Reason *string `form:"reason"`
}
Expand Down Expand Up @@ -842,6 +869,11 @@ func (p *AccountExternalAccountParams) AppendTo(body *form.Values, keyParts []st
}
}

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

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"`
Expand Down
4 changes: 2 additions & 2 deletions account/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ package account
import (
"net/http"

stripe "github.com/stripe/stripe-go/v74"
"github.com/stripe/stripe-go/v74/form"
stripe "github.com/stripe/stripe-go/v75"

Check failure on line 13 in account/client.go

View workflow job for this annotation

GitHub Actions / Test: go v1.18

no required module provides package github.com/stripe/stripe-go/v75; to add it:
"github.com/stripe/stripe-go/v75/form"
)

// Client is used to invoke /accounts APIs.
Expand Down
7 changes: 7 additions & 0 deletions accountlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ type AccountLinkParams struct {
Account *string `form:"account"`
// Which information the platform needs to collect from the user. One of `currently_due` or `eventually_due`. Default is `currently_due`.
Collect *string `form:"collect"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user.
RefreshURL *string `form:"refresh_url"`
// The URL that the user will be redirected to upon leaving or completing the linked flow.
Expand All @@ -39,6 +41,11 @@ type AccountLinkParams struct {
Type *string `form:"type"`
}

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

// Account Links are the means by which a Connect platform grants a connected account permission to access
// Stripe-hosted applications, such as Connect Onboarding.
//
Expand Down
2 changes: 1 addition & 1 deletion accountlink/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package accountlink
import (
"net/http"

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

// Client is used to invoke /account_links APIs.
Expand Down
15 changes: 15 additions & 0 deletions applepaydomain.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,28 @@ package stripe
type ApplePayDomainListParams struct {
ListParams `form:"*"`
DomainName *string `form:"domain_name"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}

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

// Create an apple pay domain.
type ApplePayDomainParams struct {
Params `form:"*"`
DomainName *string `form:"domain_name"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}

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

type ApplePayDomain struct {
APIResource
// Time at which the object was created. Measured in seconds since the Unix epoch.
Expand Down
4 changes: 2 additions & 2 deletions applepaydomain/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ package applepaydomain
import (
"net/http"

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

// Client is used to invoke /apple_pay/domains APIs.
Expand Down
15 changes: 15 additions & 0 deletions applicationfee.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,27 @@ type ApplicationFeeListParams struct {
Charge *string `form:"charge"`
Created *int64 `form:"created"`
CreatedRange *RangeQueryParams `form:"created"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}

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

// Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee.
type ApplicationFeeParams struct {
Params `form:"*"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}

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

type ApplicationFee struct {
APIResource
// ID of the Stripe account this fee was taken from.
Expand Down
4 changes: 2 additions & 2 deletions applicationfee/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ package applicationfee
import (
"net/http"

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

// Client is used to invoke /application_fees APIs.
Expand Down
4 changes: 2 additions & 2 deletions apps/secret/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ package secret
import (
"net/http"

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

// Client is used to invoke /apps/secrets APIs.
Expand Down
29 changes: 29 additions & 0 deletions apps_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,19 @@ type AppsSecretFindScopeParams struct {
// Finds a secret in the secret store by name and scope.
type AppsSecretFindParams struct {
Params `form:"*"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// A name for the secret that's unique within the scope.
Name *string `form:"name"`
// Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.
Scope *AppsSecretFindScopeParams `form:"scope"`
}

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

// Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.
type AppsSecretScopeParams struct {
// The secret scope type.
Expand All @@ -43,6 +50,8 @@ type AppsSecretScopeParams struct {
// Create or replace a secret in the secret store.
type AppsSecretParams struct {
Params `form:"*"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// The Unix timestamp for the expiry time of the secret, after which the secret deletes.
ExpiresAt *int64 `form:"expires_at"`
// A name for the secret that's unique within the scope.
Expand All @@ -53,6 +62,11 @@ type AppsSecretParams struct {
Scope *AppsSecretScopeParams `form:"scope"`
}

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

// Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.
type AppsSecretListScopeParams struct {
// The secret scope type.
Expand All @@ -64,10 +78,17 @@ type AppsSecretListScopeParams struct {
// List all secrets stored on the given scope.
type AppsSecretListParams struct {
ListParams `form:"*"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.
Scope *AppsSecretListScopeParams `form:"scope"`
}

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

// Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.
type AppsSecretDeleteWhereScopeParams struct {
// The secret scope type.
Expand All @@ -79,11 +100,19 @@ type AppsSecretDeleteWhereScopeParams struct {
// Deletes a secret from the secret store by name and scope.
type AppsSecretDeleteWhereParams struct {
Params `form:"*"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// A name for the secret that's unique within the scope.
Name *string `form:"name"`
// Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.
Scope *AppsSecretDeleteWhereScopeParams `form:"scope"`
}

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

type AppsSecretScope struct {
// The secret scope type.
Type AppsSecretScopeType `json:"type"`
Expand Down
7 changes: 7 additions & 0 deletions balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ const (
// For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances).
type BalanceParams struct {
Params `form:"*"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}

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

// Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). The available balance for each currency and payment type can be found in the `source_types` property.
Expand Down
2 changes: 1 addition & 1 deletion balance/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package balance
import (
"net/http"

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

// Client is used to invoke /balance APIs.
Expand Down
14 changes: 14 additions & 0 deletions balancetransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ type BalanceTransactionListParams struct {
CreatedRange *RangeQueryParams `form:"created"`
// Only return transactions in a certain currency. 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"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID.
Payout *string `form:"payout"`
// Only returns the original transaction.
Expand All @@ -129,11 +131,23 @@ type BalanceTransactionListParams struct {
Type *string `form:"type"`
}

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

// Retrieves the balance transaction with the given ID.
//
// Note that this endpoint previously used the path /v1/balance/history/:id.
type BalanceTransactionParams struct {
Params `form:"*"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}

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

// Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction.
Expand Down
4 changes: 2 additions & 2 deletions balancetransaction/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ package balancetransaction
import (
"net/http"

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

// Client is used to invoke /balance_transactions APIs.
Expand Down
Loading

0 comments on commit 34dca93

Please sign in to comment.