diff --git a/.stats.yml b/.stats.yml index ae59be0a..8070692c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0dbb8ba730f755468357ebda41332664e8396faf29a6a6a64ad37cf35cf70d0c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-43a4d1d907fd25faa99fef58ba7afb3dd39fae36f955b29bfe27b4bfdaa0ee54.yml diff --git a/src/orb/types/events/backfill_close_response.py b/src/orb/types/events/backfill_close_response.py index 14fd9974..058edebe 100644 --- a/src/orb/types/events/backfill_close_response.py +++ b/src/orb/types/events/backfill_close_response.py @@ -29,6 +29,13 @@ class BackfillCloseResponse(BaseModel): events_ingested: int """The number of events ingested in this backfill.""" + replace_existing_events: bool + """ + If `true`, existing events in the backfill's timeframe will be replaced with the + newly ingested events associated with the backfill. If `false`, newly ingested + events will be added to the existing events. + """ + reverted_at: Optional[datetime] = None """The time at which this backfill was reverted.""" diff --git a/src/orb/types/events/backfill_create_response.py b/src/orb/types/events/backfill_create_response.py index 1a23d5f1..90e185d5 100644 --- a/src/orb/types/events/backfill_create_response.py +++ b/src/orb/types/events/backfill_create_response.py @@ -29,6 +29,13 @@ class BackfillCreateResponse(BaseModel): events_ingested: int """The number of events ingested in this backfill.""" + replace_existing_events: bool + """ + If `true`, existing events in the backfill's timeframe will be replaced with the + newly ingested events associated with the backfill. If `false`, newly ingested + events will be added to the existing events. + """ + reverted_at: Optional[datetime] = None """The time at which this backfill was reverted.""" diff --git a/src/orb/types/events/backfill_fetch_response.py b/src/orb/types/events/backfill_fetch_response.py index bd397acc..2c253373 100644 --- a/src/orb/types/events/backfill_fetch_response.py +++ b/src/orb/types/events/backfill_fetch_response.py @@ -29,6 +29,13 @@ class BackfillFetchResponse(BaseModel): events_ingested: int """The number of events ingested in this backfill.""" + replace_existing_events: bool + """ + If `true`, existing events in the backfill's timeframe will be replaced with the + newly ingested events associated with the backfill. If `false`, newly ingested + events will be added to the existing events. + """ + reverted_at: Optional[datetime] = None """The time at which this backfill was reverted.""" diff --git a/src/orb/types/events/backfill_list_response.py b/src/orb/types/events/backfill_list_response.py index 2657d36e..b470ba1f 100644 --- a/src/orb/types/events/backfill_list_response.py +++ b/src/orb/types/events/backfill_list_response.py @@ -29,6 +29,13 @@ class BackfillListResponse(BaseModel): events_ingested: int """The number of events ingested in this backfill.""" + replace_existing_events: bool + """ + If `true`, existing events in the backfill's timeframe will be replaced with the + newly ingested events associated with the backfill. If `false`, newly ingested + events will be added to the existing events. + """ + reverted_at: Optional[datetime] = None """The time at which this backfill was reverted.""" diff --git a/src/orb/types/events/backfill_revert_response.py b/src/orb/types/events/backfill_revert_response.py index 8a3bae07..52ec1314 100644 --- a/src/orb/types/events/backfill_revert_response.py +++ b/src/orb/types/events/backfill_revert_response.py @@ -29,6 +29,13 @@ class BackfillRevertResponse(BaseModel): events_ingested: int """The number of events ingested in this backfill.""" + replace_existing_events: bool + """ + If `true`, existing events in the backfill's timeframe will be replaced with the + newly ingested events associated with the backfill. If `false`, newly ingested + events will be added to the existing events. + """ + reverted_at: Optional[datetime] = None """The time at which this backfill was reverted.""" diff --git a/src/orb/types/invoice.py b/src/orb/types/invoice.py index 7a5f2987..0da763aa 100644 --- a/src/orb/types/invoice.py +++ b/src/orb/types/invoice.py @@ -22,11 +22,11 @@ "CustomerTaxID", "LineItem", "LineItemAdjustment", - "LineItemAdjustmentAmountDiscountAdjustment", - "LineItemAdjustmentPercentageDiscountAdjustment", - "LineItemAdjustmentUsageDiscountAdjustment", - "LineItemAdjustmentMinimumAdjustment", - "LineItemAdjustmentMaximumAdjustment", + "LineItemAdjustmentMonetaryUsageDiscountAdjustment", + "LineItemAdjustmentMonetaryAmountDiscountAdjustment", + "LineItemAdjustmentMonetaryPercentageDiscountAdjustment", + "LineItemAdjustmentMonetaryMinimumAdjustment", + "LineItemAdjustmentMonetaryMaximumAdjustment", "LineItemMaximum", "LineItemMinimum", "LineItemSubLineItem", @@ -325,16 +325,13 @@ class CustomerTaxID(BaseModel): value: str -class LineItemAdjustmentAmountDiscountAdjustment(BaseModel): +class LineItemAdjustmentMonetaryUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] + adjustment_type: Literal["usage_discount"] - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + amount: str + """The value applied by an adjustment.""" applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -345,17 +342,29 @@ class LineItemAdjustmentAmountDiscountAdjustment(BaseModel): that apply to only one price. """ - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class LineItemAdjustmentPercentageDiscountAdjustment(BaseModel): +class LineItemAdjustmentMonetaryAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount: str + """The value applied by an adjustment.""" + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -366,23 +375,17 @@ class LineItemAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - reason: Optional[str] = None """The reason for the adjustment.""" -class LineItemAdjustmentUsageDiscountAdjustment(BaseModel): +class LineItemAdjustmentMonetaryPercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] + + amount: str + """The value applied by an adjustment.""" applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -393,24 +396,24 @@ class LineItemAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class LineItemAdjustmentMinimumAdjustment(BaseModel): +class LineItemAdjustmentMonetaryMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] + amount: str + """The value applied by an adjustment.""" + applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -429,18 +432,18 @@ class LineItemAdjustmentMinimumAdjustment(BaseModel): adjustment applies to. """ - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - reason: Optional[str] = None """The reason for the adjustment.""" -class LineItemAdjustmentMaximumAdjustment(BaseModel): +class LineItemAdjustmentMonetaryMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] + amount: str + """The value applied by an adjustment.""" + applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -456,20 +459,17 @@ class LineItemAdjustmentMaximumAdjustment(BaseModel): adjustment applies to. """ - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - reason: Optional[str] = None """The reason for the adjustment.""" LineItemAdjustment: TypeAlias = Annotated[ Union[ - LineItemAdjustmentAmountDiscountAdjustment, - LineItemAdjustmentPercentageDiscountAdjustment, - LineItemAdjustmentUsageDiscountAdjustment, - LineItemAdjustmentMinimumAdjustment, - LineItemAdjustmentMaximumAdjustment, + LineItemAdjustmentMonetaryUsageDiscountAdjustment, + LineItemAdjustmentMonetaryAmountDiscountAdjustment, + LineItemAdjustmentMonetaryPercentageDiscountAdjustment, + LineItemAdjustmentMonetaryMinimumAdjustment, + LineItemAdjustmentMonetaryMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] @@ -599,18 +599,21 @@ class LineItem(BaseModel): adjusted_subtotal: str """ - The line amount after any adjustments, before overage conversion, credits and + The line amount after any adjustments and before overage conversion, credits and partial invoicing. """ adjustments: List[LineItemAdjustment] - """All adjustments applied to the line item.""" + """All adjustments (ie. maximums, minimums, discounts) applied to the line item.""" amount: str - """The final amount after any discounts or minimums.""" + """ + The final amount for a line item after all adjustments and pre paid credits have + been applied. + """ credits_applied: str - """The number of credits used""" + """The number of prepaid credits applied.""" discount: Optional[Discount] = None @@ -657,6 +660,7 @@ class LineItem(BaseModel): """ quantity: float + """Either the fixed fee quantity or the usage during the service period.""" start_date: datetime """The start date of the range of time applied for this line item's price.""" @@ -668,7 +672,7 @@ class LineItem(BaseModel): """ subtotal: str - """The line amount before any line item-specific discounts or minimums.""" + """The line amount before before any adjustments.""" tax_amounts: List[LineItemTaxAmount] """An array of tax rates and their incurred tax amounts. diff --git a/src/orb/types/invoice_fetch_upcoming_response.py b/src/orb/types/invoice_fetch_upcoming_response.py index bd2310b2..64509902 100644 --- a/src/orb/types/invoice_fetch_upcoming_response.py +++ b/src/orb/types/invoice_fetch_upcoming_response.py @@ -22,11 +22,11 @@ "CustomerTaxID", "LineItem", "LineItemAdjustment", - "LineItemAdjustmentAmountDiscountAdjustment", - "LineItemAdjustmentPercentageDiscountAdjustment", - "LineItemAdjustmentUsageDiscountAdjustment", - "LineItemAdjustmentMinimumAdjustment", - "LineItemAdjustmentMaximumAdjustment", + "LineItemAdjustmentMonetaryUsageDiscountAdjustment", + "LineItemAdjustmentMonetaryAmountDiscountAdjustment", + "LineItemAdjustmentMonetaryPercentageDiscountAdjustment", + "LineItemAdjustmentMonetaryMinimumAdjustment", + "LineItemAdjustmentMonetaryMaximumAdjustment", "LineItemMaximum", "LineItemMinimum", "LineItemSubLineItem", @@ -325,16 +325,13 @@ class CustomerTaxID(BaseModel): value: str -class LineItemAdjustmentAmountDiscountAdjustment(BaseModel): +class LineItemAdjustmentMonetaryUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] + adjustment_type: Literal["usage_discount"] - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + amount: str + """The value applied by an adjustment.""" applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -345,17 +342,29 @@ class LineItemAdjustmentAmountDiscountAdjustment(BaseModel): that apply to only one price. """ - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class LineItemAdjustmentPercentageDiscountAdjustment(BaseModel): +class LineItemAdjustmentMonetaryAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount: str + """The value applied by an adjustment.""" + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -366,23 +375,17 @@ class LineItemAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - reason: Optional[str] = None """The reason for the adjustment.""" -class LineItemAdjustmentUsageDiscountAdjustment(BaseModel): +class LineItemAdjustmentMonetaryPercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] + + amount: str + """The value applied by an adjustment.""" applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -393,24 +396,24 @@ class LineItemAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class LineItemAdjustmentMinimumAdjustment(BaseModel): +class LineItemAdjustmentMonetaryMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] + amount: str + """The value applied by an adjustment.""" + applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -429,18 +432,18 @@ class LineItemAdjustmentMinimumAdjustment(BaseModel): adjustment applies to. """ - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - reason: Optional[str] = None """The reason for the adjustment.""" -class LineItemAdjustmentMaximumAdjustment(BaseModel): +class LineItemAdjustmentMonetaryMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] + amount: str + """The value applied by an adjustment.""" + applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -456,20 +459,17 @@ class LineItemAdjustmentMaximumAdjustment(BaseModel): adjustment applies to. """ - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - reason: Optional[str] = None """The reason for the adjustment.""" LineItemAdjustment: TypeAlias = Annotated[ Union[ - LineItemAdjustmentAmountDiscountAdjustment, - LineItemAdjustmentPercentageDiscountAdjustment, - LineItemAdjustmentUsageDiscountAdjustment, - LineItemAdjustmentMinimumAdjustment, - LineItemAdjustmentMaximumAdjustment, + LineItemAdjustmentMonetaryUsageDiscountAdjustment, + LineItemAdjustmentMonetaryAmountDiscountAdjustment, + LineItemAdjustmentMonetaryPercentageDiscountAdjustment, + LineItemAdjustmentMonetaryMinimumAdjustment, + LineItemAdjustmentMonetaryMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] @@ -599,18 +599,21 @@ class LineItem(BaseModel): adjusted_subtotal: str """ - The line amount after any adjustments, before overage conversion, credits and + The line amount after any adjustments and before overage conversion, credits and partial invoicing. """ adjustments: List[LineItemAdjustment] - """All adjustments applied to the line item.""" + """All adjustments (ie. maximums, minimums, discounts) applied to the line item.""" amount: str - """The final amount after any discounts or minimums.""" + """ + The final amount for a line item after all adjustments and pre paid credits have + been applied. + """ credits_applied: str - """The number of credits used""" + """The number of prepaid credits applied.""" discount: Optional[Discount] = None @@ -657,6 +660,7 @@ class LineItem(BaseModel): """ quantity: float + """Either the fixed fee quantity or the usage during the service period.""" start_date: datetime """The start date of the range of time applied for this line item's price.""" @@ -668,7 +672,7 @@ class LineItem(BaseModel): """ subtotal: str - """The line amount before any line item-specific discounts or minimums.""" + """The line amount before before any adjustments.""" tax_amounts: List[LineItemTaxAmount] """An array of tax rates and their incurred tax amounts. diff --git a/src/orb/types/invoice_line_item_create_response.py b/src/orb/types/invoice_line_item_create_response.py index 4593d8a8..06d85b10 100644 --- a/src/orb/types/invoice_line_item_create_response.py +++ b/src/orb/types/invoice_line_item_create_response.py @@ -12,11 +12,11 @@ __all__ = [ "InvoiceLineItemCreateResponse", "Adjustment", - "AdjustmentAmountDiscountAdjustment", - "AdjustmentPercentageDiscountAdjustment", - "AdjustmentUsageDiscountAdjustment", - "AdjustmentMinimumAdjustment", - "AdjustmentMaximumAdjustment", + "AdjustmentMonetaryUsageDiscountAdjustment", + "AdjustmentMonetaryAmountDiscountAdjustment", + "AdjustmentMonetaryPercentageDiscountAdjustment", + "AdjustmentMonetaryMinimumAdjustment", + "AdjustmentMonetaryMaximumAdjustment", "Maximum", "Minimum", "SubLineItem", @@ -32,16 +32,13 @@ ] -class AdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentMonetaryUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] + adjustment_type: Literal["usage_discount"] - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + amount: str + """The value applied by an adjustment.""" applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -52,17 +49,29 @@ class AdjustmentAmountDiscountAdjustment(BaseModel): that apply to only one price. """ - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentMonetaryAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount: str + """The value applied by an adjustment.""" + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -73,23 +82,17 @@ class AdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - reason: Optional[str] = None """The reason for the adjustment.""" -class AdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentMonetaryPercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] + + amount: str + """The value applied by an adjustment.""" applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -100,24 +103,24 @@ class AdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentMinimumAdjustment(BaseModel): +class AdjustmentMonetaryMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] + amount: str + """The value applied by an adjustment.""" + applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -136,18 +139,18 @@ class AdjustmentMinimumAdjustment(BaseModel): adjustment applies to. """ - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - reason: Optional[str] = None """The reason for the adjustment.""" -class AdjustmentMaximumAdjustment(BaseModel): +class AdjustmentMonetaryMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] + amount: str + """The value applied by an adjustment.""" + applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -163,20 +166,17 @@ class AdjustmentMaximumAdjustment(BaseModel): adjustment applies to. """ - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - reason: Optional[str] = None """The reason for the adjustment.""" Adjustment: TypeAlias = Annotated[ Union[ - AdjustmentAmountDiscountAdjustment, - AdjustmentPercentageDiscountAdjustment, - AdjustmentUsageDiscountAdjustment, - AdjustmentMinimumAdjustment, - AdjustmentMaximumAdjustment, + AdjustmentMonetaryUsageDiscountAdjustment, + AdjustmentMonetaryAmountDiscountAdjustment, + AdjustmentMonetaryPercentageDiscountAdjustment, + AdjustmentMonetaryMinimumAdjustment, + AdjustmentMonetaryMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] @@ -304,18 +304,21 @@ class InvoiceLineItemCreateResponse(BaseModel): adjusted_subtotal: str """ - The line amount after any adjustments, before overage conversion, credits and + The line amount after any adjustments and before overage conversion, credits and partial invoicing. """ adjustments: List[Adjustment] - """All adjustments applied to the line item.""" + """All adjustments (ie. maximums, minimums, discounts) applied to the line item.""" amount: str - """The final amount after any discounts or minimums.""" + """ + The final amount for a line item after all adjustments and pre paid credits have + been applied. + """ credits_applied: str - """The number of credits used""" + """The number of prepaid credits applied.""" discount: Optional[Discount] = None @@ -362,6 +365,7 @@ class InvoiceLineItemCreateResponse(BaseModel): """ quantity: float + """Either the fixed fee quantity or the usage during the service period.""" start_date: datetime """The start date of the range of time applied for this line item's price.""" @@ -373,7 +377,7 @@ class InvoiceLineItemCreateResponse(BaseModel): """ subtotal: str - """The line amount before any line item-specific discounts or minimums.""" + """The line amount before before any adjustments.""" tax_amounts: List[TaxAmount] """An array of tax rates and their incurred tax amounts. diff --git a/src/orb/types/plan.py b/src/orb/types/plan.py index 1f72a913..a4b43d96 100644 --- a/src/orb/types/plan.py +++ b/src/orb/types/plan.py @@ -12,11 +12,11 @@ __all__ = [ "Plan", "Adjustment", - "AdjustmentAmountDiscountAdjustment", - "AdjustmentPercentageDiscountAdjustment", - "AdjustmentUsageDiscountAdjustment", - "AdjustmentMinimumAdjustment", - "AdjustmentMaximumAdjustment", + "AdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentPlanPhaseMaximumAdjustment", "BasePlan", "Maximum", "Minimum", @@ -28,16 +28,10 @@ ] -class AdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + adjustment_type: Literal["usage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -54,11 +48,23 @@ class AdjustmentAmountDiscountAdjustment(BaseModel): reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -69,12 +75,6 @@ class AdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" @@ -82,10 +82,10 @@ class AdjustmentPercentageDiscountAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -96,20 +96,20 @@ class AdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentMinimumAdjustment(BaseModel): +class AdjustmentPlanPhaseMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] @@ -139,7 +139,7 @@ class AdjustmentMinimumAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentMaximumAdjustment(BaseModel): +class AdjustmentPlanPhaseMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] @@ -168,11 +168,11 @@ class AdjustmentMaximumAdjustment(BaseModel): Adjustment: TypeAlias = Annotated[ Union[ - AdjustmentAmountDiscountAdjustment, - AdjustmentPercentageDiscountAdjustment, - AdjustmentUsageDiscountAdjustment, - AdjustmentMinimumAdjustment, - AdjustmentMaximumAdjustment, + AdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentPlanPhaseMinimumAdjustment, + AdjustmentPlanPhaseMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] diff --git a/src/orb/types/subscription.py b/src/orb/types/subscription.py index f6cc403f..6af398ea 100644 --- a/src/orb/types/subscription.py +++ b/src/orb/types/subscription.py @@ -14,11 +14,11 @@ "Subscription", "AdjustmentInterval", "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentMinimumAdjustment", - "AdjustmentIntervalAdjustmentMaximumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", "BillingCycleAnchorConfiguration", "DiscountInterval", "DiscountIntervalAmountDiscountInterval", @@ -34,16 +34,10 @@ ] -class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + adjustment_type: Literal["usage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -60,11 +54,23 @@ class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -75,12 +81,6 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" @@ -88,10 +88,10 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -102,20 +102,20 @@ class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] @@ -145,7 +145,7 @@ class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] @@ -174,11 +174,11 @@ class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): AdjustmentIntervalAdjustment: TypeAlias = Annotated[ Union[ - AdjustmentIntervalAdjustmentAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentMinimumAdjustment, - AdjustmentIntervalAdjustmentMaximumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] diff --git a/src/orb/types/subscription_cancel_response.py b/src/orb/types/subscription_cancel_response.py index ed5c10ac..16d83f53 100644 --- a/src/orb/types/subscription_cancel_response.py +++ b/src/orb/types/subscription_cancel_response.py @@ -14,11 +14,11 @@ "SubscriptionCancelResponse", "AdjustmentInterval", "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentMinimumAdjustment", - "AdjustmentIntervalAdjustmentMaximumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", "BillingCycleAnchorConfiguration", "DiscountInterval", "DiscountIntervalAmountDiscountInterval", @@ -34,16 +34,10 @@ ] -class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + adjustment_type: Literal["usage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -60,11 +54,23 @@ class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -75,12 +81,6 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" @@ -88,10 +88,10 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -102,20 +102,20 @@ class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] @@ -145,7 +145,7 @@ class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] @@ -174,11 +174,11 @@ class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): AdjustmentIntervalAdjustment: TypeAlias = Annotated[ Union[ - AdjustmentIntervalAdjustmentAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentMinimumAdjustment, - AdjustmentIntervalAdjustmentMaximumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] diff --git a/src/orb/types/subscription_create_params.py b/src/orb/types/subscription_create_params.py index 10c0e2c0..a6529dad 100644 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -412,8 +412,7 @@ class AddAdjustment(TypedDict, total=False): """The end date of the adjustment interval. This is the date that the adjustment will stop affecting prices on the - subscription. If null, the adjustment will start when the phase or subscription - starts. + subscription. """ plan_phase_order: Optional[int] diff --git a/src/orb/types/subscription_create_response.py b/src/orb/types/subscription_create_response.py index 89a32e0f..f1aca973 100644 --- a/src/orb/types/subscription_create_response.py +++ b/src/orb/types/subscription_create_response.py @@ -14,11 +14,11 @@ "SubscriptionCreateResponse", "AdjustmentInterval", "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentMinimumAdjustment", - "AdjustmentIntervalAdjustmentMaximumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", "BillingCycleAnchorConfiguration", "DiscountInterval", "DiscountIntervalAmountDiscountInterval", @@ -34,16 +34,10 @@ ] -class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + adjustment_type: Literal["usage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -60,11 +54,23 @@ class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -75,12 +81,6 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" @@ -88,10 +88,10 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -102,20 +102,20 @@ class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] @@ -145,7 +145,7 @@ class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] @@ -174,11 +174,11 @@ class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): AdjustmentIntervalAdjustment: TypeAlias = Annotated[ Union[ - AdjustmentIntervalAdjustmentAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentMinimumAdjustment, - AdjustmentIntervalAdjustmentMaximumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] diff --git a/src/orb/types/subscription_price_intervals_response.py b/src/orb/types/subscription_price_intervals_response.py index d84119bb..37823cba 100644 --- a/src/orb/types/subscription_price_intervals_response.py +++ b/src/orb/types/subscription_price_intervals_response.py @@ -14,11 +14,11 @@ "SubscriptionPriceIntervalsResponse", "AdjustmentInterval", "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentMinimumAdjustment", - "AdjustmentIntervalAdjustmentMaximumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", "BillingCycleAnchorConfiguration", "DiscountInterval", "DiscountIntervalAmountDiscountInterval", @@ -34,16 +34,10 @@ ] -class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + adjustment_type: Literal["usage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -60,11 +54,23 @@ class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -75,12 +81,6 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" @@ -88,10 +88,10 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -102,20 +102,20 @@ class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] @@ -145,7 +145,7 @@ class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] @@ -174,11 +174,11 @@ class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): AdjustmentIntervalAdjustment: TypeAlias = Annotated[ Union[ - AdjustmentIntervalAdjustmentAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentMinimumAdjustment, - AdjustmentIntervalAdjustmentMaximumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index 7bb70108..0b11cc12 100644 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -412,8 +412,7 @@ class AddAdjustment(TypedDict, total=False): """The end date of the adjustment interval. This is the date that the adjustment will stop affecting prices on the - subscription. If null, the adjustment will start when the phase or subscription - starts. + subscription. """ plan_phase_order: Optional[int] diff --git a/src/orb/types/subscription_schedule_plan_change_response.py b/src/orb/types/subscription_schedule_plan_change_response.py index 4b0063b3..bce88950 100644 --- a/src/orb/types/subscription_schedule_plan_change_response.py +++ b/src/orb/types/subscription_schedule_plan_change_response.py @@ -14,11 +14,11 @@ "SubscriptionSchedulePlanChangeResponse", "AdjustmentInterval", "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentMinimumAdjustment", - "AdjustmentIntervalAdjustmentMaximumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", "BillingCycleAnchorConfiguration", "DiscountInterval", "DiscountIntervalAmountDiscountInterval", @@ -34,16 +34,10 @@ ] -class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + adjustment_type: Literal["usage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -60,11 +54,23 @@ class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -75,12 +81,6 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" @@ -88,10 +88,10 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -102,20 +102,20 @@ class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] @@ -145,7 +145,7 @@ class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] @@ -174,11 +174,11 @@ class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): AdjustmentIntervalAdjustment: TypeAlias = Annotated[ Union[ - AdjustmentIntervalAdjustmentAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentMinimumAdjustment, - AdjustmentIntervalAdjustmentMaximumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] diff --git a/src/orb/types/subscription_trigger_phase_response.py b/src/orb/types/subscription_trigger_phase_response.py index 78470558..1389c7db 100644 --- a/src/orb/types/subscription_trigger_phase_response.py +++ b/src/orb/types/subscription_trigger_phase_response.py @@ -14,11 +14,11 @@ "SubscriptionTriggerPhaseResponse", "AdjustmentInterval", "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentMinimumAdjustment", - "AdjustmentIntervalAdjustmentMaximumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", "BillingCycleAnchorConfiguration", "DiscountInterval", "DiscountIntervalAmountDiscountInterval", @@ -34,16 +34,10 @@ ] -class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + adjustment_type: Literal["usage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -60,11 +54,23 @@ class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -75,12 +81,6 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" @@ -88,10 +88,10 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -102,20 +102,20 @@ class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] @@ -145,7 +145,7 @@ class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] @@ -174,11 +174,11 @@ class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): AdjustmentIntervalAdjustment: TypeAlias = Annotated[ Union[ - AdjustmentIntervalAdjustmentAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentMinimumAdjustment, - AdjustmentIntervalAdjustmentMaximumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] diff --git a/src/orb/types/subscription_unschedule_cancellation_response.py b/src/orb/types/subscription_unschedule_cancellation_response.py index 49777bc2..b0f5ffee 100644 --- a/src/orb/types/subscription_unschedule_cancellation_response.py +++ b/src/orb/types/subscription_unschedule_cancellation_response.py @@ -14,11 +14,11 @@ "SubscriptionUnscheduleCancellationResponse", "AdjustmentInterval", "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentMinimumAdjustment", - "AdjustmentIntervalAdjustmentMaximumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", "BillingCycleAnchorConfiguration", "DiscountInterval", "DiscountIntervalAmountDiscountInterval", @@ -34,16 +34,10 @@ ] -class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + adjustment_type: Literal["usage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -60,11 +54,23 @@ class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -75,12 +81,6 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" @@ -88,10 +88,10 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -102,20 +102,20 @@ class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] @@ -145,7 +145,7 @@ class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] @@ -174,11 +174,11 @@ class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): AdjustmentIntervalAdjustment: TypeAlias = Annotated[ Union[ - AdjustmentIntervalAdjustmentAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentMinimumAdjustment, - AdjustmentIntervalAdjustmentMaximumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] diff --git a/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py b/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py index 9472d9e7..589339ca 100644 --- a/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py +++ b/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py @@ -14,11 +14,11 @@ "SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse", "AdjustmentInterval", "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentMinimumAdjustment", - "AdjustmentIntervalAdjustmentMaximumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", "BillingCycleAnchorConfiguration", "DiscountInterval", "DiscountIntervalAmountDiscountInterval", @@ -34,16 +34,10 @@ ] -class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + adjustment_type: Literal["usage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -60,11 +54,23 @@ class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -75,12 +81,6 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" @@ -88,10 +88,10 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -102,20 +102,20 @@ class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] @@ -145,7 +145,7 @@ class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] @@ -174,11 +174,11 @@ class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): AdjustmentIntervalAdjustment: TypeAlias = Annotated[ Union[ - AdjustmentIntervalAdjustmentAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentMinimumAdjustment, - AdjustmentIntervalAdjustmentMaximumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] diff --git a/src/orb/types/subscription_unschedule_pending_plan_changes_response.py b/src/orb/types/subscription_unschedule_pending_plan_changes_response.py index 3b249d81..0e4dc3a1 100644 --- a/src/orb/types/subscription_unschedule_pending_plan_changes_response.py +++ b/src/orb/types/subscription_unschedule_pending_plan_changes_response.py @@ -14,11 +14,11 @@ "SubscriptionUnschedulePendingPlanChangesResponse", "AdjustmentInterval", "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentMinimumAdjustment", - "AdjustmentIntervalAdjustmentMaximumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", "BillingCycleAnchorConfiguration", "DiscountInterval", "DiscountIntervalAmountDiscountInterval", @@ -34,16 +34,10 @@ ] -class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + adjustment_type: Literal["usage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -60,11 +54,23 @@ class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -75,12 +81,6 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" @@ -88,10 +88,10 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -102,20 +102,20 @@ class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] @@ -145,7 +145,7 @@ class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] @@ -174,11 +174,11 @@ class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): AdjustmentIntervalAdjustment: TypeAlias = Annotated[ Union[ - AdjustmentIntervalAdjustmentAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentMinimumAdjustment, - AdjustmentIntervalAdjustmentMaximumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] diff --git a/src/orb/types/subscription_update_fixed_fee_quantity_response.py b/src/orb/types/subscription_update_fixed_fee_quantity_response.py index 4c100c7f..a9209366 100644 --- a/src/orb/types/subscription_update_fixed_fee_quantity_response.py +++ b/src/orb/types/subscription_update_fixed_fee_quantity_response.py @@ -14,11 +14,11 @@ "SubscriptionUpdateFixedFeeQuantityResponse", "AdjustmentInterval", "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentMinimumAdjustment", - "AdjustmentIntervalAdjustmentMaximumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", "BillingCycleAnchorConfiguration", "DiscountInterval", "DiscountIntervalAmountDiscountInterval", @@ -34,16 +34,10 @@ ] -class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + adjustment_type: Literal["usage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -60,11 +54,23 @@ class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -75,12 +81,6 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" @@ -88,10 +88,10 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -102,20 +102,20 @@ class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] @@ -145,7 +145,7 @@ class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] @@ -174,11 +174,11 @@ class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): AdjustmentIntervalAdjustment: TypeAlias = Annotated[ Union[ - AdjustmentIntervalAdjustmentAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentMinimumAdjustment, - AdjustmentIntervalAdjustmentMaximumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ] diff --git a/src/orb/types/subscription_update_trial_response.py b/src/orb/types/subscription_update_trial_response.py index 66dd2cc9..40a211ba 100644 --- a/src/orb/types/subscription_update_trial_response.py +++ b/src/orb/types/subscription_update_trial_response.py @@ -14,11 +14,11 @@ "SubscriptionUpdateTrialResponse", "AdjustmentInterval", "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentMinimumAdjustment", - "AdjustmentIntervalAdjustmentMaximumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", "BillingCycleAnchorConfiguration", "DiscountInterval", "DiscountIntervalAmountDiscountInterval", @@ -34,16 +34,10 @@ ] -class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ + adjustment_type: Literal["usage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -60,11 +54,23 @@ class AdjustmentIntervalAdjustmentAmountDiscountAdjustment(BaseModel): reason: Optional[str] = None """The reason for the adjustment.""" + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + -class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["percentage_discount"] + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -75,12 +81,6 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): that apply to only one price. """ - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" @@ -88,10 +88,10 @@ class AdjustmentIntervalAdjustmentPercentageDiscountAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): id: str - adjustment_type: Literal["usage_discount"] + adjustment_type: Literal["percentage_discount"] applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" @@ -102,20 +102,20 @@ class AdjustmentIntervalAdjustmentUsageDiscountAdjustment(BaseModel): that apply to only one price. """ + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + plan_phase_order: Optional[int] = None """The plan phase in which this adjustment is active.""" reason: Optional[str] = None """The reason for the adjustment.""" - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - -class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): id: str adjustment_type: Literal["minimum"] @@ -145,7 +145,7 @@ class AdjustmentIntervalAdjustmentMinimumAdjustment(BaseModel): """The reason for the adjustment.""" -class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): +class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): id: str adjustment_type: Literal["maximum"] @@ -174,11 +174,11 @@ class AdjustmentIntervalAdjustmentMaximumAdjustment(BaseModel): AdjustmentIntervalAdjustment: TypeAlias = Annotated[ Union[ - AdjustmentIntervalAdjustmentAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentMinimumAdjustment, - AdjustmentIntervalAdjustmentMaximumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, ], PropertyInfo(discriminator="adjustment_type"), ]