Skip to content

Commit

Permalink
Merge pull request #1773 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] authored Nov 30, 2023
2 parents 30cf5c8 + e4c9c47 commit 4fe2225
Show file tree
Hide file tree
Showing 15 changed files with 669 additions and 8 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v680
v691
8 changes: 5 additions & 3 deletions balancetransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,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`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `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 about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.
// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `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`, `payment_unreconciled`, `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 about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.
type BalanceTransactionType string

// List of values that BalanceTransactionType can take
Expand All @@ -85,6 +85,8 @@ const (
BalanceTransactionTypeApplicationFee BalanceTransactionType = "application_fee"
BalanceTransactionTypeApplicationFeeRefund BalanceTransactionType = "application_fee_refund"
BalanceTransactionTypeCharge BalanceTransactionType = "charge"
BalanceTransactionTypeClimateOrderPurchase BalanceTransactionType = "climate_order_purchase"
BalanceTransactionTypeClimateOrderRefund BalanceTransactionType = "climate_order_refund"
BalanceTransactionTypeConnectCollectionTransfer BalanceTransactionType = "connect_collection_transfer"
BalanceTransactionTypeContribution BalanceTransactionType = "contribution"
BalanceTransactionTypeIssuingAuthorizationHold BalanceTransactionType = "issuing_authorization_hold"
Expand Down Expand Up @@ -135,7 +137,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`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `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`, `climate_order_purchase`, `climate_order_refund`, `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`, `payment_unreconciled`, `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 @@ -206,7 +208,7 @@ type BalanceTransaction struct {
Source *BalanceTransactionSource `json:"source"`
// The transaction's net funds status in the Stripe balance, which are 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`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `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 about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.
// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `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`, `payment_unreconciled`, `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 about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.
Type BalanceTransactionType `json:"type"`
}
type BalanceTransactionSource struct {
Expand Down
4 changes: 4 additions & 0 deletions checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,10 @@ type CheckoutSessionListCustomerDetailsParams struct {
// Returns a list of Checkout Sessions.
type CheckoutSessionListParams struct {
ListParams `form:"*"`
// Only return the Checkout Sessions that were created during the given date interval.
Created *int64 `form:"created"`
// Only return the Checkout Sessions that were created during the given date interval.
CreatedRange *RangeQueryParams `form:"created"`
// Only return the Checkout Sessions for the Customer specified.
Customer *string `form:"customer"`
// Only return the Checkout Sessions for the Customer details specified.
Expand Down
12 changes: 12 additions & 0 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import (
"github.com/stripe/stripe-go/v76/cashbalance"
"github.com/stripe/stripe-go/v76/charge"
checkoutsession "github.com/stripe/stripe-go/v76/checkout/session"
climateorder "github.com/stripe/stripe-go/v76/climate/order"
climateproduct "github.com/stripe/stripe-go/v76/climate/product"
climatesupplier "github.com/stripe/stripe-go/v76/climate/supplier"
"github.com/stripe/stripe-go/v76/confirmationtoken"
"github.com/stripe/stripe-go/v76/countryspec"
"github.com/stripe/stripe-go/v76/coupon"
Expand Down Expand Up @@ -186,6 +189,12 @@ type API struct {
Charges *charge.Client
// CheckoutSessions is the client used to invoke /checkout/sessions APIs.
CheckoutSessions *checkoutsession.Client
// ClimateOrders is the client used to invoke /climate/orders APIs.
ClimateOrders *climateorder.Client
// ClimateProducts is the client used to invoke /climate/products APIs.
ClimateProducts *climateproduct.Client
// ClimateSuppliers is the client used to invoke /climate/suppliers APIs.
ClimateSuppliers *climatesupplier.Client
// ConfirmationTokens is the client used to invoke /confirmation_tokens APIs.
ConfirmationTokens *confirmationtoken.Client
// CountrySpecs is the client used to invoke /country_specs APIs.
Expand Down Expand Up @@ -444,6 +453,9 @@ func (a *API) Init(key string, backends *stripe.Backends) {
a.CashBalances = &cashbalance.Client{B: backends.API, Key: key}
a.Charges = &charge.Client{B: backends.API, Key: key}
a.CheckoutSessions = &checkoutsession.Client{B: backends.API, Key: key}
a.ClimateOrders = &climateorder.Client{B: backends.API, Key: key}
a.ClimateProducts = &climateproduct.Client{B: backends.API, Key: key}
a.ClimateSuppliers = &climatesupplier.Client{B: backends.API, Key: key}
a.ConfirmationTokens = &confirmationtoken.Client{B: backends.API, Key: key}
a.CountrySpecs = &countryspec.Client{B: backends.API, Key: key}
a.Coupons = &coupon.Client{B: backends.API, Key: key}
Expand Down
115 changes: 115 additions & 0 deletions climate/order/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
//
//
// File generated from our OpenAPI spec
//
//

// Package order provides the /climate/orders APIs
package order

import (
"net/http"

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

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

// New creates a new climate order.
func New(params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) {
return getC().New(params)
}

// New creates a new climate order.
func (c Client) New(params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) {
order := &stripe.ClimateOrder{}
err := c.B.Call(http.MethodPost, "/v1/climate/orders", c.Key, params, order)
return order, err
}

// Get returns the details of a climate order.
func Get(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) {
return getC().Get(id, params)
}

// Get returns the details of a climate order.
func (c Client) Get(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) {
path := stripe.FormatURLPath("/v1/climate/orders/%s", id)
order := &stripe.ClimateOrder{}
err := c.B.Call(http.MethodGet, path, c.Key, params, order)
return order, err
}

// Update updates a climate order's properties.
func Update(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) {
return getC().Update(id, params)
}

// Update updates a climate order's properties.
func (c Client) Update(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) {
path := stripe.FormatURLPath("/v1/climate/orders/%s", id)
order := &stripe.ClimateOrder{}
err := c.B.Call(http.MethodPost, path, c.Key, params, order)
return order, err
}

// Cancel is the method for the `POST /v1/climate/orders/{order}/cancel` API.
func Cancel(id string, params *stripe.ClimateOrderCancelParams) (*stripe.ClimateOrder, error) {
return getC().Cancel(id, params)
}

// Cancel is the method for the `POST /v1/climate/orders/{order}/cancel` API.
func (c Client) Cancel(id string, params *stripe.ClimateOrderCancelParams) (*stripe.ClimateOrder, error) {
path := stripe.FormatURLPath("/v1/climate/orders/%s/cancel", id)
order := &stripe.ClimateOrder{}
err := c.B.Call(http.MethodPost, path, c.Key, params, order)
return order, err
}

// List returns a list of climate orders.
func List(params *stripe.ClimateOrderListParams) *Iter {
return getC().List(params)
}

// List returns a list of climate orders.
func (c Client) List(listParams *stripe.ClimateOrderListParams) *Iter {
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
list := &stripe.ClimateOrderList{}
err := c.B.CallRaw(http.MethodGet, "/v1/climate/orders", 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 climate orders.
type Iter struct {
*stripe.Iter
}

// ClimateOrder returns the climate order which the iterator is currently pointing to.
func (i *Iter) ClimateOrder() *stripe.ClimateOrder {
return i.Current().(*stripe.ClimateOrder)
}

// ClimateOrderList 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) ClimateOrderList() *stripe.ClimateOrderList {
return i.List().(*stripe.ClimateOrderList)
}

func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}
77 changes: 77 additions & 0 deletions climate/product/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//
//
// File generated from our OpenAPI spec
//
//

// Package product provides the /climate/products APIs
package product

import (
"net/http"

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

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

// Get returns the details of a climate product.
func Get(id string, params *stripe.ClimateProductParams) (*stripe.ClimateProduct, error) {
return getC().Get(id, params)
}

// Get returns the details of a climate product.
func (c Client) Get(id string, params *stripe.ClimateProductParams) (*stripe.ClimateProduct, error) {
path := stripe.FormatURLPath("/v1/climate/products/%s", id)
product := &stripe.ClimateProduct{}
err := c.B.Call(http.MethodGet, path, c.Key, params, product)
return product, err
}

// List returns a list of climate products.
func List(params *stripe.ClimateProductListParams) *Iter {
return getC().List(params)
}

// List returns a list of climate products.
func (c Client) List(listParams *stripe.ClimateProductListParams) *Iter {
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
list := &stripe.ClimateProductList{}
err := c.B.CallRaw(http.MethodGet, "/v1/climate/products", 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 climate products.
type Iter struct {
*stripe.Iter
}

// ClimateProduct returns the climate product which the iterator is currently pointing to.
func (i *Iter) ClimateProduct() *stripe.ClimateProduct {
return i.Current().(*stripe.ClimateProduct)
}

// ClimateProductList 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) ClimateProductList() *stripe.ClimateProductList {
return i.List().(*stripe.ClimateProductList)
}

func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}
77 changes: 77 additions & 0 deletions climate/supplier/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//
//
// File generated from our OpenAPI spec
//
//

// Package supplier provides the /climate/suppliers APIs
package supplier

import (
"net/http"

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

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

// Get returns the details of a climate supplier.
func Get(id string, params *stripe.ClimateSupplierParams) (*stripe.ClimateSupplier, error) {
return getC().Get(id, params)
}

// Get returns the details of a climate supplier.
func (c Client) Get(id string, params *stripe.ClimateSupplierParams) (*stripe.ClimateSupplier, error) {
path := stripe.FormatURLPath("/v1/climate/suppliers/%s", id)
supplier := &stripe.ClimateSupplier{}
err := c.B.Call(http.MethodGet, path, c.Key, params, supplier)
return supplier, err
}

// List returns a list of climate suppliers.
func List(params *stripe.ClimateSupplierListParams) *Iter {
return getC().List(params)
}

// List returns a list of climate suppliers.
func (c Client) List(listParams *stripe.ClimateSupplierListParams) *Iter {
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
list := &stripe.ClimateSupplierList{}
err := c.B.CallRaw(http.MethodGet, "/v1/climate/suppliers", 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 climate suppliers.
type Iter struct {
*stripe.Iter
}

// ClimateSupplier returns the climate supplier which the iterator is currently pointing to.
func (i *Iter) ClimateSupplier() *stripe.ClimateSupplier {
return i.Current().(*stripe.ClimateSupplier)
}

// ClimateSupplierList 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) ClimateSupplierList() *stripe.ClimateSupplierList {
return i.List().(*stripe.ClimateSupplierList)
}

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

0 comments on commit 4fe2225

Please sign in to comment.