diff --git a/stripe/__init__.py b/stripe/__init__.py index 0300781a1..3f28c4ecd 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -444,7 +444,6 @@ def __getattr__(name): from stripe._login_link import LoginLink as LoginLink from stripe._mandate import Mandate as Mandate from stripe._mandate_service import MandateService as MandateService -from stripe._margin import Margin as Margin from stripe._payment_intent import PaymentIntent as PaymentIntent from stripe._payment_intent_service import ( PaymentIntentService as PaymentIntentService, diff --git a/stripe/_invoice.py b/stripe/_invoice.py index db9966044..3c2bd5886 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -40,7 +40,6 @@ from stripe._customer import Customer from stripe._discount import Discount from stripe._invoice_line_item import InvoiceLineItem - from stripe._margin import Margin from stripe._payment_intent import PaymentIntent from stripe._payment_method import PaymentMethod from stripe._quote import Quote @@ -984,10 +983,6 @@ class TotalPretaxCreditAmount(StripeObject): """ The discount that was applied to get this pretax credit amount. """ - margin: Optional[ExpandableField["Margin"]] - """ - The margin that was applied to get this pretax credit amount. - """ type: Literal["credit_balance_transaction", "discount"] """ Type of the pretax credit amount referenced. diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index c81defb72..827490207 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -17,7 +17,6 @@ if TYPE_CHECKING: from stripe._discount import Discount from stripe._invoice_item import InvoiceItem - from stripe._margin import Margin from stripe._plan import Plan from stripe._price import Price from stripe._subscription import Subscription @@ -72,10 +71,6 @@ class PretaxCreditAmount(StripeObject): """ The discount that was applied to get this pretax credit amount. """ - margin: Optional[ExpandableField["Margin"]] - """ - The margin that was applied to get this pretax credit amount. - """ type: Literal["credit_balance_transaction", "discount"] """ Type of the pretax credit amount referenced. diff --git a/stripe/_margin.py b/stripe/_margin.py deleted file mode 100644 index 949e35f9b..000000000 --- a/stripe/_margin.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe._stripe_object import StripeObject -from typing import ClassVar, Dict, Optional -from typing_extensions import Literal - - -class Margin(StripeObject): - """ - 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. - """ - - OBJECT_NAME: ClassVar[Literal["margin"]] = "margin" - active: bool - """ - Whether the margin can be applied to invoices, invoice items, or invoice line items. Defaults to `true`. - """ - created: int - """ - Time at which the object was created. Measured in seconds since the Unix epoch. - """ - id: str - """ - Unique identifier for the object. - """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ - metadata: Optional[Dict[str, str]] - """ - 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. - """ - name: Optional[str] - """ - Name of the margin that's displayed on, for example, invoices. - """ - object: Literal["margin"] - """ - String representing the object's type. Objects of the same type share the same value. - """ - percent_off: float - """ - 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. - """ - updated: int - """ - Time at which the object was last updated. Measured in seconds since the Unix epoch. - """ diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index fb0a0ba5b..cbb749a12 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -81,7 +81,6 @@ stripe.LineItem.OBJECT_NAME: stripe.LineItem, stripe.LoginLink.OBJECT_NAME: stripe.LoginLink, stripe.Mandate.OBJECT_NAME: stripe.Mandate, - stripe.Margin.OBJECT_NAME: stripe.Margin, stripe.PaymentIntent.OBJECT_NAME: stripe.PaymentIntent, stripe.PaymentLink.OBJECT_NAME: stripe.PaymentLink, stripe.PaymentMethod.OBJECT_NAME: stripe.PaymentMethod, diff --git a/stripe/api_resources/__init__.py b/stripe/api_resources/__init__.py index d142b58af..99bf65826 100644 --- a/stripe/api_resources/__init__.py +++ b/stripe/api_resources/__init__.py @@ -85,7 +85,6 @@ from stripe.api_resources.list_object import ListObject from stripe.api_resources.login_link import LoginLink from stripe.api_resources.mandate import Mandate - from stripe.api_resources.margin import Margin from stripe.api_resources.payment_intent import PaymentIntent from stripe.api_resources.payment_link import PaymentLink from stripe.api_resources.payment_method import PaymentMethod diff --git a/stripe/api_resources/margin.py b/stripe/api_resources/margin.py deleted file mode 100644 index 2a94240be..000000000 --- a/stripe/api_resources/margin.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from typing_extensions import TYPE_CHECKING -from warnings import warn - -warn( - """ - The stripe.api_resources.margin package is deprecated, please change your - imports to import from stripe directly. - From: - from stripe.api_resources.margin import Margin - To: - from stripe import Margin - """, - DeprecationWarning, - stacklevel=2, -) -if not TYPE_CHECKING: - from stripe._margin import ( # noqa - Margin, - )