Skip to content

Commit

Permalink
Merge upstream and update generated code for v484
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Aug 25, 2023
2 parents fdf72f9 + d43de36 commit 7bd9065
Show file tree
Hide file tree
Showing 9 changed files with 188 additions and 121 deletions.
25 changes: 17 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Changelog

## 75.0.0-beta.1 - 2023-08-24
* [#1719](https://github.com/stripe/stripe-go/pull/1719) Move beta version back
* [#1715](https://github.com/stripe/stripe-go/pull/1715) Update generated code for beta
* Add support for new resources `QuotePreviewInvoice` and `QuotePreviewSchedule`
* Remove support for `AppliesTo` on `Invoice` and `SubscriptionSchedule`
* Add support for `Cl`, `Co`, `ID`, `Kr`, `MX`, `My`, `Sa`, `TH`, `TR`, and `Vn` on `TaxRegistrationCountryOptionsParams` and `TaxRegistrationCountryOptions`
* Remove support for `Hk` on `TaxRegistrationCountryOptionsParams` and `TaxRegistrationCountryOptions`
* [#1714](https://github.com/stripe/stripe-go/pull/1714) Merge master
## 75.2.0 - 2023-08-24
* [#1718](https://github.com/stripe/stripe-go/pull/1718) Update generated code
* Add support for `Retention` on `BillingPortalSessionFlowDataSubscriptionCancelParams` and `BillingPortalSessionFlowSubscriptionCancel`
* Add support for `Prefetch` on `CheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsParams`, `CheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections`, `FinancialConnectionsSessionParams`, `FinancialConnectionsSession`, `InvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsParams`, `InvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`, `PaymentIntentConfirmPaymentMethodOptionsUsBankAccountFinancialConnectionsParams`, `PaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsParams`, `PaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections`, `SetupIntentConfirmPaymentMethodOptionsUsBankAccountFinancialConnectionsParams`, `SetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsParams`, `SetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections`, `SubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsParams`, and `SubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`
* Add support for `PaymentMethodDetails` on `Dispute`
* Add support for `BalanceTransaction ` on `CustomerCashBalanceTransaction.AdjustedForOverdraft`
* [#1717](https://github.com/stripe/stripe-go/pull/1717) Replace import placeholder before running formatting
* [#1716](https://github.com/stripe/stripe-go/pull/1716) Replace version placeholder with an actual version during format

## 75.1.0 - 2023-08-17
* [#1713](https://github.com/stripe/stripe-go/pull/1713) Update generated code
Expand Down Expand Up @@ -103,6 +103,15 @@
- ⚠️ Removed deprecated error code constant `ErrorCodeSkuInactive`, prefer `ErrorCodeSKUInactive`.
- ⚠️ Removed deprecated error code constant `ErrorCodeinstantPayoutsLimitExceeded`, prefer `ErrorCodeInstantPayoutsLimitExceeded`.
## 75.0.0-beta.1 - 2023-08-24
* [#1719](https://github.com/stripe/stripe-go/pull/1719) Move beta version back
* [#1715](https://github.com/stripe/stripe-go/pull/1715) Update generated code for beta
* Add support for new resources `QuotePreviewInvoice` and `QuotePreviewSchedule`
* Remove support for `AppliesTo` on `Invoice` and `SubscriptionSchedule`
* Add support for `Cl`, `Co`, `ID`, `Kr`, `MX`, `My`, `Sa`, `TH`, `TR`, and `Vn` on `TaxRegistrationCountryOptionsParams` and `TaxRegistrationCountryOptions`
* Remove support for `Hk` on `TaxRegistrationCountryOptionsParams` and `TaxRegistrationCountryOptions`
* [#1714](https://github.com/stripe/stripe-go/pull/1714) Merge master
## 74.31.0-beta.1 - 2023-08-10
* [#1701](https://github.com/stripe/stripe-go/pull/1701) Update generated code for beta
* Add support for `Paypal` on `PaymentMethodConfigurationParams` and `PaymentMethodConfiguration`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v482
v484
8 changes: 8 additions & 0 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ import (
"github.com/stripe/stripe-go/v75/promotioncode"
"github.com/stripe/stripe-go/v75/quote"
"github.com/stripe/stripe-go/v75/quotephase"
"github.com/stripe/stripe-go/v75/quotepreviewinvoice"
"github.com/stripe/stripe-go/v75/quotepreviewschedule"
radarearlyfraudwarning "github.com/stripe/stripe-go/v75/radar/earlyfraudwarning"
radarvaluelist "github.com/stripe/stripe-go/v75/radar/valuelist"
radarvaluelistitem "github.com/stripe/stripe-go/v75/radar/valuelistitem"
Expand Down Expand Up @@ -265,6 +267,10 @@ type API struct {
PromotionCodes *promotioncode.Client
// QuotePhases is the client used to invoke /quote_phases APIs.
QuotePhases *quotephase.Client
// QuotePreviewInvoices is the client used to invoke /quotes/{quote}/preview_invoices APIs.
QuotePreviewInvoices *quotepreviewinvoice.Client
// QuotePreviewSchedules is the client used to invoke /quotes/{quote}/preview_subscription_schedules APIs.
QuotePreviewSchedules *quotepreviewschedule.Client
// Quotes is the client used to invoke /quotes APIs.
Quotes *quote.Client
// RadarEarlyFraudWarnings is the client used to invoke /radar/early_fraud_warnings APIs.
Expand Down Expand Up @@ -456,6 +462,8 @@ 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.QuotePreviewInvoices = &quotepreviewinvoice.Client{B: backends.API, Key: key}
a.QuotePreviewSchedules = &quotepreviewschedule.Client{B: backends.API, 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}
Expand Down
26 changes: 0 additions & 26 deletions quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -1199,19 +1199,6 @@ func (p *QuoteListComputedUpfrontLineItemsParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
}

// Preview the invoices that would be generated by accepting the quote.
type QuoteListPreviewInvoicesParams struct {
ListParams `form:"*"`
Quote *string `form:"-"` // Included in URL
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}

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

// Preview the invoice line items that would be generated by accepting the quote.
type QuoteListPreviewInvoiceLinesParams struct {
ListParams `form:"*"`
Expand All @@ -1226,19 +1213,6 @@ func (p *QuoteListPreviewInvoiceLinesParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
}

// Preview the schedules that would be generated by accepting the quote
type QuoteListPreviewSubscriptionSchedulesParams struct {
ListParams `form:"*"`
Quote *string `form:"-"` // Included in URL
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}

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

// Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
type QuoteListLinesParams struct {
ListParams `form:"*"`
Expand Down
86 changes: 0 additions & 86 deletions quote/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,92 +345,6 @@ func (i *InvoiceLineItemIter) InvoiceLineItemList() *stripe.InvoiceLineItemList
return i.List().(*stripe.InvoiceLineItemList)
}

// ListPreviewInvoices is the method for the `GET /v1/quotes/{quote}/preview_invoices` API.
func ListPreviewInvoices(params *stripe.QuoteListPreviewInvoicesParams) *PreviewInvoiceIter {
return getC().ListPreviewInvoices(params)
}

// ListPreviewInvoices is the method for the `GET /v1/quotes/{quote}/preview_invoices` API.
func (c Client) ListPreviewInvoices(listParams *stripe.QuoteListPreviewInvoicesParams) *PreviewInvoiceIter {
path := stripe.FormatURLPath(
"/v1/quotes/%s/preview_invoices",
stripe.StringValue(listParams.Quote),
)
return &PreviewInvoiceIter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
list := &stripe.QuotePreviewInvoiceList{}
err := c.B.CallRaw(http.MethodGet, path, c.Key, b, p, list)

ret := make([]interface{}, len(list.Data))
for i, v := range list.Data {
ret[i] = v
}

return ret, list, err
}),
}
}

// PreviewInvoiceIter is an iterator for quote preview invoices.
type PreviewInvoiceIter struct {
*stripe.Iter
}

// QuotePreviewInvoice returns the quote preview invoice which the iterator is currently pointing to.
func (i *PreviewInvoiceIter) QuotePreviewInvoice() *stripe.QuotePreviewInvoice {
return i.Current().(*stripe.QuotePreviewInvoice)
}

// QuotePreviewInvoiceList returns the current list object which the iterator is
// currently using. List objects will change as new API calls are made to
// continue pagination.
func (i *PreviewInvoiceIter) QuotePreviewInvoiceList() *stripe.QuotePreviewInvoiceList {
return i.List().(*stripe.QuotePreviewInvoiceList)
}

// ListPreviewSubscriptionSchedules is the method for the `GET /v1/quotes/{quote}/preview_subscription_schedules` API.
func ListPreviewSubscriptionSchedules(params *stripe.QuoteListPreviewSubscriptionSchedulesParams) *PreviewScheduleIter {
return getC().ListPreviewSubscriptionSchedules(params)
}

// ListPreviewSubscriptionSchedules is the method for the `GET /v1/quotes/{quote}/preview_subscription_schedules` API.
func (c Client) ListPreviewSubscriptionSchedules(listParams *stripe.QuoteListPreviewSubscriptionSchedulesParams) *PreviewScheduleIter {
path := stripe.FormatURLPath(
"/v1/quotes/%s/preview_subscription_schedules",
stripe.StringValue(listParams.Quote),
)
return &PreviewScheduleIter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
list := &stripe.QuotePreviewScheduleList{}
err := c.B.CallRaw(http.MethodGet, path, c.Key, b, p, list)

ret := make([]interface{}, len(list.Data))
for i, v := range list.Data {
ret[i] = v
}

return ret, list, err
}),
}
}

// PreviewScheduleIter is an iterator for quote preview schedules.
type PreviewScheduleIter struct {
*stripe.Iter
}

// QuotePreviewSchedule returns the quote preview schedule which the iterator is currently pointing to.
func (i *PreviewScheduleIter) QuotePreviewSchedule() *stripe.QuotePreviewSchedule {
return i.Current().(*stripe.QuotePreviewSchedule)
}

// QuotePreviewScheduleList returns the current list object which the iterator is
// currently using. List objects will change as new API calls are made to
// continue pagination.
func (i *PreviewScheduleIter) QuotePreviewScheduleList() *stripe.QuotePreviewScheduleList {
return i.List().(*stripe.QuotePreviewScheduleList)
}

func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.GetBackend(stripe.UploadsBackend), stripe.Key}
}
13 changes: 13 additions & 0 deletions quotepreviewinvoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,19 @@ const (
QuotePreviewInvoiceTotalTaxAmountTaxabilityReasonZeroRated QuotePreviewInvoiceTotalTaxAmountTaxabilityReason = "zero_rated"
)

// Preview the invoices that would be generated by accepting the quote.
type QuotePreviewInvoiceListParams struct {
ListParams `form:"*"`
Quote *string `form:"-"` // Included in URL
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}

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

type QuotePreviewInvoiceAppliesTo struct {
// A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
NewReference string `json:"new_reference"`
Expand Down
68 changes: 68 additions & 0 deletions quotepreviewinvoice/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//
//
// File generated from our OpenAPI spec
//
//

// Package quotepreviewinvoice provides the /quotes/{quote}/preview_invoices APIs
package quotepreviewinvoice

import (
"net/http"

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

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

// List returns a list of quote preview invoices.
func List(params *stripe.QuotePreviewInvoiceListParams) *Iter {
return getC().List(params)
}

// List returns a list of quote preview invoices.
func (c Client) List(listParams *stripe.QuotePreviewInvoiceListParams) *Iter {
path := stripe.FormatURLPath(
"/v1/quotes/%s/preview_invoices",
stripe.StringValue(listParams.Quote),
)
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
list := &stripe.QuotePreviewInvoiceList{}
err := c.B.CallRaw(http.MethodGet, path, c.Key, b, p, list)

ret := make([]interface{}, len(list.Data))
for i, v := range list.Data {
ret[i] = v
}

return ret, list, err
}),
}
}

// Iter is an iterator for quote preview invoices.
type Iter struct {
*stripe.Iter
}

// QuotePreviewInvoice returns the quote preview invoice which the iterator is currently pointing to.
func (i *Iter) QuotePreviewInvoice() *stripe.QuotePreviewInvoice {
return i.Current().(*stripe.QuotePreviewInvoice)
}

// QuotePreviewInvoiceList returns the current list object which the iterator is
// currently using. List objects will change as new API calls are made to
// continue pagination.
func (i *Iter) QuotePreviewInvoiceList() *stripe.QuotePreviewInvoiceList {
return i.List().(*stripe.QuotePreviewInvoiceList)
}

func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}
13 changes: 13 additions & 0 deletions quotepreviewschedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,19 @@ const (
QuotePreviewScheduleStatusReleased QuotePreviewScheduleStatus = "released"
)

// Preview the schedules that would be generated by accepting the quote
type QuotePreviewScheduleListParams struct {
ListParams `form:"*"`
Quote *string `form:"-"` // Included in URL
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}

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

type QuotePreviewScheduleAppliesTo struct {
// A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
NewReference string `json:"new_reference"`
Expand Down
68 changes: 68 additions & 0 deletions quotepreviewschedule/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//
//
// File generated from our OpenAPI spec
//
//

// Package quotepreviewschedule provides the /quotes/{quote}/preview_subscription_schedules APIs
package quotepreviewschedule

import (
"net/http"

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

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

// List returns a list of quote preview schedules.
func List(params *stripe.QuotePreviewScheduleListParams) *Iter {
return getC().List(params)
}

// List returns a list of quote preview schedules.
func (c Client) List(listParams *stripe.QuotePreviewScheduleListParams) *Iter {
path := stripe.FormatURLPath(
"/v1/quotes/%s/preview_subscription_schedules",
stripe.StringValue(listParams.Quote),
)
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
list := &stripe.QuotePreviewScheduleList{}
err := c.B.CallRaw(http.MethodGet, path, c.Key, b, p, list)

ret := make([]interface{}, len(list.Data))
for i, v := range list.Data {
ret[i] = v
}

return ret, list, err
}),
}
}

// Iter is an iterator for quote preview schedules.
type Iter struct {
*stripe.Iter
}

// QuotePreviewSchedule returns the quote preview schedule which the iterator is currently pointing to.
func (i *Iter) QuotePreviewSchedule() *stripe.QuotePreviewSchedule {
return i.Current().(*stripe.QuotePreviewSchedule)
}

// QuotePreviewScheduleList returns the current list object which the iterator is
// currently using. List objects will change as new API calls are made to
// continue pagination.
func (i *Iter) QuotePreviewScheduleList() *stripe.QuotePreviewScheduleList {
return i.List().(*stripe.QuotePreviewScheduleList)
}

func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}

0 comments on commit 7bd9065

Please sign in to comment.