Skip to content

Commit

Permalink
Merge upstream and update generated code for v425
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Jul 21, 2023
2 parents 3ccb768 + 8c08b96 commit d627a1e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,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.API, 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}
Expand Down Expand Up @@ -453,7 +453,7 @@ func (a *API) Init(key string, backends *stripe.Backends) {
a.Products = &product.Client{B: backends.API, Key: key}
a.PromotionCodes = &promotioncode.Client{B: backends.API, Key: key}
a.QuotePhases = &quotephase.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
9 changes: 5 additions & 4 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 All @@ -40,7 +41,7 @@ func (c Client) New(params *stripe.FileParams) (*stripe.File, error) {
}

file := &stripe.File{}
err = c.B.CallMultipart(http.MethodPost, "/v1/files", c.Key, boundary, bodyBuffer, &params.Params, file)
err = c.BUploads.CallMultipart(http.MethodPost, "/v1/files", c.Key, boundary, bodyBuffer, &params.Params, file)

return file, err
}
Expand Down Expand Up @@ -98,5 +99,5 @@ func (i *Iter) FileList() *stripe.FileList {
}

func getC() Client {
return Client{stripe.GetBackend(stripe.UploadsBackend), stripe.Key}
return Client{stripe.GetBackend(stripe.APIBackend), stripe.GetBackend(stripe.UploadsBackend), stripe.Key}
}
10 changes: 8 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 @@ -133,7 +134,7 @@ 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)
err := c.BUploads.CallStreaming(http.MethodGet, path, c.Key, params, stream)
return stream, err
}

Expand Down Expand Up @@ -432,5 +433,10 @@ func (i *SubscriptionScheduleIter) SubscriptionScheduleList() *stripe.Subscripti
}

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,
}
}

0 comments on commit d627a1e

Please sign in to comment.