-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1773 from stripe/latest-codegen-beta
Update generated code for beta
- Loading branch information
Showing
15 changed files
with
669 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v680 | ||
v691 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} | ||
} |
Oops, something went wrong.