Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code #1768

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v666
v669
2 changes: 2 additions & 0 deletions checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,8 @@ type CheckoutSessionListParams struct {
PaymentIntent *string `form:"payment_intent"`
// Only return the Checkout Sessions for the Payment Link specified.
PaymentLink *string `form:"payment_link"`
// Only return the Checkout Sessions matching the given status.
Status *string `form:"status"`
// Only return the Checkout Session for the subscription specified.
Subscription *string `form:"subscription"`
}
Expand Down
4 changes: 0 additions & 4 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import (
identityverificationsession "github.com/stripe/stripe-go/v76/identity/verificationsession"
"github.com/stripe/stripe-go/v76/invoice"
"github.com/stripe/stripe-go/v76/invoiceitem"
"github.com/stripe/stripe-go/v76/invoicelineitem"
issuingauthorization "github.com/stripe/stripe-go/v76/issuing/authorization"
issuingcard "github.com/stripe/stripe-go/v76/issuing/card"
issuingcardholder "github.com/stripe/stripe-go/v76/issuing/cardholder"
Expand Down Expand Up @@ -192,8 +191,6 @@ type API struct {
IdentityVerificationSessions *identityverificationsession.Client
// InvoiceItems is the client used to invoke /invoiceitems APIs.
InvoiceItems *invoiceitem.Client
// InvoiceLineItems is the client used to invoke /invoices/{invoice}/lines APIs.
InvoiceLineItems *invoicelineitem.Client
// Invoices is the client used to invoke /invoices APIs.
Invoices *invoice.Client
// IssuingAuthorizations is the client used to invoke /issuing/authorizations APIs.
Expand Down Expand Up @@ -397,7 +394,6 @@ func (a *API) Init(key string, backends *stripe.Backends) {
a.IdentityVerificationReports = &identityverificationreport.Client{B: backends.API, Key: key}
a.IdentityVerificationSessions = &identityverificationsession.Client{B: backends.API, Key: key}
a.InvoiceItems = &invoiceitem.Client{B: backends.API, Key: key}
a.InvoiceLineItems = &invoicelineitem.Client{B: backends.API, Key: key}
a.Invoices = &invoice.Client{B: backends.API, Key: key}
a.IssuingAuthorizations = &issuingauthorization.Client{B: backends.API, Key: key}
a.IssuingCardholders = &issuingcardholder.Client{B: backends.API, Key: key}
Expand Down
137 changes: 0 additions & 137 deletions invoicelineitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,142 +15,6 @@ const (
InvoiceLineItemTypeSubscription InvoiceLineItemType = "subscription"
)

// The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
type InvoiceLineItemDiscountParams struct {
// ID of the coupon to create a new discount for.
Coupon *string `form:"coupon"`
// ID of an existing discount on the object (or one of its ancestors) to reuse.
Discount *string `form:"discount"`
}

// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
type InvoiceLineItemPeriodParams struct {
// The end of the period, which must be greater than or equal to the start. This value is inclusive.
End *int64 `form:"end"`
// The start of the period. This value is inclusive.
Start *int64 `form:"start"`
}

// Data used to generate a new product object inline. One of `product` or `product_data` is required.
type InvoiceLineItemPriceDataProductDataParams struct {
// The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
Description *string `form:"description"`
// A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
Images []*string `form:"images"`
// 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"`
// The product's name, meant to be displayable to the customer.
Name *string `form:"name"`
// A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
TaxCode *string `form:"tax_code"`
}

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

p.Metadata[key] = value
}

// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
type InvoiceLineItemPriceDataParams struct {
// 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"`
// The ID of the product that this price will belong to. One of `product` or `product_data` is required.
Product *string `form:"product"`
// Data used to generate a new product object inline. One of `product` or `product_data` is required.
ProductData *InvoiceLineItemPriceDataProductDataParams `form:"product_data"`
// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
TaxBehavior *string `form:"tax_behavior"`
// A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
UnitAmount *int64 `form:"unit_amount"`
// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"`
}

// Data to find or create a TaxRate object.
//
// Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items.
type InvoiceLineItemTaxAmountTaxRateDataParams struct {
// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
Country *string `form:"country"`
// An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
Description *string `form:"description"`
// The display name of the tax rate, which will be shown to users.
DisplayName *string `form:"display_name"`
// This specifies if the tax rate is inclusive or exclusive.
Inclusive *bool `form:"inclusive"`
// The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice.
Jurisdiction *string `form:"jurisdiction"`
// The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
Percentage *float64 `form:"percentage"`
// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
State *string `form:"state"`
// The high-level tax type, such as `vat` or `sales_tax`.
TaxType *string `form:"tax_type"`
}

// A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
type InvoiceLineItemTaxAmountParams struct {
// The amount, in cents (or local equivalent), of the tax.
Amount *int64 `form:"amount"`
// The amount on which tax is calculated, in cents (or local equivalent).
TaxableAmount *int64 `form:"taxable_amount"`
// Data to find or create a TaxRate object.
//
// Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items.
TaxRateData *InvoiceLineItemTaxAmountTaxRateDataParams `form:"tax_rate_data"`
}

// Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item,
// so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice
// item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well.
// Updating an invoice's line item is only possible before the invoice is finalized.
type InvoiceLineItemParams struct {
Params `form:"*"`
Invoice *string `form:"-"` // Included in URL
// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
Amount *int64 `form:"amount"`
// An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
Description *string `form:"description"`
// Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations.
Discountable *bool `form:"discountable"`
// The coupons & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
Discounts []*InvoiceLineItemDiscountParams `form:"discounts"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// 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"`
// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
Period *InvoiceLineItemPeriodParams `form:"period"`
// The ID of the price object.
Price *string `form:"price"`
// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
PriceData *InvoiceLineItemPriceDataParams `form:"price_data"`
// Non-negative integer. The quantity of units for the line item.
Quantity *int64 `form:"quantity"`
// A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
TaxAmounts []*InvoiceLineItemTaxAmountParams `form:"tax_amounts"`
// The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates.
TaxRates []*string `form:"tax_rates"`
}

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

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

p.Metadata[key] = value
}

// The amount of discount calculated per discount for this line item.
type InvoiceLineItemDiscountAmount struct {
// The amount, in cents (or local equivalent), of the discount.
Expand All @@ -173,7 +37,6 @@ type InvoiceLineItemProrationDetails struct {
CreditedItems *InvoiceLineItemProrationDetailsCreditedItems `json:"credited_items"`
}
type InvoiceLineItem struct {
APIResource
// The amount, in cents (or local equivalent).
Amount int64 `json:"amount"`
// The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts.
Expand Down
41 changes: 0 additions & 41 deletions invoicelineitem/client.go

This file was deleted.

Loading