From f227370898a8ec6f48fe6cfce8b54ae7d0a30d1d Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 10:11:16 -0700 Subject: [PATCH] Update generated code (#1928) * Update generated code for v1268 * Update generated code for v1268 * Preview versions are not needed anymore * Fix formating --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> --- invoice.go | 2 -- invoicelineitem.go | 2 -- margin.go | 51 ---------------------------------------------- 3 files changed, 55 deletions(-) delete mode 100644 margin.go diff --git a/invoice.go b/invoice.go index 52399ab030..8ee2c4d2ed 100644 --- a/invoice.go +++ b/invoice.go @@ -3113,8 +3113,6 @@ type InvoiceTotalPretaxCreditAmount struct { CreditBalanceTransaction *BillingCreditBalanceTransaction `json:"credit_balance_transaction"` // The discount that was applied to get this pretax credit amount. Discount *Discount `json:"discount"` - // The margin that was applied to get this pretax credit amount. - Margin *Margin `json:"margin"` // Type of the pretax credit amount referenced. Type InvoiceTotalPretaxCreditAmountType `json:"type"` } diff --git a/invoicelineitem.go b/invoicelineitem.go index 2ba748388a..2a9b668e96 100644 --- a/invoicelineitem.go +++ b/invoicelineitem.go @@ -176,8 +176,6 @@ type InvoiceLineItemPretaxCreditAmount struct { CreditBalanceTransaction *BillingCreditBalanceTransaction `json:"credit_balance_transaction"` // The discount that was applied to get this pretax credit amount. Discount *Discount `json:"discount"` - // The margin that was applied to get this pretax credit amount. - Margin *Margin `json:"margin"` // Type of the pretax credit amount referenced. Type InvoiceLineItemPretaxCreditAmountType `json:"type"` } diff --git a/margin.go b/margin.go deleted file mode 100644 index 94102eefef..0000000000 --- a/margin.go +++ /dev/null @@ -1,51 +0,0 @@ -// -// -// File generated from our OpenAPI spec -// -// - -package stripe - -import "encoding/json" - -// A (partner) margin represents a specific discount distributed in partner reseller programs to business partners who -// resell products and services and earn a discount (margin) for doing so. -type Margin struct { - // Whether the margin can be applied to invoices, invoice items, or invoice line items. Defaults to `true`. - Active bool `json:"active"` - // Time at which the object was created. Measured in seconds since the Unix epoch. - Created int64 `json:"created"` - // Unique identifier for the object. - ID string `json:"id"` - // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - Livemode bool `json:"livemode"` - // 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. - Metadata map[string]string `json:"metadata"` - // Name of the margin that's displayed on, for example, invoices. - Name string `json:"name"` - // String representing the object's type. Objects of the same type share the same value. - Object string `json:"object"` - // Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied. - PercentOff float64 `json:"percent_off"` - // Time at which the object was last updated. Measured in seconds since the Unix epoch. - Updated int64 `json:"updated"` -} - -// UnmarshalJSON handles deserialization of a Margin. -// This custom unmarshaling is needed because the resulting -// property may be an id or the full struct if it was expanded. -func (m *Margin) UnmarshalJSON(data []byte) error { - if id, ok := ParseID(data); ok { - m.ID = id - return nil - } - - type margin Margin - var v margin - if err := json.Unmarshal(data, &v); err != nil { - return err - } - - *m = Margin(v) - return nil -}