diff --git a/README.md b/README.md index 5ddf636d..b9887ec8 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,11 @@ client = Orb( api_key=os.environ.get("ORB_API_KEY"), # This is the default and can be omitted ) -customer_model = client.customers.create( +customer = client.customers.create( email="example-customer@withorb.com", name="My Customer", ) -print(customer_model.id) +print(customer.id) ``` While you can provide an `api_key` keyword argument, @@ -56,11 +56,11 @@ client = AsyncOrb( async def main() -> None: - customer_model = await client.customers.create( + customer = await client.customers.create( email="example-customer@withorb.com", name="My Customer", ) - print(customer_model.id) + print(customer.id) asyncio.run(main()) @@ -151,7 +151,7 @@ from orb import Orb client = Orb() -customer_model = client.customers.create( +customer = client.customers.create( email="example-customer@withorb.com", name="My Customer", billing_address={ @@ -160,7 +160,7 @@ customer_model = client.customers.create( "line1": "123 Example Street", }, ) -print(customer_model.id) +print(customer.id) ``` ## Handling errors diff --git a/api.md b/api.md index 00b079cf..64d14b2f 100644 --- a/api.md +++ b/api.md @@ -6,108 +6,19 @@ from orb.types import ( AddCreditTopUpRequest, AddSubscriptionAdjustmentParams, AddSubscriptionPriceParams, - AddressInputModel, - AddressModel, - AdjustmentIntervalModel, - AdjustmentModel, - AffectedBlockModel, - AggregatedCostModel, - AlertModel, - AllocationModel, AmountDiscount, - AmountDiscountIntervalModel, - AmountDiscountModel, - AutoCollectionModel, - BackfillModel, - BillableMetricModel, - BillableMetricSimpleModel, - BillableMetricTinyModel, - BillingCycleAnchorConfigurationModel, - BillingCycleConfigurationModel, BillingCycleRelativeDate, - BpsConfigModel, - BulkBpsConfigModel, - BulkConfigModel, - CouponModel, - CouponRedemptionModel, CreateCustomerAlertRequest, - CreditLedgerEntriesModel, - CreditLedgerEntryModel, - CreditNoteDiscountModel, - CreditNoteModel, - CreditNoteSummaryModel, - CustomRatingFunctionConfigModel, - CustomerBalanceTransactionModel, - CustomerCostsModel, - CustomerCreditBalancesModel, - CustomerHierarchyConfigModel, - CustomerMinifiedModel, - CustomerModel, - CustomerTaxIDModel, - DimensionalPriceConfigurationModel, - DimensionalPriceGroupModel, Discount, - DiscountModel, - DiscountOverrideModel, - EditCustomerModel, - EditPlanModel, - FixedFeeQuantityScheduleEntryModel, InvoiceLevelDiscount, - InvoiceLevelDiscountModel, - InvoiceLineItemModel, - InvoiceModel, - ItemExternalConnectionModel, - ItemModel, - ItemSlimModel, - MatrixConfigModel, - MatrixValueModel, - MatrixWithAllocationConfigModel, - MaximumIntervalModel, - MaximumModel, - MinimumIntervalModel, - MinimumModel, - MutatedSubscriptionModel, - NewAccountingSyncConfigurationModel, - NewAdjustmentModel, - NewAllocationPriceModel, - NewBillingCycleConfigurationModel, - NewFloatingPriceModel, - NewReportingConfigurationModel, - NewSubscriptionPriceModel, - NewTaxConfigurationModel, - PackageConfigModel, PaginationMetadata, - PaginationMetadataModel, - PaymentAttemptModel, PercentageDiscount, - PercentageDiscountIntervalModel, - PercentageDiscountModel, - PlanMinifiedModel, - PlanModel, - PriceIntervalFixedFeeQuantityTransitionModel, - PriceIntervalModel, - PriceModel, RemoveSubscriptionAdjustmentParams, RemoveSubscriptionPriceParams, ReplaceSubscriptionAdjustmentParams, ReplaceSubscriptionPriceParams, - SubLineItemGroupingModel, - SubscriptionMinifiedModel, - SubscriptionModel, - SubscriptionTrialInfoModel, - SubscriptionsModel, - TaxAmountModel, - ThresholdModel, - TieredBpsConfigModel, - TieredConfigModel, - TopUpModel, - TopUpsModel, TrialDiscount, - TrialDiscountModel, - UnitConfigModel, UpdatePriceRequestParams, - UsageDiscountIntervalModel, - UsageModel, ) ``` @@ -133,16 +44,16 @@ from orb.types import Coupon Methods: -- client.coupons.create(\*\*params) -> CouponModel -- client.coupons.list(\*\*params) -> SyncPage[CouponModel] -- client.coupons.archive(coupon_id) -> CouponModel -- client.coupons.fetch(coupon_id) -> CouponModel +- client.coupons.create(\*\*params) -> Coupon +- client.coupons.list(\*\*params) -> SyncPage[Coupon] +- client.coupons.archive(coupon_id) -> Coupon +- client.coupons.fetch(coupon_id) -> Coupon ## Subscriptions Methods: -- client.coupons.subscriptions.list(coupon_id, \*\*params) -> SyncPage[SubscriptionModel] +- client.coupons.subscriptions.list(coupon_id, \*\*params) -> SyncPage[Subscription] # CreditNotes @@ -154,9 +65,9 @@ from orb.types import CreditNote Methods: -- client.credit_notes.create(\*\*params) -> CreditNoteModel -- client.credit_notes.list(\*\*params) -> SyncPage[CreditNoteModel] -- client.credit_notes.fetch(credit_note_id) -> CreditNoteModel +- client.credit_notes.create(\*\*params) -> CreditNote +- client.credit_notes.list(\*\*params) -> SyncPage[CreditNote] +- client.credit_notes.fetch(credit_note_id) -> CreditNote # Customers @@ -168,56 +79,96 @@ from orb.types import Customer Methods: -- client.customers.create(\*\*params) -> CustomerModel -- client.customers.update(customer_id, \*\*params) -> CustomerModel -- client.customers.list(\*\*params) -> SyncPage[CustomerModel] +- client.customers.create(\*\*params) -> Customer +- client.customers.update(customer_id, \*\*params) -> Customer +- client.customers.list(\*\*params) -> SyncPage[Customer] - client.customers.delete(customer_id) -> None -- client.customers.fetch(customer_id) -> CustomerModel -- client.customers.fetch_by_external_id(external_customer_id) -> CustomerModel +- client.customers.fetch(customer_id) -> Customer +- client.customers.fetch_by_external_id(external_customer_id) -> Customer - client.customers.sync_payment_methods_from_gateway(external_customer_id) -> None - client.customers.sync_payment_methods_from_gateway_by_external_customer_id(customer_id) -> None -- client.customers.update_by_external_id(id, \*\*params) -> CustomerModel +- client.customers.update_by_external_id(id, \*\*params) -> Customer ## Costs +Types: + +```python +from orb.types.customers import CostListResponse, CostListByExternalIDResponse +``` + Methods: -- client.customers.costs.list(customer_id, \*\*params) -> CustomerCostsModel -- client.customers.costs.list_by_external_id(external_customer_id, \*\*params) -> CustomerCostsModel +- client.customers.costs.list(customer_id, \*\*params) -> CostListResponse +- client.customers.costs.list_by_external_id(external_customer_id, \*\*params) -> CostListByExternalIDResponse ## Credits +Types: + +```python +from orb.types.customers import CreditListResponse, CreditListByExternalIDResponse +``` + Methods: -- client.customers.credits.list(customer_id, \*\*params) -> SyncPage[Data] -- client.customers.credits.list_by_external_id(external_customer_id, \*\*params) -> SyncPage[Data] +- client.customers.credits.list(customer_id, \*\*params) -> SyncPage[CreditListResponse] +- client.customers.credits.list_by_external_id(external_customer_id, \*\*params) -> SyncPage[CreditListByExternalIDResponse] ### Ledger +Types: + +```python +from orb.types.customers.credits import ( + LedgerListResponse, + LedgerCreateEntryResponse, + LedgerCreateEntryByExternalIDResponse, + LedgerListByExternalIDResponse, +) +``` + Methods: -- client.customers.credits.ledger.list(customer_id, \*\*params) -> SyncPage[CreditLedgerEntryModel] -- client.customers.credits.ledger.create_entry(customer_id, \*\*params) -> CreditLedgerEntryModel -- client.customers.credits.ledger.create_entry_by_external_id(external_customer_id, \*\*params) -> CreditLedgerEntryModel -- client.customers.credits.ledger.list_by_external_id(external_customer_id, \*\*params) -> SyncPage[CreditLedgerEntryModel] +- client.customers.credits.ledger.list(customer_id, \*\*params) -> SyncPage[LedgerListResponse] +- client.customers.credits.ledger.create_entry(customer_id, \*\*params) -> LedgerCreateEntryResponse +- client.customers.credits.ledger.create_entry_by_external_id(external_customer_id, \*\*params) -> LedgerCreateEntryByExternalIDResponse +- client.customers.credits.ledger.list_by_external_id(external_customer_id, \*\*params) -> SyncPage[LedgerListByExternalIDResponse] ### TopUps +Types: + +```python +from orb.types.customers.credits import ( + TopUpCreateResponse, + TopUpListResponse, + TopUpCreateByExternalIDResponse, + TopUpListByExternalIDResponse, +) +``` + Methods: -- client.customers.credits.top_ups.create(customer_id, \*\*params) -> TopUpModel -- client.customers.credits.top_ups.list(customer_id, \*\*params) -> SyncPage[TopUpModel] +- client.customers.credits.top_ups.create(customer_id, \*\*params) -> TopUpCreateResponse +- client.customers.credits.top_ups.list(customer_id, \*\*params) -> SyncPage[TopUpListResponse] - client.customers.credits.top_ups.delete(top_up_id, \*, customer_id) -> None -- client.customers.credits.top_ups.create_by_external_id(external_customer_id, \*\*params) -> TopUpModel +- client.customers.credits.top_ups.create_by_external_id(external_customer_id, \*\*params) -> TopUpCreateByExternalIDResponse - client.customers.credits.top_ups.delete_by_external_id(top_up_id, \*, external_customer_id) -> None -- client.customers.credits.top_ups.list_by_external_id(external_customer_id, \*\*params) -> SyncPage[TopUpModel] +- client.customers.credits.top_ups.list_by_external_id(external_customer_id, \*\*params) -> SyncPage[TopUpListByExternalIDResponse] ## BalanceTransactions +Types: + +```python +from orb.types.customers import BalanceTransactionCreateResponse, BalanceTransactionListResponse +``` + Methods: -- client.customers.balance_transactions.create(customer_id, \*\*params) -> CustomerBalanceTransactionModel -- client.customers.balance_transactions.list(customer_id, \*\*params) -> SyncPage[CustomerBalanceTransactionModel] +- client.customers.balance_transactions.create(customer_id, \*\*params) -> BalanceTransactionCreateResponse +- client.customers.balance_transactions.list(customer_id, \*\*params) -> SyncPage[BalanceTransactionListResponse] # Events @@ -241,13 +192,25 @@ Methods: ## Backfills +Types: + +```python +from orb.types.events import ( + BackfillCreateResponse, + BackfillListResponse, + BackfillCloseResponse, + BackfillFetchResponse, + BackfillRevertResponse, +) +``` + Methods: -- client.events.backfills.create(\*\*params) -> BackfillModel -- client.events.backfills.list(\*\*params) -> SyncPage[BackfillModel] -- client.events.backfills.close(backfill_id) -> BackfillModel -- client.events.backfills.fetch(backfill_id) -> BackfillModel -- client.events.backfills.revert(backfill_id) -> BackfillModel +- client.events.backfills.create(\*\*params) -> BackfillCreateResponse +- client.events.backfills.list(\*\*params) -> SyncPage[BackfillListResponse] +- client.events.backfills.close(backfill_id) -> BackfillCloseResponse +- client.events.backfills.fetch(backfill_id) -> BackfillFetchResponse +- client.events.backfills.revert(backfill_id) -> BackfillRevertResponse ## Volume @@ -263,9 +226,15 @@ Methods: # InvoiceLineItems +Types: + +```python +from orb.types import InvoiceLineItemCreateResponse +``` + Methods: -- client.invoice_line_items.create(\*\*params) -> InvoiceLineItemModel +- client.invoice_line_items.create(\*\*params) -> InvoiceLineItemCreateResponse # Invoices @@ -277,15 +246,15 @@ from orb.types import Invoice, InvoiceFetchUpcomingResponse Methods: -- client.invoices.create(\*\*params) -> InvoiceModel -- client.invoices.update(invoice_id, \*\*params) -> InvoiceModel -- client.invoices.list(\*\*params) -> SyncPage[InvoiceModel] -- client.invoices.fetch(invoice_id) -> InvoiceModel +- client.invoices.create(\*\*params) -> Invoice +- client.invoices.update(invoice_id, \*\*params) -> Invoice +- client.invoices.list(\*\*params) -> SyncPage[Invoice] +- client.invoices.fetch(invoice_id) -> Invoice - client.invoices.fetch_upcoming(\*\*params) -> InvoiceFetchUpcomingResponse -- client.invoices.issue(invoice_id, \*\*params) -> InvoiceModel -- client.invoices.mark_paid(invoice_id, \*\*params) -> InvoiceModel -- client.invoices.pay(invoice_id) -> InvoiceModel -- client.invoices.void(invoice_id) -> InvoiceModel +- client.invoices.issue(invoice_id, \*\*params) -> Invoice +- client.invoices.mark_paid(invoice_id, \*\*params) -> Invoice +- client.invoices.pay(invoice_id) -> Invoice +- client.invoices.void(invoice_id) -> Invoice # Items @@ -297,10 +266,10 @@ from orb.types import Item Methods: -- client.items.create(\*\*params) -> ItemModel -- client.items.update(item_id, \*\*params) -> ItemModel -- client.items.list(\*\*params) -> SyncPage[ItemModel] -- client.items.fetch(item_id) -> ItemModel +- client.items.create(\*\*params) -> Item +- client.items.update(item_id, \*\*params) -> Item +- client.items.list(\*\*params) -> SyncPage[Item] +- client.items.fetch(item_id) -> Item # Metrics @@ -312,10 +281,10 @@ from orb.types import BillableMetric Methods: -- client.metrics.create(\*\*params) -> BillableMetricModel -- client.metrics.update(metric_id, \*\*params) -> BillableMetricModel -- client.metrics.list(\*\*params) -> SyncPage[BillableMetricModel] -- client.metrics.fetch(metric_id) -> BillableMetricModel +- client.metrics.create(\*\*params) -> BillableMetric +- client.metrics.update(metric_id, \*\*params) -> BillableMetric +- client.metrics.list(\*\*params) -> SyncPage[BillableMetric] +- client.metrics.fetch(metric_id) -> BillableMetric # Plans @@ -327,17 +296,17 @@ from orb.types import Plan Methods: -- client.plans.create(\*\*params) -> PlanModel -- client.plans.update(plan_id, \*\*params) -> PlanModel -- client.plans.list(\*\*params) -> SyncPage[PlanModel] -- client.plans.fetch(plan_id) -> PlanModel +- client.plans.create(\*\*params) -> Plan +- client.plans.update(plan_id, \*\*params) -> Plan +- client.plans.list(\*\*params) -> SyncPage[Plan] +- client.plans.fetch(plan_id) -> Plan ## ExternalPlanID Methods: -- client.plans.external_plan_id.update(other_external_plan_id, \*\*params) -> PlanModel -- client.plans.external_plan_id.fetch(external_plan_id) -> PlanModel +- client.plans.external_plan_id.update(other_external_plan_id, \*\*params) -> Plan +- client.plans.external_plan_id.fetch(external_plan_id) -> Plan # Prices @@ -349,18 +318,18 @@ from orb.types import EvaluatePriceGroup, Price, PriceEvaluateResponse Methods: -- client.prices.create(\*\*params) -> PriceModel -- client.prices.update(price_id, \*\*params) -> PriceModel -- client.prices.list(\*\*params) -> SyncPage[PriceModel] +- client.prices.create(\*\*params) -> Price +- client.prices.update(price_id, \*\*params) -> Price +- client.prices.list(\*\*params) -> SyncPage[Price] - client.prices.evaluate(price_id, \*\*params) -> PriceEvaluateResponse -- client.prices.fetch(price_id) -> PriceModel +- client.prices.fetch(price_id) -> Price ## ExternalPriceID Methods: -- client.prices.external_price_id.update(external_price_id, \*\*params) -> PriceModel -- client.prices.external_price_id.fetch(external_price_id) -> PriceModel +- client.prices.external_price_id.update(external_price_id, \*\*params) -> Price +- client.prices.external_price_id.fetch(external_price_id) -> Price # Subscriptions @@ -371,29 +340,39 @@ from orb.types import ( Subscription, SubscriptionUsage, Subscriptions, + SubscriptionCreateResponse, + SubscriptionCancelResponse, SubscriptionFetchCostsResponse, SubscriptionFetchScheduleResponse, + SubscriptionPriceIntervalsResponse, + SubscriptionSchedulePlanChangeResponse, + SubscriptionTriggerPhaseResponse, + SubscriptionUnscheduleCancellationResponse, + SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, + SubscriptionUnschedulePendingPlanChangesResponse, + SubscriptionUpdateFixedFeeQuantityResponse, + SubscriptionUpdateTrialResponse, ) ``` Methods: -- client.subscriptions.create(\*\*params) -> MutatedSubscriptionModel -- client.subscriptions.update(subscription_id, \*\*params) -> SubscriptionModel -- client.subscriptions.list(\*\*params) -> SyncPage[SubscriptionModel] -- client.subscriptions.cancel(subscription_id, \*\*params) -> MutatedSubscriptionModel -- client.subscriptions.fetch(subscription_id) -> SubscriptionModel +- client.subscriptions.create(\*\*params) -> SubscriptionCreateResponse +- client.subscriptions.update(subscription_id, \*\*params) -> Subscription +- client.subscriptions.list(\*\*params) -> SyncPage[Subscription] +- client.subscriptions.cancel(subscription_id, \*\*params) -> SubscriptionCancelResponse +- client.subscriptions.fetch(subscription_id) -> Subscription - client.subscriptions.fetch_costs(subscription_id, \*\*params) -> SubscriptionFetchCostsResponse - client.subscriptions.fetch_schedule(subscription_id, \*\*params) -> SyncPage[SubscriptionFetchScheduleResponse] - client.subscriptions.fetch_usage(subscription_id, \*\*params) -> SubscriptionUsage -- client.subscriptions.price_intervals(subscription_id, \*\*params) -> MutatedSubscriptionModel -- client.subscriptions.schedule_plan_change(subscription_id, \*\*params) -> MutatedSubscriptionModel -- client.subscriptions.trigger_phase(subscription_id, \*\*params) -> MutatedSubscriptionModel -- client.subscriptions.unschedule_cancellation(subscription_id) -> MutatedSubscriptionModel -- client.subscriptions.unschedule_fixed_fee_quantity_updates(subscription_id, \*\*params) -> MutatedSubscriptionModel -- client.subscriptions.unschedule_pending_plan_changes(subscription_id) -> MutatedSubscriptionModel -- client.subscriptions.update_fixed_fee_quantity(subscription_id, \*\*params) -> MutatedSubscriptionModel -- client.subscriptions.update_trial(subscription_id, \*\*params) -> MutatedSubscriptionModel +- client.subscriptions.price_intervals(subscription_id, \*\*params) -> SubscriptionPriceIntervalsResponse +- client.subscriptions.schedule_plan_change(subscription_id, \*\*params) -> SubscriptionSchedulePlanChangeResponse +- client.subscriptions.trigger_phase(subscription_id, \*\*params) -> SubscriptionTriggerPhaseResponse +- client.subscriptions.unschedule_cancellation(subscription_id) -> SubscriptionUnscheduleCancellationResponse +- client.subscriptions.unschedule_fixed_fee_quantity_updates(subscription_id, \*\*params) -> SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse +- client.subscriptions.unschedule_pending_plan_changes(subscription_id) -> SubscriptionUnschedulePendingPlanChangesResponse +- client.subscriptions.update_fixed_fee_quantity(subscription_id, \*\*params) -> SubscriptionUpdateFixedFeeQuantityResponse +- client.subscriptions.update_trial(subscription_id, \*\*params) -> SubscriptionUpdateTrialResponse # Alerts @@ -405,14 +384,14 @@ from orb.types import Alert Methods: -- client.alerts.retrieve(alert_id) -> AlertModel -- client.alerts.update(alert_configuration_id, \*\*params) -> AlertModel -- client.alerts.list(\*\*params) -> SyncPage[AlertModel] -- client.alerts.create_for_customer(customer_id, \*\*params) -> AlertModel -- client.alerts.create_for_external_customer(external_customer_id, \*\*params) -> AlertModel -- client.alerts.create_for_subscription(subscription_id, \*\*params) -> AlertModel -- client.alerts.disable(alert_configuration_id, \*\*params) -> AlertModel -- client.alerts.enable(alert_configuration_id, \*\*params) -> AlertModel +- client.alerts.retrieve(alert_id) -> Alert +- client.alerts.update(alert_configuration_id, \*\*params) -> Alert +- client.alerts.list(\*\*params) -> SyncPage[Alert] +- client.alerts.create_for_customer(customer_id, \*\*params) -> Alert +- client.alerts.create_for_external_customer(external_customer_id, \*\*params) -> Alert +- client.alerts.create_for_subscription(subscription_id, \*\*params) -> Alert +- client.alerts.disable(alert_configuration_id, \*\*params) -> Alert +- client.alerts.enable(alert_configuration_id, \*\*params) -> Alert # DimensionalPriceGroups @@ -424,12 +403,12 @@ from orb.types import DimensionalPriceGroup, DimensionalPriceGroups Methods: -- client.dimensional_price_groups.create(\*\*params) -> DimensionalPriceGroupModel -- client.dimensional_price_groups.retrieve(dimensional_price_group_id) -> DimensionalPriceGroupModel -- client.dimensional_price_groups.list(\*\*params) -> SyncPage[DimensionalPriceGroupModel] +- client.dimensional_price_groups.create(\*\*params) -> DimensionalPriceGroup +- client.dimensional_price_groups.retrieve(dimensional_price_group_id) -> DimensionalPriceGroup +- client.dimensional_price_groups.list(\*\*params) -> SyncPage[DimensionalPriceGroup] ## ExternalDimensionalPriceGroupID Methods: -- client.dimensional_price_groups.external_dimensional_price_group_id.retrieve(external_dimensional_price_group_id) -> DimensionalPriceGroupModel +- client.dimensional_price_groups.external_dimensional_price_group_id.retrieve(external_dimensional_price_group_id) -> DimensionalPriceGroup diff --git a/src/orb/resources/alerts.py b/src/orb/resources/alerts.py index 38c61310..4a38058d 100644 --- a/src/orb/resources/alerts.py +++ b/src/orb/resources/alerts.py @@ -27,9 +27,8 @@ from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage +from ..types.alert import Alert from .._base_client import AsyncPaginator, make_request_options -from ..types.shared.alert_model import AlertModel -from ..types.shared_params.threshold_model import ThresholdModel __all__ = ["Alerts", "AsyncAlerts"] @@ -64,7 +63,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AlertModel: + ) -> Alert: """ This endpoint retrieves an alert by its ID. @@ -84,14 +83,14 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=AlertModel, + cast_to=Alert, ) def update( self, alert_configuration_id: str, *, - thresholds: Iterable[ThresholdModel], + thresholds: Iterable[alert_update_params.Threshold], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -99,7 +98,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> AlertModel: + ) -> Alert: """ This endpoint updates the thresholds of an alert. @@ -130,7 +129,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=AlertModel, + cast_to=Alert, ) def list( @@ -151,7 +150,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[AlertModel]: + ) -> SyncPage[Alert]: """ This endpoint returns a list of alerts within Orb. @@ -187,7 +186,7 @@ def list( """ return self._get_api_list( "/alerts", - page=SyncPage[AlertModel], + page=SyncPage[Alert], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -208,7 +207,7 @@ def list( alert_list_params.AlertListParams, ), ), - model=AlertModel, + model=Alert, ) def create_for_customer( @@ -223,7 +222,7 @@ def create_for_customer( "credit_balance_dropped", "credit_balance_recovered", ], - thresholds: Optional[Iterable[ThresholdModel]] | NotGiven = NOT_GIVEN, + thresholds: Optional[Iterable[alert_create_for_customer_params.Threshold]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -231,7 +230,7 @@ def create_for_customer( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> AlertModel: + ) -> Alert: """This endpoint creates a new alert to monitor a customer's credit balance. There @@ -279,7 +278,7 @@ def create_for_customer( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=AlertModel, + cast_to=Alert, ) def create_for_external_customer( @@ -294,7 +293,7 @@ def create_for_external_customer( "credit_balance_dropped", "credit_balance_recovered", ], - thresholds: Optional[Iterable[ThresholdModel]] | NotGiven = NOT_GIVEN, + thresholds: Optional[Iterable[alert_create_for_external_customer_params.Threshold]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -302,7 +301,7 @@ def create_for_external_customer( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> AlertModel: + ) -> Alert: """This endpoint creates a new alert to monitor a customer's credit balance. There @@ -352,14 +351,14 @@ def create_for_external_customer( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=AlertModel, + cast_to=Alert, ) def create_for_subscription( self, subscription_id: str, *, - thresholds: Iterable[ThresholdModel], + thresholds: Iterable[alert_create_for_subscription_params.Threshold], type: Literal[ "usage_exceeded", "cost_exceeded", @@ -375,7 +374,7 @@ def create_for_subscription( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> AlertModel: + ) -> Alert: """ This endpoint is used to create alerts at the subscription level. @@ -425,7 +424,7 @@ def create_for_subscription( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=AlertModel, + cast_to=Alert, ) def disable( @@ -440,7 +439,7 @@ def disable( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> AlertModel: + ) -> Alert: """This endpoint allows you to disable an alert. To disable a plan-level alert for @@ -474,7 +473,7 @@ def disable( idempotency_key=idempotency_key, query=maybe_transform({"subscription_id": subscription_id}, alert_disable_params.AlertDisableParams), ), - cast_to=AlertModel, + cast_to=Alert, ) def enable( @@ -489,7 +488,7 @@ def enable( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> AlertModel: + ) -> Alert: """This endpoint allows you to enable an alert. To enable a plan-level alert for a @@ -523,7 +522,7 @@ def enable( idempotency_key=idempotency_key, query=maybe_transform({"subscription_id": subscription_id}, alert_enable_params.AlertEnableParams), ), - cast_to=AlertModel, + cast_to=Alert, ) @@ -557,7 +556,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AlertModel: + ) -> Alert: """ This endpoint retrieves an alert by its ID. @@ -577,14 +576,14 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=AlertModel, + cast_to=Alert, ) async def update( self, alert_configuration_id: str, *, - thresholds: Iterable[ThresholdModel], + thresholds: Iterable[alert_update_params.Threshold], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -592,7 +591,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> AlertModel: + ) -> Alert: """ This endpoint updates the thresholds of an alert. @@ -623,7 +622,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=AlertModel, + cast_to=Alert, ) def list( @@ -644,7 +643,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AlertModel, AsyncPage[AlertModel]]: + ) -> AsyncPaginator[Alert, AsyncPage[Alert]]: """ This endpoint returns a list of alerts within Orb. @@ -680,7 +679,7 @@ def list( """ return self._get_api_list( "/alerts", - page=AsyncPage[AlertModel], + page=AsyncPage[Alert], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -701,7 +700,7 @@ def list( alert_list_params.AlertListParams, ), ), - model=AlertModel, + model=Alert, ) async def create_for_customer( @@ -716,7 +715,7 @@ async def create_for_customer( "credit_balance_dropped", "credit_balance_recovered", ], - thresholds: Optional[Iterable[ThresholdModel]] | NotGiven = NOT_GIVEN, + thresholds: Optional[Iterable[alert_create_for_customer_params.Threshold]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -724,7 +723,7 @@ async def create_for_customer( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> AlertModel: + ) -> Alert: """This endpoint creates a new alert to monitor a customer's credit balance. There @@ -772,7 +771,7 @@ async def create_for_customer( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=AlertModel, + cast_to=Alert, ) async def create_for_external_customer( @@ -787,7 +786,7 @@ async def create_for_external_customer( "credit_balance_dropped", "credit_balance_recovered", ], - thresholds: Optional[Iterable[ThresholdModel]] | NotGiven = NOT_GIVEN, + thresholds: Optional[Iterable[alert_create_for_external_customer_params.Threshold]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -795,7 +794,7 @@ async def create_for_external_customer( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> AlertModel: + ) -> Alert: """This endpoint creates a new alert to monitor a customer's credit balance. There @@ -845,14 +844,14 @@ async def create_for_external_customer( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=AlertModel, + cast_to=Alert, ) async def create_for_subscription( self, subscription_id: str, *, - thresholds: Iterable[ThresholdModel], + thresholds: Iterable[alert_create_for_subscription_params.Threshold], type: Literal[ "usage_exceeded", "cost_exceeded", @@ -868,7 +867,7 @@ async def create_for_subscription( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> AlertModel: + ) -> Alert: """ This endpoint is used to create alerts at the subscription level. @@ -918,7 +917,7 @@ async def create_for_subscription( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=AlertModel, + cast_to=Alert, ) async def disable( @@ -933,7 +932,7 @@ async def disable( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> AlertModel: + ) -> Alert: """This endpoint allows you to disable an alert. To disable a plan-level alert for @@ -969,7 +968,7 @@ async def disable( {"subscription_id": subscription_id}, alert_disable_params.AlertDisableParams ), ), - cast_to=AlertModel, + cast_to=Alert, ) async def enable( @@ -984,7 +983,7 @@ async def enable( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> AlertModel: + ) -> Alert: """This endpoint allows you to enable an alert. To enable a plan-level alert for a @@ -1020,7 +1019,7 @@ async def enable( {"subscription_id": subscription_id}, alert_enable_params.AlertEnableParams ), ), - cast_to=AlertModel, + cast_to=Alert, ) diff --git a/src/orb/resources/coupons/coupons.py b/src/orb/resources/coupons/coupons.py index 2a972137..3deb9fce 100644 --- a/src/orb/resources/coupons/coupons.py +++ b/src/orb/resources/coupons/coupons.py @@ -26,7 +26,7 @@ AsyncSubscriptionsWithStreamingResponse, ) from ..._base_client import AsyncPaginator, make_request_options -from ...types.shared.coupon_model import CouponModel +from ...types.coupon import Coupon __all__ = ["Coupons", "AsyncCoupons"] @@ -69,7 +69,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CouponModel: + ) -> Coupon: """ This endpoint allows the creation of coupons, which can then be redeemed at subscription creation or plan change. @@ -111,7 +111,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CouponModel, + cast_to=Coupon, ) def list( @@ -127,7 +127,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[CouponModel]: + ) -> SyncPage[Coupon]: """ This endpoint returns a list of all coupons for an account in a list format. @@ -157,7 +157,7 @@ def list( """ return self._get_api_list( "/coupons", - page=SyncPage[CouponModel], + page=SyncPage[Coupon], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -173,7 +173,7 @@ def list( coupon_list_params.CouponListParams, ), ), - model=CouponModel, + model=Coupon, ) def archive( @@ -187,7 +187,7 @@ def archive( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CouponModel: + ) -> Coupon: """This endpoint allows a coupon to be archived. Archived coupons can no longer be @@ -216,7 +216,7 @@ def archive( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CouponModel, + cast_to=Coupon, ) def fetch( @@ -229,7 +229,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CouponModel: + ) -> Coupon: """This endpoint retrieves a coupon by its ID. To fetch coupons by their redemption @@ -252,7 +252,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CouponModel, + cast_to=Coupon, ) @@ -294,7 +294,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CouponModel: + ) -> Coupon: """ This endpoint allows the creation of coupons, which can then be redeemed at subscription creation or plan change. @@ -336,7 +336,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CouponModel, + cast_to=Coupon, ) def list( @@ -352,7 +352,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[CouponModel, AsyncPage[CouponModel]]: + ) -> AsyncPaginator[Coupon, AsyncPage[Coupon]]: """ This endpoint returns a list of all coupons for an account in a list format. @@ -382,7 +382,7 @@ def list( """ return self._get_api_list( "/coupons", - page=AsyncPage[CouponModel], + page=AsyncPage[Coupon], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -398,7 +398,7 @@ def list( coupon_list_params.CouponListParams, ), ), - model=CouponModel, + model=Coupon, ) async def archive( @@ -412,7 +412,7 @@ async def archive( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CouponModel: + ) -> Coupon: """This endpoint allows a coupon to be archived. Archived coupons can no longer be @@ -441,7 +441,7 @@ async def archive( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CouponModel, + cast_to=Coupon, ) async def fetch( @@ -454,7 +454,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CouponModel: + ) -> Coupon: """This endpoint retrieves a coupon by its ID. To fetch coupons by their redemption @@ -477,7 +477,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CouponModel, + cast_to=Coupon, ) diff --git a/src/orb/resources/coupons/subscriptions.py b/src/orb/resources/coupons/subscriptions.py index af3e0133..442fe33d 100644 --- a/src/orb/resources/coupons/subscriptions.py +++ b/src/orb/resources/coupons/subscriptions.py @@ -15,7 +15,7 @@ from ...pagination import SyncPage, AsyncPage from ..._base_client import AsyncPaginator, make_request_options from ...types.coupons import subscription_list_params -from ...types.shared.subscription_model import SubscriptionModel +from ...types.subscription import Subscription __all__ = ["Subscriptions", "AsyncSubscriptions"] @@ -52,7 +52,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[SubscriptionModel]: + ) -> SyncPage[Subscription]: """ This endpoint returns a list of all subscriptions that have redeemed a given coupon as a [paginated](/api-reference/pagination) list, ordered starting from @@ -77,7 +77,7 @@ def list( raise ValueError(f"Expected a non-empty value for `coupon_id` but received {coupon_id!r}") return self._get_api_list( f"/coupons/{coupon_id}/subscriptions", - page=SyncPage[SubscriptionModel], + page=SyncPage[Subscription], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -91,7 +91,7 @@ def list( subscription_list_params.SubscriptionListParams, ), ), - model=SubscriptionModel, + model=Subscription, ) @@ -127,7 +127,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[SubscriptionModel, AsyncPage[SubscriptionModel]]: + ) -> AsyncPaginator[Subscription, AsyncPage[Subscription]]: """ This endpoint returns a list of all subscriptions that have redeemed a given coupon as a [paginated](/api-reference/pagination) list, ordered starting from @@ -152,7 +152,7 @@ def list( raise ValueError(f"Expected a non-empty value for `coupon_id` but received {coupon_id!r}") return self._get_api_list( f"/coupons/{coupon_id}/subscriptions", - page=AsyncPage[SubscriptionModel], + page=AsyncPage[Subscription], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -166,7 +166,7 @@ def list( subscription_list_params.SubscriptionListParams, ), ), - model=SubscriptionModel, + model=Subscription, ) diff --git a/src/orb/resources/credit_notes.py b/src/orb/resources/credit_notes.py index 88cbad35..cba989c3 100644 --- a/src/orb/resources/credit_notes.py +++ b/src/orb/resources/credit_notes.py @@ -19,7 +19,7 @@ from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage from .._base_client import AsyncPaginator, make_request_options -from ..types.shared.credit_note_model import CreditNoteModel +from ..types.credit_note import CreditNote __all__ = ["CreditNotes", "AsyncCreditNotes"] @@ -58,7 +58,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditNoteModel: + ) -> CreditNote: """ This endpoint is used to create a single [`Credit Note`](/invoicing/credit-notes). @@ -95,7 +95,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CreditNoteModel, + cast_to=CreditNote, ) def list( @@ -109,7 +109,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[CreditNoteModel]: + ) -> SyncPage[CreditNote]: """Get a paginated list of CreditNotes. Users can also filter by customer_id, @@ -132,7 +132,7 @@ def list( """ return self._get_api_list( "/credit_notes", - page=SyncPage[CreditNoteModel], + page=SyncPage[CreditNote], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -146,7 +146,7 @@ def list( credit_note_list_params.CreditNoteListParams, ), ), - model=CreditNoteModel, + model=CreditNote, ) def fetch( @@ -159,7 +159,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CreditNoteModel: + ) -> CreditNote: """ This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes) given an identifier. @@ -180,7 +180,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CreditNoteModel, + cast_to=CreditNote, ) @@ -218,7 +218,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditNoteModel: + ) -> CreditNote: """ This endpoint is used to create a single [`Credit Note`](/invoicing/credit-notes). @@ -255,7 +255,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CreditNoteModel, + cast_to=CreditNote, ) def list( @@ -269,7 +269,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[CreditNoteModel, AsyncPage[CreditNoteModel]]: + ) -> AsyncPaginator[CreditNote, AsyncPage[CreditNote]]: """Get a paginated list of CreditNotes. Users can also filter by customer_id, @@ -292,7 +292,7 @@ def list( """ return self._get_api_list( "/credit_notes", - page=AsyncPage[CreditNoteModel], + page=AsyncPage[CreditNote], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -306,7 +306,7 @@ def list( credit_note_list_params.CreditNoteListParams, ), ), - model=CreditNoteModel, + model=CreditNote, ) async def fetch( @@ -319,7 +319,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CreditNoteModel: + ) -> CreditNote: """ This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes) given an identifier. @@ -340,7 +340,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CreditNoteModel, + cast_to=CreditNote, ) diff --git a/src/orb/resources/customers/balance_transactions.py b/src/orb/resources/customers/balance_transactions.py index d93f20e2..5da3caf7 100644 --- a/src/orb/resources/customers/balance_transactions.py +++ b/src/orb/resources/customers/balance_transactions.py @@ -20,7 +20,8 @@ from ...pagination import SyncPage, AsyncPage from ..._base_client import AsyncPaginator, make_request_options from ...types.customers import balance_transaction_list_params, balance_transaction_create_params -from ...types.shared.customer_balance_transaction_model import CustomerBalanceTransactionModel +from ...types.customers.balance_transaction_list_response import BalanceTransactionListResponse +from ...types.customers.balance_transaction_create_response import BalanceTransactionCreateResponse __all__ = ["BalanceTransactions", "AsyncBalanceTransactions"] @@ -59,7 +60,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CustomerBalanceTransactionModel: + ) -> BalanceTransactionCreateResponse: """ Creates an immutable balance transaction that updates the customer's balance and returns back the newly created transaction. @@ -96,7 +97,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CustomerBalanceTransactionModel, + cast_to=BalanceTransactionCreateResponse, ) def list( @@ -115,7 +116,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[CustomerBalanceTransactionModel]: + ) -> SyncPage[BalanceTransactionListResponse]: """ ## The customer balance @@ -164,7 +165,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/balance_transactions", - page=SyncPage[CustomerBalanceTransactionModel], + page=SyncPage[BalanceTransactionListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -182,7 +183,7 @@ def list( balance_transaction_list_params.BalanceTransactionListParams, ), ), - model=CustomerBalanceTransactionModel, + model=BalanceTransactionListResponse, ) @@ -220,7 +221,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CustomerBalanceTransactionModel: + ) -> BalanceTransactionCreateResponse: """ Creates an immutable balance transaction that updates the customer's balance and returns back the newly created transaction. @@ -257,7 +258,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CustomerBalanceTransactionModel, + cast_to=BalanceTransactionCreateResponse, ) def list( @@ -276,7 +277,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[CustomerBalanceTransactionModel, AsyncPage[CustomerBalanceTransactionModel]]: + ) -> AsyncPaginator[BalanceTransactionListResponse, AsyncPage[BalanceTransactionListResponse]]: """ ## The customer balance @@ -325,7 +326,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/balance_transactions", - page=AsyncPage[CustomerBalanceTransactionModel], + page=AsyncPage[BalanceTransactionListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -343,7 +344,7 @@ def list( balance_transaction_list_params.BalanceTransactionListParams, ), ), - model=CustomerBalanceTransactionModel, + model=BalanceTransactionListResponse, ) diff --git a/src/orb/resources/customers/costs.py b/src/orb/resources/customers/costs.py index 6ecf7ce3..eb349997 100644 --- a/src/orb/resources/customers/costs.py +++ b/src/orb/resources/customers/costs.py @@ -19,7 +19,8 @@ from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..._base_client import make_request_options from ...types.customers import cost_list_params, cost_list_by_external_id_params -from ...types.shared.customer_costs_model import CustomerCostsModel +from ...types.customers.cost_list_response import CostListResponse +from ...types.customers.cost_list_by_external_id_response import CostListByExternalIDResponse __all__ = ["Costs", "AsyncCosts"] @@ -58,7 +59,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomerCostsModel: + ) -> CostListResponse: """ This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing information to the underlying usage (see the @@ -217,7 +218,7 @@ def list( cost_list_params.CostListParams, ), ), - cast_to=CustomerCostsModel, + cast_to=CostListResponse, ) def list_by_external_id( @@ -234,7 +235,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomerCostsModel: + ) -> CostListByExternalIDResponse: """ This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing information to the underlying usage (see the @@ -395,7 +396,7 @@ def list_by_external_id( cost_list_by_external_id_params.CostListByExternalIDParams, ), ), - cast_to=CustomerCostsModel, + cast_to=CostListByExternalIDResponse, ) @@ -433,7 +434,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomerCostsModel: + ) -> CostListResponse: """ This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing information to the underlying usage (see the @@ -592,7 +593,7 @@ async def list( cost_list_params.CostListParams, ), ), - cast_to=CustomerCostsModel, + cast_to=CostListResponse, ) async def list_by_external_id( @@ -609,7 +610,7 @@ async def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomerCostsModel: + ) -> CostListByExternalIDResponse: """ This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing information to the underlying usage (see the @@ -770,7 +771,7 @@ async def list_by_external_id( cost_list_by_external_id_params.CostListByExternalIDParams, ), ), - cast_to=CustomerCostsModel, + cast_to=CostListByExternalIDResponse, ) diff --git a/src/orb/resources/customers/credits/credits.py b/src/orb/resources/customers/credits/credits.py index f4b5afa8..73e13681 100644 --- a/src/orb/resources/customers/credits/credits.py +++ b/src/orb/resources/customers/credits/credits.py @@ -31,7 +31,8 @@ from ....pagination import SyncPage, AsyncPage from ...._base_client import AsyncPaginator, make_request_options from ....types.customers import credit_list_params, credit_list_by_external_id_params -from ....types.shared.customer_credit_balances_model import Data +from ....types.customers.credit_list_response import CreditListResponse +from ....types.customers.credit_list_by_external_id_response import CreditListByExternalIDResponse __all__ = ["Credits", "AsyncCredits"] @@ -78,7 +79,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[Data]: + ) -> SyncPage[CreditListResponse]: """ Returns a paginated list of unexpired, non-zero credit blocks for a customer. @@ -111,7 +112,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/credits", - page=SyncPage[Data], + page=SyncPage[CreditListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -127,7 +128,7 @@ def list( credit_list_params.CreditListParams, ), ), - model=Data, + model=CreditListResponse, ) def list_by_external_id( @@ -144,7 +145,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[Data]: + ) -> SyncPage[CreditListByExternalIDResponse]: """ Returns a paginated list of unexpired, non-zero credit blocks for a customer. @@ -179,7 +180,7 @@ def list_by_external_id( ) return self._get_api_list( f"/customers/external_customer_id/{external_customer_id}/credits", - page=SyncPage[Data], + page=SyncPage[CreditListByExternalIDResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -195,7 +196,7 @@ def list_by_external_id( credit_list_by_external_id_params.CreditListByExternalIDParams, ), ), - model=Data, + model=CreditListByExternalIDResponse, ) @@ -241,7 +242,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Data, AsyncPage[Data]]: + ) -> AsyncPaginator[CreditListResponse, AsyncPage[CreditListResponse]]: """ Returns a paginated list of unexpired, non-zero credit blocks for a customer. @@ -274,7 +275,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/credits", - page=AsyncPage[Data], + page=AsyncPage[CreditListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -290,7 +291,7 @@ def list( credit_list_params.CreditListParams, ), ), - model=Data, + model=CreditListResponse, ) def list_by_external_id( @@ -307,7 +308,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Data, AsyncPage[Data]]: + ) -> AsyncPaginator[CreditListByExternalIDResponse, AsyncPage[CreditListByExternalIDResponse]]: """ Returns a paginated list of unexpired, non-zero credit blocks for a customer. @@ -342,7 +343,7 @@ def list_by_external_id( ) return self._get_api_list( f"/customers/external_customer_id/{external_customer_id}/credits", - page=AsyncPage[Data], + page=AsyncPage[CreditListByExternalIDResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -358,7 +359,7 @@ def list_by_external_id( credit_list_by_external_id_params.CreditListByExternalIDParams, ), ), - model=Data, + model=CreditListByExternalIDResponse, ) diff --git a/src/orb/resources/customers/credits/ledger.py b/src/orb/resources/customers/credits/ledger.py index 2e9e3e7e..60462510 100644 --- a/src/orb/resources/customers/credits/ledger.py +++ b/src/orb/resources/customers/credits/ledger.py @@ -26,7 +26,12 @@ ledger_list_by_external_id_params, ledger_create_entry_by_external_id_params, ) -from ....types.shared.credit_ledger_entry_model import CreditLedgerEntryModel +from ....types.customers.credits.ledger_list_response import LedgerListResponse +from ....types.customers.credits.ledger_create_entry_response import LedgerCreateEntryResponse +from ....types.customers.credits.ledger_list_by_external_id_response import LedgerListByExternalIDResponse +from ....types.customers.credits.ledger_create_entry_by_external_id_response import ( + LedgerCreateEntryByExternalIDResponse, +) __all__ = ["Ledger", "AsyncLedger"] @@ -82,7 +87,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[CreditLedgerEntryModel]: + ) -> SyncPage[LedgerListResponse]: """ The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit @@ -186,7 +191,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/credits/ledger", - page=SyncPage[CreditLedgerEntryModel], + page=SyncPage[LedgerListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -208,7 +213,7 @@ def list( ledger_list_params.LedgerListParams, ), ), - model=cast(Any, CreditLedgerEntryModel), # Union types cannot be passed in as arguments in the type system + model=cast(Any, LedgerListResponse), # Union types cannot be passed in as arguments in the type system ) @overload @@ -233,7 +238,7 @@ def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -403,7 +408,7 @@ def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -563,7 +568,7 @@ def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -731,7 +736,7 @@ def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -893,7 +898,7 @@ def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -1068,11 +1073,11 @@ def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryResponse: if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return cast( - CreditLedgerEntryModel, + LedgerCreateEntryResponse, self._post( f"/customers/{customer_id}/credits/ledger_entry", body=maybe_transform( @@ -1100,7 +1105,7 @@ def create_entry( idempotency_key=idempotency_key, ), cast_to=cast( - Any, CreditLedgerEntryModel + Any, LedgerCreateEntryResponse ), # Union types cannot be passed in as arguments in the type system ), ) @@ -1129,7 +1134,7 @@ def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryByExternalIDResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -1299,7 +1304,7 @@ def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryByExternalIDResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -1459,7 +1464,7 @@ def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryByExternalIDResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -1627,7 +1632,7 @@ def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryByExternalIDResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -1789,7 +1794,7 @@ def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryByExternalIDResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -1966,13 +1971,13 @@ def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryByExternalIDResponse: if not external_customer_id: raise ValueError( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return cast( - CreditLedgerEntryModel, + LedgerCreateEntryByExternalIDResponse, self._post( f"/customers/external_customer_id/{external_customer_id}/credits/ledger_entry", body=maybe_transform( @@ -2000,7 +2005,7 @@ def create_entry_by_external_id( idempotency_key=idempotency_key, ), cast_to=cast( - Any, CreditLedgerEntryModel + Any, LedgerCreateEntryByExternalIDResponse ), # Union types cannot be passed in as arguments in the type system ), ) @@ -2036,7 +2041,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[CreditLedgerEntryModel]: + ) -> SyncPage[LedgerListByExternalIDResponse]: """ The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit @@ -2142,7 +2147,7 @@ def list_by_external_id( ) return self._get_api_list( f"/customers/external_customer_id/{external_customer_id}/credits/ledger", - page=SyncPage[CreditLedgerEntryModel], + page=SyncPage[LedgerListByExternalIDResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2164,7 +2169,9 @@ def list_by_external_id( ledger_list_by_external_id_params.LedgerListByExternalIDParams, ), ), - model=cast(Any, CreditLedgerEntryModel), # Union types cannot be passed in as arguments in the type system + model=cast( + Any, LedgerListByExternalIDResponse + ), # Union types cannot be passed in as arguments in the type system ) @@ -2219,7 +2226,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[CreditLedgerEntryModel, AsyncPage[CreditLedgerEntryModel]]: + ) -> AsyncPaginator[LedgerListResponse, AsyncPage[LedgerListResponse]]: """ The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit @@ -2323,7 +2330,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/credits/ledger", - page=AsyncPage[CreditLedgerEntryModel], + page=AsyncPage[LedgerListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2345,7 +2352,7 @@ def list( ledger_list_params.LedgerListParams, ), ), - model=cast(Any, CreditLedgerEntryModel), # Union types cannot be passed in as arguments in the type system + model=cast(Any, LedgerListResponse), # Union types cannot be passed in as arguments in the type system ) @overload @@ -2370,7 +2377,7 @@ async def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -2540,7 +2547,7 @@ async def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -2700,7 +2707,7 @@ async def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -2868,7 +2875,7 @@ async def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -3030,7 +3037,7 @@ async def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -3205,11 +3212,11 @@ async def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryResponse: if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return cast( - CreditLedgerEntryModel, + LedgerCreateEntryResponse, await self._post( f"/customers/{customer_id}/credits/ledger_entry", body=await async_maybe_transform( @@ -3237,7 +3244,7 @@ async def create_entry( idempotency_key=idempotency_key, ), cast_to=cast( - Any, CreditLedgerEntryModel + Any, LedgerCreateEntryResponse ), # Union types cannot be passed in as arguments in the type system ), ) @@ -3266,7 +3273,7 @@ async def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryByExternalIDResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -3436,7 +3443,7 @@ async def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryByExternalIDResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -3596,7 +3603,7 @@ async def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryByExternalIDResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -3764,7 +3771,7 @@ async def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryByExternalIDResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -3926,7 +3933,7 @@ async def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryByExternalIDResponse: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -4103,13 +4110,13 @@ async def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditLedgerEntryModel: + ) -> LedgerCreateEntryByExternalIDResponse: if not external_customer_id: raise ValueError( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return cast( - CreditLedgerEntryModel, + LedgerCreateEntryByExternalIDResponse, await self._post( f"/customers/external_customer_id/{external_customer_id}/credits/ledger_entry", body=await async_maybe_transform( @@ -4137,7 +4144,7 @@ async def create_entry_by_external_id( idempotency_key=idempotency_key, ), cast_to=cast( - Any, CreditLedgerEntryModel + Any, LedgerCreateEntryByExternalIDResponse ), # Union types cannot be passed in as arguments in the type system ), ) @@ -4173,7 +4180,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[CreditLedgerEntryModel, AsyncPage[CreditLedgerEntryModel]]: + ) -> AsyncPaginator[LedgerListByExternalIDResponse, AsyncPage[LedgerListByExternalIDResponse]]: """ The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit @@ -4279,7 +4286,7 @@ def list_by_external_id( ) return self._get_api_list( f"/customers/external_customer_id/{external_customer_id}/credits/ledger", - page=AsyncPage[CreditLedgerEntryModel], + page=AsyncPage[LedgerListByExternalIDResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -4301,7 +4308,9 @@ def list_by_external_id( ledger_list_by_external_id_params.LedgerListByExternalIDParams, ), ), - model=cast(Any, CreditLedgerEntryModel), # Union types cannot be passed in as arguments in the type system + model=cast( + Any, LedgerListByExternalIDResponse + ), # Union types cannot be passed in as arguments in the type system ) diff --git a/src/orb/resources/customers/credits/top_ups.py b/src/orb/resources/customers/credits/top_ups.py index 57bd5783..e9792791 100644 --- a/src/orb/resources/customers/credits/top_ups.py +++ b/src/orb/resources/customers/credits/top_ups.py @@ -25,7 +25,10 @@ top_up_list_by_external_id_params, top_up_create_by_external_id_params, ) -from ....types.shared.top_up_model import TopUpModel +from ....types.customers.credits.top_up_list_response import TopUpListResponse +from ....types.customers.credits.top_up_create_response import TopUpCreateResponse +from ....types.customers.credits.top_up_list_by_external_id_response import TopUpListByExternalIDResponse +from ....types.customers.credits.top_up_create_by_external_id_response import TopUpCreateByExternalIDResponse __all__ = ["TopUps", "AsyncTopUps"] @@ -69,7 +72,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> TopUpModel: + ) -> TopUpCreateResponse: """ This endpoint allows you to create a new top-up for a specified customer's balance. While this top-up is active, the customer's balance will added in @@ -134,7 +137,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=TopUpModel, + cast_to=TopUpCreateResponse, ) def list( @@ -149,7 +152,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[TopUpModel]: + ) -> SyncPage[TopUpListResponse]: """List top-ups Args: @@ -172,7 +175,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/credits/top_ups", - page=SyncPage[TopUpModel], + page=SyncPage[TopUpListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -186,7 +189,7 @@ def list( top_up_list_params.TopUpListParams, ), ), - model=TopUpModel, + model=TopUpListResponse, ) def delete( @@ -253,7 +256,7 @@ def create_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> TopUpModel: + ) -> TopUpCreateByExternalIDResponse: """ This endpoint allows you to create a new top-up for a specified customer's balance. While this top-up is active, the customer's balance will added in @@ -320,7 +323,7 @@ def create_by_external_id( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=TopUpModel, + cast_to=TopUpCreateByExternalIDResponse, ) def delete_by_external_id( @@ -382,7 +385,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[TopUpModel]: + ) -> SyncPage[TopUpListByExternalIDResponse]: """List top-ups by external ID Args: @@ -407,7 +410,7 @@ def list_by_external_id( ) return self._get_api_list( f"/customers/external_customer_id/{external_customer_id}/credits/top_ups", - page=SyncPage[TopUpModel], + page=SyncPage[TopUpListByExternalIDResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -421,7 +424,7 @@ def list_by_external_id( top_up_list_by_external_id_params.TopUpListByExternalIDParams, ), ), - model=TopUpModel, + model=TopUpListByExternalIDResponse, ) @@ -464,7 +467,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> TopUpModel: + ) -> TopUpCreateResponse: """ This endpoint allows you to create a new top-up for a specified customer's balance. While this top-up is active, the customer's balance will added in @@ -529,7 +532,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=TopUpModel, + cast_to=TopUpCreateResponse, ) def list( @@ -544,7 +547,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[TopUpModel, AsyncPage[TopUpModel]]: + ) -> AsyncPaginator[TopUpListResponse, AsyncPage[TopUpListResponse]]: """List top-ups Args: @@ -567,7 +570,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/credits/top_ups", - page=AsyncPage[TopUpModel], + page=AsyncPage[TopUpListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -581,7 +584,7 @@ def list( top_up_list_params.TopUpListParams, ), ), - model=TopUpModel, + model=TopUpListResponse, ) async def delete( @@ -648,7 +651,7 @@ async def create_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> TopUpModel: + ) -> TopUpCreateByExternalIDResponse: """ This endpoint allows you to create a new top-up for a specified customer's balance. While this top-up is active, the customer's balance will added in @@ -715,7 +718,7 @@ async def create_by_external_id( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=TopUpModel, + cast_to=TopUpCreateByExternalIDResponse, ) async def delete_by_external_id( @@ -777,7 +780,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[TopUpModel, AsyncPage[TopUpModel]]: + ) -> AsyncPaginator[TopUpListByExternalIDResponse, AsyncPage[TopUpListByExternalIDResponse]]: """List top-ups by external ID Args: @@ -802,7 +805,7 @@ def list_by_external_id( ) return self._get_api_list( f"/customers/external_customer_id/{external_customer_id}/credits/top_ups", - page=AsyncPage[TopUpModel], + page=AsyncPage[TopUpListByExternalIDResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -816,7 +819,7 @@ def list_by_external_id( top_up_list_by_external_id_params.TopUpListByExternalIDParams, ), ), - model=TopUpModel, + model=TopUpListByExternalIDResponse, ) diff --git a/src/orb/resources/customers/customers.py b/src/orb/resources/customers/customers.py index 563cdbf0..bd33194f 100644 --- a/src/orb/resources/customers/customers.py +++ b/src/orb/resources/customers/customers.py @@ -41,6 +41,7 @@ CreditsWithStreamingResponse, AsyncCreditsWithStreamingResponse, ) +from ...types.customer import Customer from .balance_transactions import ( BalanceTransactions, AsyncBalanceTransactions, @@ -49,13 +50,6 @@ BalanceTransactionsWithStreamingResponse, AsyncBalanceTransactionsWithStreamingResponse, ) -from ...types.shared.customer_model import CustomerModel -from ...types.shared_params.address_input_model import AddressInputModel -from ...types.shared_params.customer_tax_id_model import CustomerTaxIDModel -from ...types.shared_params.new_tax_configuration_model import NewTaxConfigurationModel -from ...types.shared_params.customer_hierarchy_config_model import CustomerHierarchyConfigModel -from ...types.shared_params.new_reporting_configuration_model import NewReportingConfigurationModel -from ...types.shared_params.new_accounting_sync_configuration_model import NewAccountingSyncConfigurationModel __all__ = ["Customers", "AsyncCustomers"] @@ -97,22 +91,23 @@ def create( *, email: str, name: str, - accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] | NotGiven = NOT_GIVEN, + accounting_sync_configuration: Optional[customer_create_params.AccountingSyncConfiguration] + | NotGiven = NOT_GIVEN, additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - billing_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, + billing_address: Optional[customer_create_params.BillingAddress] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - hierarchy: Optional[CustomerHierarchyConfigModel] | NotGiven = NOT_GIVEN, + hierarchy: Optional[customer_create_params.Hierarchy] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | NotGiven = NOT_GIVEN, payment_provider_id: Optional[str] | NotGiven = NOT_GIVEN, - reporting_configuration: Optional[NewReportingConfigurationModel] | NotGiven = NOT_GIVEN, - shipping_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, - tax_configuration: Optional[NewTaxConfigurationModel] | NotGiven = NOT_GIVEN, - tax_id: Optional[CustomerTaxIDModel] | NotGiven = NOT_GIVEN, + reporting_configuration: Optional[customer_create_params.ReportingConfiguration] | NotGiven = NOT_GIVEN, + shipping_address: Optional[customer_create_params.ShippingAddress] | NotGiven = NOT_GIVEN, + tax_configuration: Optional[customer_create_params.TaxConfiguration] | NotGiven = NOT_GIVEN, + tax_id: Optional[customer_create_params.TaxID] | NotGiven = NOT_GIVEN, timezone: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -121,7 +116,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CustomerModel: + ) -> Customer: """ This operation is used to create an Orb customer, who is party to the core billing relationship. See [Customer](/core-concepts##customer) for an overview @@ -322,31 +317,32 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CustomerModel, + cast_to=Customer, ) def update( self, customer_id: str, *, - accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] | NotGiven = NOT_GIVEN, + accounting_sync_configuration: Optional[customer_update_params.AccountingSyncConfiguration] + | NotGiven = NOT_GIVEN, additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - billing_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, + billing_address: Optional[customer_update_params.BillingAddress] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - hierarchy: Optional[CustomerHierarchyConfigModel] | NotGiven = NOT_GIVEN, + hierarchy: Optional[customer_update_params.Hierarchy] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | NotGiven = NOT_GIVEN, payment_provider_id: Optional[str] | NotGiven = NOT_GIVEN, - reporting_configuration: Optional[NewReportingConfigurationModel] | NotGiven = NOT_GIVEN, - shipping_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, - tax_configuration: Optional[NewTaxConfigurationModel] | NotGiven = NOT_GIVEN, - tax_id: Optional[CustomerTaxIDModel] | NotGiven = NOT_GIVEN, + reporting_configuration: Optional[customer_update_params.ReportingConfiguration] | NotGiven = NOT_GIVEN, + shipping_address: Optional[customer_update_params.ShippingAddress] | NotGiven = NOT_GIVEN, + tax_configuration: Optional[customer_update_params.TaxConfiguration] | NotGiven = NOT_GIVEN, + tax_id: Optional[customer_update_params.TaxID] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -354,7 +350,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CustomerModel: + ) -> Customer: """ This endpoint can be used to update the `payment_provider`, `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`, @@ -546,7 +542,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CustomerModel, + cast_to=Customer, ) def list( @@ -564,7 +560,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[CustomerModel]: + ) -> SyncPage[Customer]: """This endpoint returns a list of all customers for an account. The list of @@ -590,7 +586,7 @@ def list( """ return self._get_api_list( "/customers", - page=SyncPage[CustomerModel], + page=SyncPage[Customer], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -608,7 +604,7 @@ def list( customer_list_params.CustomerListParams, ), ), - model=CustomerModel, + model=Customer, ) def delete( @@ -676,7 +672,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomerModel: + ) -> Customer: """This endpoint is used to fetch customer details given an identifier. If the @@ -702,7 +698,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CustomerModel, + cast_to=Customer, ) def fetch_by_external_id( @@ -715,7 +711,7 @@ def fetch_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomerModel: + ) -> Customer: """ This endpoint is used to fetch customer details given an `external_customer_id` (see [Customer ID Aliases](/events-and-metrics/customer-aliases)). @@ -741,7 +737,7 @@ def fetch_by_external_id( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CustomerModel, + cast_to=Customer, ) def sync_payment_methods_from_gateway( @@ -842,24 +838,26 @@ def update_by_external_id( self, id: str, *, - accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] | NotGiven = NOT_GIVEN, + accounting_sync_configuration: Optional[customer_update_by_external_id_params.AccountingSyncConfiguration] + | NotGiven = NOT_GIVEN, additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - billing_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, + billing_address: Optional[customer_update_by_external_id_params.BillingAddress] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - hierarchy: Optional[CustomerHierarchyConfigModel] | NotGiven = NOT_GIVEN, + hierarchy: Optional[customer_update_by_external_id_params.Hierarchy] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | NotGiven = NOT_GIVEN, payment_provider_id: Optional[str] | NotGiven = NOT_GIVEN, - reporting_configuration: Optional[NewReportingConfigurationModel] | NotGiven = NOT_GIVEN, - shipping_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, - tax_configuration: Optional[NewTaxConfigurationModel] | NotGiven = NOT_GIVEN, - tax_id: Optional[CustomerTaxIDModel] | NotGiven = NOT_GIVEN, + reporting_configuration: Optional[customer_update_by_external_id_params.ReportingConfiguration] + | NotGiven = NOT_GIVEN, + shipping_address: Optional[customer_update_by_external_id_params.ShippingAddress] | NotGiven = NOT_GIVEN, + tax_configuration: Optional[customer_update_by_external_id_params.TaxConfiguration] | NotGiven = NOT_GIVEN, + tax_id: Optional[customer_update_by_external_id_params.TaxID] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -867,7 +865,7 @@ def update_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CustomerModel: + ) -> Customer: """ This endpoint is used to update customer details given an `external_customer_id` (see [Customer ID Aliases](/events-and-metrics/customer-aliases)). Note that the @@ -1058,7 +1056,7 @@ def update_by_external_id( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CustomerModel, + cast_to=Customer, ) @@ -1099,22 +1097,23 @@ async def create( *, email: str, name: str, - accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] | NotGiven = NOT_GIVEN, + accounting_sync_configuration: Optional[customer_create_params.AccountingSyncConfiguration] + | NotGiven = NOT_GIVEN, additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - billing_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, + billing_address: Optional[customer_create_params.BillingAddress] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - hierarchy: Optional[CustomerHierarchyConfigModel] | NotGiven = NOT_GIVEN, + hierarchy: Optional[customer_create_params.Hierarchy] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | NotGiven = NOT_GIVEN, payment_provider_id: Optional[str] | NotGiven = NOT_GIVEN, - reporting_configuration: Optional[NewReportingConfigurationModel] | NotGiven = NOT_GIVEN, - shipping_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, - tax_configuration: Optional[NewTaxConfigurationModel] | NotGiven = NOT_GIVEN, - tax_id: Optional[CustomerTaxIDModel] | NotGiven = NOT_GIVEN, + reporting_configuration: Optional[customer_create_params.ReportingConfiguration] | NotGiven = NOT_GIVEN, + shipping_address: Optional[customer_create_params.ShippingAddress] | NotGiven = NOT_GIVEN, + tax_configuration: Optional[customer_create_params.TaxConfiguration] | NotGiven = NOT_GIVEN, + tax_id: Optional[customer_create_params.TaxID] | NotGiven = NOT_GIVEN, timezone: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1123,7 +1122,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CustomerModel: + ) -> Customer: """ This operation is used to create an Orb customer, who is party to the core billing relationship. See [Customer](/core-concepts##customer) for an overview @@ -1324,31 +1323,32 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CustomerModel, + cast_to=Customer, ) async def update( self, customer_id: str, *, - accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] | NotGiven = NOT_GIVEN, + accounting_sync_configuration: Optional[customer_update_params.AccountingSyncConfiguration] + | NotGiven = NOT_GIVEN, additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - billing_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, + billing_address: Optional[customer_update_params.BillingAddress] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - hierarchy: Optional[CustomerHierarchyConfigModel] | NotGiven = NOT_GIVEN, + hierarchy: Optional[customer_update_params.Hierarchy] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | NotGiven = NOT_GIVEN, payment_provider_id: Optional[str] | NotGiven = NOT_GIVEN, - reporting_configuration: Optional[NewReportingConfigurationModel] | NotGiven = NOT_GIVEN, - shipping_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, - tax_configuration: Optional[NewTaxConfigurationModel] | NotGiven = NOT_GIVEN, - tax_id: Optional[CustomerTaxIDModel] | NotGiven = NOT_GIVEN, + reporting_configuration: Optional[customer_update_params.ReportingConfiguration] | NotGiven = NOT_GIVEN, + shipping_address: Optional[customer_update_params.ShippingAddress] | NotGiven = NOT_GIVEN, + tax_configuration: Optional[customer_update_params.TaxConfiguration] | NotGiven = NOT_GIVEN, + tax_id: Optional[customer_update_params.TaxID] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1356,7 +1356,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CustomerModel: + ) -> Customer: """ This endpoint can be used to update the `payment_provider`, `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`, @@ -1548,7 +1548,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CustomerModel, + cast_to=Customer, ) def list( @@ -1566,7 +1566,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[CustomerModel, AsyncPage[CustomerModel]]: + ) -> AsyncPaginator[Customer, AsyncPage[Customer]]: """This endpoint returns a list of all customers for an account. The list of @@ -1592,7 +1592,7 @@ def list( """ return self._get_api_list( "/customers", - page=AsyncPage[CustomerModel], + page=AsyncPage[Customer], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1610,7 +1610,7 @@ def list( customer_list_params.CustomerListParams, ), ), - model=CustomerModel, + model=Customer, ) async def delete( @@ -1678,7 +1678,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomerModel: + ) -> Customer: """This endpoint is used to fetch customer details given an identifier. If the @@ -1704,7 +1704,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CustomerModel, + cast_to=Customer, ) async def fetch_by_external_id( @@ -1717,7 +1717,7 @@ async def fetch_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomerModel: + ) -> Customer: """ This endpoint is used to fetch customer details given an `external_customer_id` (see [Customer ID Aliases](/events-and-metrics/customer-aliases)). @@ -1743,7 +1743,7 @@ async def fetch_by_external_id( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CustomerModel, + cast_to=Customer, ) async def sync_payment_methods_from_gateway( @@ -1844,24 +1844,26 @@ async def update_by_external_id( self, id: str, *, - accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] | NotGiven = NOT_GIVEN, + accounting_sync_configuration: Optional[customer_update_by_external_id_params.AccountingSyncConfiguration] + | NotGiven = NOT_GIVEN, additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - billing_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, + billing_address: Optional[customer_update_by_external_id_params.BillingAddress] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - hierarchy: Optional[CustomerHierarchyConfigModel] | NotGiven = NOT_GIVEN, + hierarchy: Optional[customer_update_by_external_id_params.Hierarchy] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | NotGiven = NOT_GIVEN, payment_provider_id: Optional[str] | NotGiven = NOT_GIVEN, - reporting_configuration: Optional[NewReportingConfigurationModel] | NotGiven = NOT_GIVEN, - shipping_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, - tax_configuration: Optional[NewTaxConfigurationModel] | NotGiven = NOT_GIVEN, - tax_id: Optional[CustomerTaxIDModel] | NotGiven = NOT_GIVEN, + reporting_configuration: Optional[customer_update_by_external_id_params.ReportingConfiguration] + | NotGiven = NOT_GIVEN, + shipping_address: Optional[customer_update_by_external_id_params.ShippingAddress] | NotGiven = NOT_GIVEN, + tax_configuration: Optional[customer_update_by_external_id_params.TaxConfiguration] | NotGiven = NOT_GIVEN, + tax_id: Optional[customer_update_by_external_id_params.TaxID] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1869,7 +1871,7 @@ async def update_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CustomerModel: + ) -> Customer: """ This endpoint is used to update customer details given an `external_customer_id` (see [Customer ID Aliases](/events-and-metrics/customer-aliases)). Note that the @@ -2060,7 +2062,7 @@ async def update_by_external_id( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CustomerModel, + cast_to=Customer, ) diff --git a/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py b/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py index 982a717d..45ccfd75 100644 --- a/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py +++ b/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py @@ -18,6 +18,7 @@ from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ...pagination import SyncPage, AsyncPage from ..._base_client import AsyncPaginator, make_request_options +from ...types.dimensional_price_group import DimensionalPriceGroup from .external_dimensional_price_group_id import ( ExternalDimensionalPriceGroupID, AsyncExternalDimensionalPriceGroupID, @@ -26,7 +27,6 @@ ExternalDimensionalPriceGroupIDWithStreamingResponse, AsyncExternalDimensionalPriceGroupIDWithStreamingResponse, ) -from ...types.shared.dimensional_price_group_model import DimensionalPriceGroupModel __all__ = ["DimensionalPriceGroups", "AsyncDimensionalPriceGroups"] @@ -70,7 +70,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> DimensionalPriceGroupModel: + ) -> DimensionalPriceGroup: """ A dimensional price group is used to partition the result of a billable metric by a set of dimensions. Prices in a price group must specify the parition used @@ -117,7 +117,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=DimensionalPriceGroupModel, + cast_to=DimensionalPriceGroup, ) def retrieve( @@ -130,7 +130,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DimensionalPriceGroupModel: + ) -> DimensionalPriceGroup: """ Fetch dimensional price group @@ -152,7 +152,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=DimensionalPriceGroupModel, + cast_to=DimensionalPriceGroup, ) def list( @@ -166,7 +166,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[DimensionalPriceGroupModel]: + ) -> SyncPage[DimensionalPriceGroup]: """List dimensional price groups Args: @@ -187,7 +187,7 @@ def list( """ return self._get_api_list( "/dimensional_price_groups", - page=SyncPage[DimensionalPriceGroupModel], + page=SyncPage[DimensionalPriceGroup], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -201,7 +201,7 @@ def list( dimensional_price_group_list_params.DimensionalPriceGroupListParams, ), ), - model=DimensionalPriceGroupModel, + model=DimensionalPriceGroup, ) @@ -244,7 +244,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> DimensionalPriceGroupModel: + ) -> DimensionalPriceGroup: """ A dimensional price group is used to partition the result of a billable metric by a set of dimensions. Prices in a price group must specify the parition used @@ -291,7 +291,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=DimensionalPriceGroupModel, + cast_to=DimensionalPriceGroup, ) async def retrieve( @@ -304,7 +304,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DimensionalPriceGroupModel: + ) -> DimensionalPriceGroup: """ Fetch dimensional price group @@ -326,7 +326,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=DimensionalPriceGroupModel, + cast_to=DimensionalPriceGroup, ) def list( @@ -340,7 +340,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DimensionalPriceGroupModel, AsyncPage[DimensionalPriceGroupModel]]: + ) -> AsyncPaginator[DimensionalPriceGroup, AsyncPage[DimensionalPriceGroup]]: """List dimensional price groups Args: @@ -361,7 +361,7 @@ def list( """ return self._get_api_list( "/dimensional_price_groups", - page=AsyncPage[DimensionalPriceGroupModel], + page=AsyncPage[DimensionalPriceGroup], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -375,7 +375,7 @@ def list( dimensional_price_group_list_params.DimensionalPriceGroupListParams, ), ), - model=DimensionalPriceGroupModel, + model=DimensionalPriceGroup, ) diff --git a/src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py b/src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py index a51d6e0b..ac6fd830 100644 --- a/src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py +++ b/src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py @@ -10,7 +10,7 @@ from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..._base_client import make_request_options -from ...types.shared.dimensional_price_group_model import DimensionalPriceGroupModel +from ...types.dimensional_price_group import DimensionalPriceGroup __all__ = ["ExternalDimensionalPriceGroupID", "AsyncExternalDimensionalPriceGroupID"] @@ -45,7 +45,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DimensionalPriceGroupModel: + ) -> DimensionalPriceGroup: """ Fetch dimensional price group by external ID @@ -67,7 +67,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=DimensionalPriceGroupModel, + cast_to=DimensionalPriceGroup, ) @@ -101,7 +101,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DimensionalPriceGroupModel: + ) -> DimensionalPriceGroup: """ Fetch dimensional price group by external ID @@ -123,7 +123,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=DimensionalPriceGroupModel, + cast_to=DimensionalPriceGroup, ) diff --git a/src/orb/resources/events/backfills.py b/src/orb/resources/events/backfills.py index 46a0089f..b3beb23d 100644 --- a/src/orb/resources/events/backfills.py +++ b/src/orb/resources/events/backfills.py @@ -19,7 +19,11 @@ from ...pagination import SyncPage, AsyncPage from ..._base_client import AsyncPaginator, make_request_options from ...types.events import backfill_list_params, backfill_create_params -from ...types.shared.backfill_model import BackfillModel +from ...types.events.backfill_list_response import BackfillListResponse +from ...types.events.backfill_close_response import BackfillCloseResponse +from ...types.events.backfill_fetch_response import BackfillFetchResponse +from ...types.events.backfill_create_response import BackfillCreateResponse +from ...types.events.backfill_revert_response import BackfillRevertResponse __all__ = ["Backfills", "AsyncBackfills"] @@ -61,7 +65,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BackfillModel: + ) -> BackfillCreateResponse: """ Creating the backfill enables adding or replacing past events, even those that are older than the ingestion grace period. Performing a backfill in Orb involves @@ -154,7 +158,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BackfillModel, + cast_to=BackfillCreateResponse, ) def list( @@ -168,7 +172,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[BackfillModel]: + ) -> SyncPage[BackfillListResponse]: """ This endpoint returns a list of all backfills in a list format. @@ -194,7 +198,7 @@ def list( """ return self._get_api_list( "/events/backfills", - page=SyncPage[BackfillModel], + page=SyncPage[BackfillListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -208,7 +212,7 @@ def list( backfill_list_params.BackfillListParams, ), ), - model=BackfillModel, + model=BackfillListResponse, ) def close( @@ -222,7 +226,7 @@ def close( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BackfillModel: + ) -> BackfillCloseResponse: """Closing a backfill makes the updated usage visible in Orb. Upon closing a @@ -252,7 +256,7 @@ def close( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BackfillModel, + cast_to=BackfillCloseResponse, ) def fetch( @@ -265,7 +269,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BackfillModel: + ) -> BackfillFetchResponse: """ This endpoint is used to fetch a backfill given an identifier. @@ -285,7 +289,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BackfillModel, + cast_to=BackfillFetchResponse, ) def revert( @@ -299,7 +303,7 @@ def revert( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BackfillModel: + ) -> BackfillRevertResponse: """Reverting a backfill undoes all the effects of closing the backfill. If the @@ -332,7 +336,7 @@ def revert( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BackfillModel, + cast_to=BackfillRevertResponse, ) @@ -373,7 +377,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BackfillModel: + ) -> BackfillCreateResponse: """ Creating the backfill enables adding or replacing past events, even those that are older than the ingestion grace period. Performing a backfill in Orb involves @@ -466,7 +470,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BackfillModel, + cast_to=BackfillCreateResponse, ) def list( @@ -480,7 +484,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[BackfillModel, AsyncPage[BackfillModel]]: + ) -> AsyncPaginator[BackfillListResponse, AsyncPage[BackfillListResponse]]: """ This endpoint returns a list of all backfills in a list format. @@ -506,7 +510,7 @@ def list( """ return self._get_api_list( "/events/backfills", - page=AsyncPage[BackfillModel], + page=AsyncPage[BackfillListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -520,7 +524,7 @@ def list( backfill_list_params.BackfillListParams, ), ), - model=BackfillModel, + model=BackfillListResponse, ) async def close( @@ -534,7 +538,7 @@ async def close( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BackfillModel: + ) -> BackfillCloseResponse: """Closing a backfill makes the updated usage visible in Orb. Upon closing a @@ -564,7 +568,7 @@ async def close( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BackfillModel, + cast_to=BackfillCloseResponse, ) async def fetch( @@ -577,7 +581,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BackfillModel: + ) -> BackfillFetchResponse: """ This endpoint is used to fetch a backfill given an identifier. @@ -597,7 +601,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BackfillModel, + cast_to=BackfillFetchResponse, ) async def revert( @@ -611,7 +615,7 @@ async def revert( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BackfillModel: + ) -> BackfillRevertResponse: """Reverting a backfill undoes all the effects of closing the backfill. If the @@ -644,7 +648,7 @@ async def revert( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BackfillModel, + cast_to=BackfillRevertResponse, ) diff --git a/src/orb/resources/invoice_line_items.py b/src/orb/resources/invoice_line_items.py index 43a22c7d..82c25b94 100644 --- a/src/orb/resources/invoice_line_items.py +++ b/src/orb/resources/invoice_line_items.py @@ -18,7 +18,7 @@ from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from .._base_client import make_request_options -from ..types.shared.invoice_line_item_model import InvoiceLineItemModel +from ..types.invoice_line_item_create_response import InvoiceLineItemCreateResponse __all__ = ["InvoiceLineItems", "AsyncInvoiceLineItems"] @@ -59,7 +59,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceLineItemModel: + ) -> InvoiceLineItemCreateResponse: """This creates a one-off fixed fee invoice line item on an Invoice. This can only @@ -109,7 +109,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceLineItemModel, + cast_to=InvoiceLineItemCreateResponse, ) @@ -149,7 +149,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceLineItemModel: + ) -> InvoiceLineItemCreateResponse: """This creates a one-off fixed fee invoice line item on an Invoice. This can only @@ -199,7 +199,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceLineItemModel, + cast_to=InvoiceLineItemCreateResponse, ) diff --git a/src/orb/resources/invoices.py b/src/orb/resources/invoices.py index 93e6d0a2..22c82be0 100644 --- a/src/orb/resources/invoices.py +++ b/src/orb/resources/invoices.py @@ -27,7 +27,7 @@ from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage from .._base_client import AsyncPaginator, make_request_options -from ..types.shared.invoice_model import InvoiceModel +from ..types.invoice import Invoice from ..types.shared_params.discount import Discount from ..types.invoice_fetch_upcoming_response import InvoiceFetchUpcomingResponse @@ -74,7 +74,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceModel: + ) -> Invoice: """ This endpoint is used to create a one-off invoice for a customer. @@ -141,7 +141,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceModel, + cast_to=Invoice, ) def update( @@ -156,7 +156,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceModel: + ) -> Invoice: """This endpoint allows you to update the `metadata` property on an invoice. If you @@ -192,7 +192,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceModel, + cast_to=Invoice, ) def list( @@ -223,7 +223,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[InvoiceModel]: + ) -> SyncPage[Invoice]: """ This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an account in a list format. @@ -260,7 +260,7 @@ def list( """ return self._get_api_list( "/invoices", - page=SyncPage[InvoiceModel], + page=SyncPage[Invoice], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -291,7 +291,7 @@ def list( invoice_list_params.InvoiceListParams, ), ), - model=InvoiceModel, + model=Invoice, ) def fetch( @@ -304,7 +304,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InvoiceModel: + ) -> Invoice: """ This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an identifier. @@ -325,7 +325,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=InvoiceModel, + cast_to=Invoice, ) def fetch_upcoming( @@ -379,7 +379,7 @@ def issue( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceModel: + ) -> Invoice: """This endpoint allows an eligible invoice to be issued manually. This is only @@ -418,7 +418,7 @@ def issue( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceModel, + cast_to=Invoice, ) def mark_paid( @@ -435,7 +435,7 @@ def mark_paid( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceModel: + ) -> Invoice: """This endpoint allows an invoice's status to be set the `paid` status. This can @@ -477,7 +477,7 @@ def mark_paid( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceModel, + cast_to=Invoice, ) def pay( @@ -491,7 +491,7 @@ def pay( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceModel: + ) -> Invoice: """ This endpoint collects payment for an invoice using the customer's default payment method. This action can only be taken on invoices with status "issued". @@ -518,7 +518,7 @@ def pay( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceModel, + cast_to=Invoice, ) def void( @@ -532,7 +532,7 @@ def void( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceModel: + ) -> Invoice: """This endpoint allows an invoice's status to be set the `void` status. This can @@ -569,7 +569,7 @@ def void( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceModel, + cast_to=Invoice, ) @@ -613,7 +613,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceModel: + ) -> Invoice: """ This endpoint is used to create a one-off invoice for a customer. @@ -680,7 +680,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceModel, + cast_to=Invoice, ) async def update( @@ -695,7 +695,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceModel: + ) -> Invoice: """This endpoint allows you to update the `metadata` property on an invoice. If you @@ -731,7 +731,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceModel, + cast_to=Invoice, ) def list( @@ -762,7 +762,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[InvoiceModel, AsyncPage[InvoiceModel]]: + ) -> AsyncPaginator[Invoice, AsyncPage[Invoice]]: """ This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an account in a list format. @@ -799,7 +799,7 @@ def list( """ return self._get_api_list( "/invoices", - page=AsyncPage[InvoiceModel], + page=AsyncPage[Invoice], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -830,7 +830,7 @@ def list( invoice_list_params.InvoiceListParams, ), ), - model=InvoiceModel, + model=Invoice, ) async def fetch( @@ -843,7 +843,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InvoiceModel: + ) -> Invoice: """ This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an identifier. @@ -864,7 +864,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=InvoiceModel, + cast_to=Invoice, ) async def fetch_upcoming( @@ -918,7 +918,7 @@ async def issue( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceModel: + ) -> Invoice: """This endpoint allows an eligible invoice to be issued manually. This is only @@ -957,7 +957,7 @@ async def issue( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceModel, + cast_to=Invoice, ) async def mark_paid( @@ -974,7 +974,7 @@ async def mark_paid( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceModel: + ) -> Invoice: """This endpoint allows an invoice's status to be set the `paid` status. This can @@ -1016,7 +1016,7 @@ async def mark_paid( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceModel, + cast_to=Invoice, ) async def pay( @@ -1030,7 +1030,7 @@ async def pay( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceModel: + ) -> Invoice: """ This endpoint collects payment for an invoice using the customer's default payment method. This action can only be taken on invoices with status "issued". @@ -1057,7 +1057,7 @@ async def pay( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceModel, + cast_to=Invoice, ) async def void( @@ -1071,7 +1071,7 @@ async def void( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceModel: + ) -> Invoice: """This endpoint allows an invoice's status to be set the `void` status. This can @@ -1108,7 +1108,7 @@ async def void( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceModel, + cast_to=Invoice, ) diff --git a/src/orb/resources/items.py b/src/orb/resources/items.py index c5834c6d..8e584391 100644 --- a/src/orb/resources/items.py +++ b/src/orb/resources/items.py @@ -17,9 +17,8 @@ from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage +from ..types.item import Item from .._base_client import AsyncPaginator, make_request_options -from ..types.shared.item_model import ItemModel -from ..types.shared_params.item_external_connection_model import ItemExternalConnectionModel __all__ = ["Items", "AsyncItems"] @@ -55,7 +54,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> ItemModel: + ) -> Item: """ This endpoint is used to create an [Item](/core-concepts#item). @@ -82,14 +81,14 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=ItemModel, + cast_to=Item, ) def update( self, item_id: str, *, - external_connections: Optional[Iterable[ItemExternalConnectionModel]] | NotGiven = NOT_GIVEN, + external_connections: Optional[Iterable[item_update_params.ExternalConnection]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -98,7 +97,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> ItemModel: + ) -> Item: """ This endpoint can be used to update properties on the Item. @@ -131,7 +130,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=ItemModel, + cast_to=Item, ) def list( @@ -145,7 +144,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[ItemModel]: + ) -> SyncPage[Item]: """ This endpoint returns a list of all Items, ordered in descending order by creation time. @@ -166,7 +165,7 @@ def list( """ return self._get_api_list( "/items", - page=SyncPage[ItemModel], + page=SyncPage[Item], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -180,7 +179,7 @@ def list( item_list_params.ItemListParams, ), ), - model=ItemModel, + model=Item, ) def fetch( @@ -193,7 +192,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ItemModel: + ) -> Item: """ This endpoint returns an item identified by its item_id. @@ -213,7 +212,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ItemModel, + cast_to=Item, ) @@ -248,7 +247,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> ItemModel: + ) -> Item: """ This endpoint is used to create an [Item](/core-concepts#item). @@ -275,14 +274,14 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=ItemModel, + cast_to=Item, ) async def update( self, item_id: str, *, - external_connections: Optional[Iterable[ItemExternalConnectionModel]] | NotGiven = NOT_GIVEN, + external_connections: Optional[Iterable[item_update_params.ExternalConnection]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -291,7 +290,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> ItemModel: + ) -> Item: """ This endpoint can be used to update properties on the Item. @@ -324,7 +323,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=ItemModel, + cast_to=Item, ) def list( @@ -338,7 +337,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ItemModel, AsyncPage[ItemModel]]: + ) -> AsyncPaginator[Item, AsyncPage[Item]]: """ This endpoint returns a list of all Items, ordered in descending order by creation time. @@ -359,7 +358,7 @@ def list( """ return self._get_api_list( "/items", - page=AsyncPage[ItemModel], + page=AsyncPage[Item], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -373,7 +372,7 @@ def list( item_list_params.ItemListParams, ), ), - model=ItemModel, + model=Item, ) async def fetch( @@ -386,7 +385,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ItemModel: + ) -> Item: """ This endpoint returns an item identified by its item_id. @@ -406,7 +405,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ItemModel, + cast_to=Item, ) diff --git a/src/orb/resources/metrics.py b/src/orb/resources/metrics.py index f6be3792..8b78b8c4 100644 --- a/src/orb/resources/metrics.py +++ b/src/orb/resources/metrics.py @@ -19,7 +19,7 @@ from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage from .._base_client import AsyncPaginator, make_request_options -from ..types.shared.billable_metric_model import BillableMetricModel +from ..types.billable_metric import BillableMetric __all__ = ["Metrics", "AsyncMetrics"] @@ -59,7 +59,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BillableMetricModel: + ) -> BillableMetric: """ This endpoint is used to create a [metric](/core-concepts###metric) using a SQL string. See [SQL support](/extensibility/advanced-metrics#sql-support) for a @@ -107,7 +107,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BillableMetricModel, + cast_to=BillableMetric, ) def update( @@ -122,7 +122,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BillableMetricModel: + ) -> BillableMetric: """This endpoint allows you to update the `metadata` property on a metric. If you @@ -156,7 +156,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BillableMetricModel, + cast_to=BillableMetric, ) def list( @@ -174,7 +174,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[BillableMetricModel]: + ) -> SyncPage[BillableMetric]: """ This endpoint is used to fetch [metric](/core-concepts##metric) details given a metric identifier. It returns information about the metrics including its name, @@ -196,7 +196,7 @@ def list( """ return self._get_api_list( "/metrics", - page=SyncPage[BillableMetricModel], + page=SyncPage[BillableMetric], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -214,7 +214,7 @@ def list( metric_list_params.MetricListParams, ), ), - model=BillableMetricModel, + model=BillableMetric, ) def fetch( @@ -227,7 +227,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BillableMetricModel: + ) -> BillableMetric: """This endpoint is used to list [metrics](/core-concepts#metric). It returns @@ -249,7 +249,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BillableMetricModel, + cast_to=BillableMetric, ) @@ -288,7 +288,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BillableMetricModel: + ) -> BillableMetric: """ This endpoint is used to create a [metric](/core-concepts###metric) using a SQL string. See [SQL support](/extensibility/advanced-metrics#sql-support) for a @@ -336,7 +336,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BillableMetricModel, + cast_to=BillableMetric, ) async def update( @@ -351,7 +351,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BillableMetricModel: + ) -> BillableMetric: """This endpoint allows you to update the `metadata` property on a metric. If you @@ -385,7 +385,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BillableMetricModel, + cast_to=BillableMetric, ) def list( @@ -403,7 +403,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[BillableMetricModel, AsyncPage[BillableMetricModel]]: + ) -> AsyncPaginator[BillableMetric, AsyncPage[BillableMetric]]: """ This endpoint is used to fetch [metric](/core-concepts##metric) details given a metric identifier. It returns information about the metrics including its name, @@ -425,7 +425,7 @@ def list( """ return self._get_api_list( "/metrics", - page=AsyncPage[BillableMetricModel], + page=AsyncPage[BillableMetric], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -443,7 +443,7 @@ def list( metric_list_params.MetricListParams, ), ), - model=BillableMetricModel, + model=BillableMetric, ) async def fetch( @@ -456,7 +456,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BillableMetricModel: + ) -> BillableMetric: """This endpoint is used to list [metrics](/core-concepts#metric). It returns @@ -478,7 +478,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BillableMetricModel, + cast_to=BillableMetric, ) diff --git a/src/orb/resources/plans/external_plan_id.py b/src/orb/resources/plans/external_plan_id.py index a8db29ef..69d7b5b0 100644 --- a/src/orb/resources/plans/external_plan_id.py +++ b/src/orb/resources/plans/external_plan_id.py @@ -15,9 +15,9 @@ from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ...types.plan import Plan from ...types.plans import external_plan_id_update_params from ..._base_client import make_request_options -from ...types.shared.plan_model import PlanModel __all__ = ["ExternalPlanID", "AsyncExternalPlanID"] @@ -55,7 +55,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PlanModel: + ) -> Plan: """ This endpoint can be used to update the `external_plan_id`, and `metadata` of an existing plan. @@ -101,7 +101,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=PlanModel, + cast_to=Plan, ) def fetch( @@ -114,7 +114,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PlanModel: + ) -> Plan: """ This endpoint is used to fetch [plan](/core-concepts##plan-and-price) details given an external_plan_id identifier. It returns information about the prices @@ -149,7 +149,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PlanModel, + cast_to=Plan, ) @@ -186,7 +186,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PlanModel: + ) -> Plan: """ This endpoint can be used to update the `external_plan_id`, and `metadata` of an existing plan. @@ -232,7 +232,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=PlanModel, + cast_to=Plan, ) async def fetch( @@ -245,7 +245,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PlanModel: + ) -> Plan: """ This endpoint is used to fetch [plan](/core-concepts##plan-and-price) details given an external_plan_id identifier. It returns information about the prices @@ -280,7 +280,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PlanModel, + cast_to=Plan, ) diff --git a/src/orb/resources/plans/plans.py b/src/orb/resources/plans/plans.py index 8f979a71..c1ad4691 100644 --- a/src/orb/resources/plans/plans.py +++ b/src/orb/resources/plans/plans.py @@ -19,6 +19,7 @@ from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ...pagination import SyncPage, AsyncPage +from ...types.plan import Plan from ..._base_client import AsyncPaginator, make_request_options from .external_plan_id import ( ExternalPlanID, @@ -28,7 +29,6 @@ ExternalPlanIDWithStreamingResponse, AsyncExternalPlanIDWithStreamingResponse, ) -from ...types.shared.plan_model import PlanModel __all__ = ["Plans", "AsyncPlans"] @@ -75,7 +75,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PlanModel: + ) -> Plan: """ This endpoint allows creation of plans including their prices. @@ -131,7 +131,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=PlanModel, + cast_to=Plan, ) def update( @@ -147,7 +147,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PlanModel: + ) -> Plan: """ This endpoint can be used to update the `external_plan_id`, and `metadata` of an existing plan. @@ -191,7 +191,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=PlanModel, + cast_to=Plan, ) def list( @@ -210,7 +210,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[PlanModel]: + ) -> SyncPage[Plan]: """ This endpoint returns a list of all [plans](/core-concepts#plan-and-price) for an account in a list format. The list of plans is ordered starting from the most @@ -236,7 +236,7 @@ def list( """ return self._get_api_list( "/plans", - page=SyncPage[PlanModel], + page=SyncPage[Plan], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -255,7 +255,7 @@ def list( plan_list_params.PlanListParams, ), ), - model=PlanModel, + model=Plan, ) def fetch( @@ -268,7 +268,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PlanModel: + ) -> Plan: """ This endpoint is used to fetch [plan](/core-concepts#plan-and-price) details given a plan identifier. It returns information about the prices included in the @@ -304,7 +304,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PlanModel, + cast_to=Plan, ) @@ -350,7 +350,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PlanModel: + ) -> Plan: """ This endpoint allows creation of plans including their prices. @@ -406,7 +406,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=PlanModel, + cast_to=Plan, ) async def update( @@ -422,7 +422,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PlanModel: + ) -> Plan: """ This endpoint can be used to update the `external_plan_id`, and `metadata` of an existing plan. @@ -466,7 +466,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=PlanModel, + cast_to=Plan, ) def list( @@ -485,7 +485,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PlanModel, AsyncPage[PlanModel]]: + ) -> AsyncPaginator[Plan, AsyncPage[Plan]]: """ This endpoint returns a list of all [plans](/core-concepts#plan-and-price) for an account in a list format. The list of plans is ordered starting from the most @@ -511,7 +511,7 @@ def list( """ return self._get_api_list( "/plans", - page=AsyncPage[PlanModel], + page=AsyncPage[Plan], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -530,7 +530,7 @@ def list( plan_list_params.PlanListParams, ), ), - model=PlanModel, + model=Plan, ) async def fetch( @@ -543,7 +543,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PlanModel: + ) -> Plan: """ This endpoint is used to fetch [plan](/core-concepts#plan-and-price) details given a plan identifier. It returns information about the prices included in the @@ -579,7 +579,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PlanModel, + cast_to=Plan, ) diff --git a/src/orb/resources/prices/external_price_id.py b/src/orb/resources/prices/external_price_id.py index 8d1408a5..4fbfe25e 100644 --- a/src/orb/resources/prices/external_price_id.py +++ b/src/orb/resources/prices/external_price_id.py @@ -15,9 +15,9 @@ from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ...types.price import Price from ..._base_client import make_request_options from ...types.prices import external_price_id_update_params -from ...types.shared.price_model import PriceModel __all__ = ["ExternalPriceID", "AsyncExternalPriceID"] @@ -54,7 +54,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """This endpoint allows you to update the `metadata` property on a price. If you @@ -79,7 +79,7 @@ def update( if not external_price_id: raise ValueError(f"Expected a non-empty value for `external_price_id` but received {external_price_id!r}") return cast( - PriceModel, + Price, self._put( f"/prices/external_price_id/{external_price_id}", body=maybe_transform( @@ -92,7 +92,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system ), ) @@ -106,7 +106,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PriceModel: + ) -> Price: """This endpoint returns a price given an external price id. See the @@ -125,13 +125,13 @@ def fetch( if not external_price_id: raise ValueError(f"Expected a non-empty value for `external_price_id` but received {external_price_id!r}") return cast( - PriceModel, + Price, self._get( f"/prices/external_price_id/{external_price_id}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system ), ) @@ -168,7 +168,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """This endpoint allows you to update the `metadata` property on a price. If you @@ -193,7 +193,7 @@ async def update( if not external_price_id: raise ValueError(f"Expected a non-empty value for `external_price_id` but received {external_price_id!r}") return cast( - PriceModel, + Price, await self._put( f"/prices/external_price_id/{external_price_id}", body=await async_maybe_transform( @@ -206,7 +206,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system ), ) @@ -220,7 +220,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PriceModel: + ) -> Price: """This endpoint returns a price given an external price id. See the @@ -239,13 +239,13 @@ async def fetch( if not external_price_id: raise ValueError(f"Expected a non-empty value for `external_price_id` but received {external_price_id!r}") return cast( - PriceModel, + Price, await self._get( f"/prices/external_price_id/{external_price_id}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/orb/resources/prices/prices.py b/src/orb/resources/prices/prices.py index f750b5b6..608900f9 100644 --- a/src/orb/resources/prices/prices.py +++ b/src/orb/resources/prices/prices.py @@ -9,12 +9,7 @@ import httpx from ... import _legacy_response -from ...types import ( - price_list_params, - price_create_params, - price_update_params, - price_evaluate_params, -) +from ...types import price_list_params, price_create_params, price_update_params, price_evaluate_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( required_args, @@ -25,6 +20,7 @@ from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ...pagination import SyncPage, AsyncPage +from ...types.price import Price from ..._base_client import AsyncPaginator, make_request_options from .external_price_id import ( ExternalPriceID, @@ -34,19 +30,7 @@ ExternalPriceIDWithStreamingResponse, AsyncExternalPriceIDWithStreamingResponse, ) -from ...types.shared.price_model import PriceModel from ...types.price_evaluate_response import PriceEvaluateResponse -from ...types.shared_params.bps_config_model import BpsConfigModel -from ...types.shared_params.bulk_config_model import BulkConfigModel -from ...types.shared_params.unit_config_model import UnitConfigModel -from ...types.shared_params.matrix_config_model import MatrixConfigModel -from ...types.shared_params.tiered_config_model import TieredConfigModel -from ...types.shared_params.package_config_model import PackageConfigModel -from ...types.shared_params.bulk_bps_config_model import BulkBpsConfigModel -from ...types.shared_params.tiered_bps_config_model import TieredBpsConfigModel -from ...types.shared_params.custom_rating_function_config_model import CustomRatingFunctionConfigModel -from ...types.shared_params.matrix_with_allocation_config_model import MatrixWithAllocationConfigModel -from ...types.shared_params.new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel __all__ = ["Prices", "AsyncPrices"] @@ -84,15 +68,17 @@ def create( item_id: str, model_type: Literal["unit"], name: str, - unit_config: UnitConfigModel, + unit_config: price_create_params.NewFloatingUnitPriceUnitConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -101,7 +87,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -169,15 +155,17 @@ def create( item_id: str, model_type: Literal["package"], name: str, - package_config: PackageConfigModel, + package_config: price_create_params.NewFloatingPackagePricePackageConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingPackagePriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingPackagePriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -186,7 +174,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -252,17 +240,19 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - matrix_config: MatrixConfigModel, + matrix_config: price_create_params.NewFloatingMatrixPriceMatrixConfig, model_type: Literal["matrix"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingMatrixPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingMatrixPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -271,7 +261,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -337,17 +327,23 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - matrix_with_allocation_config: MatrixWithAllocationConfigModel, + matrix_with_allocation_config: price_create_params.NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig, model_type: Literal["matrix_with_allocation"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -356,7 +352,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -424,15 +420,17 @@ def create( item_id: str, model_type: Literal["tiered"], name: str, - tiered_config: TieredConfigModel, + tiered_config: price_create_params.NewFloatingTieredPriceTieredConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingTieredPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingTieredPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -441,7 +439,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -509,15 +507,19 @@ def create( item_id: str, model_type: Literal["tiered_bps"], name: str, - tiered_bps_config: TieredBpsConfigModel, + tiered_bps_config: price_create_params.NewFloatingTieredBpsPriceTieredBpsConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingTieredBpsPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredBpsPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -526,7 +528,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -589,7 +591,7 @@ def create( def create( self, *, - bps_config: BpsConfigModel, + bps_config: price_create_params.NewFloatingBpsPriceBpsConfig, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -597,12 +599,14 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingBpsPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBpsPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -611,7 +615,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -674,7 +678,7 @@ def create( def create( self, *, - bulk_bps_config: BulkBpsConfigModel, + bulk_bps_config: price_create_params.NewFloatingBulkBpsPriceBulkBpsConfig, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -682,12 +686,14 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingBulkBpsPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBulkBpsPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -696,7 +702,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -759,7 +765,7 @@ def create( def create( self, *, - bulk_config: BulkConfigModel, + bulk_config: price_create_params.NewFloatingBulkPriceBulkConfig, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -767,12 +773,14 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingBulkPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBulkPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -781,7 +789,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -849,15 +857,21 @@ def create( item_id: str, model_type: Literal["threshold_total_amount"], name: str, - threshold_total_amount_config: CustomRatingFunctionConfigModel, + threshold_total_amount_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -866,7 +880,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -934,15 +948,21 @@ def create( item_id: str, model_type: Literal["tiered_package"], name: str, - tiered_package_config: CustomRatingFunctionConfigModel, + tiered_package_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackagePriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackagePriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -951,7 +971,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1016,18 +1036,24 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_tiered_config: CustomRatingFunctionConfigModel, + grouped_tiered_config: Dict[str, object], item_id: str, model_type: Literal["grouped_tiered"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedTieredPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedTieredPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1036,7 +1062,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1102,17 +1128,23 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - max_group_tiered_package_config: CustomRatingFunctionConfigModel, + max_group_tiered_package_config: Dict[str, object], model_type: Literal["max_group_tiered_package"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1121,7 +1153,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1189,15 +1221,21 @@ def create( item_id: str, model_type: Literal["tiered_with_minimum"], name: str, - tiered_with_minimum_config: CustomRatingFunctionConfigModel, + tiered_with_minimum_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithMinimumPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1206,7 +1244,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1274,15 +1312,21 @@ def create( item_id: str, model_type: Literal["package_with_allocation"], name: str, - package_with_allocation_config: CustomRatingFunctionConfigModel, + package_with_allocation_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingPackageWithAllocationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1291,7 +1335,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1359,15 +1403,21 @@ def create( item_id: str, model_type: Literal["tiered_package_with_minimum"], name: str, - tiered_package_with_minimum_config: CustomRatingFunctionConfigModel, + tiered_package_with_minimum_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1376,7 +1426,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1444,15 +1494,21 @@ def create( item_id: str, model_type: Literal["unit_with_percent"], name: str, - unit_with_percent_config: CustomRatingFunctionConfigModel, + unit_with_percent_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithPercentPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1461,7 +1517,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1529,15 +1585,21 @@ def create( item_id: str, model_type: Literal["tiered_with_proration"], name: str, - tiered_with_proration_config: CustomRatingFunctionConfigModel, + tiered_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithProrationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1546,7 +1608,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1614,15 +1676,21 @@ def create( item_id: str, model_type: Literal["unit_with_proration"], name: str, - unit_with_proration_config: CustomRatingFunctionConfigModel, + unit_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithProrationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1631,7 +1699,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1696,18 +1764,24 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_allocation_config: CustomRatingFunctionConfigModel, + grouped_allocation_config: Dict[str, object], item_id: str, model_type: Literal["grouped_allocation"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedAllocationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1716,7 +1790,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1781,18 +1855,24 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel, + grouped_with_prorated_minimum_config: Dict[str, object], item_id: str, model_type: Literal["grouped_with_prorated_minimum"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1801,7 +1881,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1866,18 +1946,24 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel, + grouped_with_metered_minimum_config: Dict[str, object], item_id: str, model_type: Literal["grouped_with_metered_minimum"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1886,7 +1972,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1952,17 +2038,23 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - matrix_with_display_name_config: CustomRatingFunctionConfigModel, + matrix_with_display_name_config: Dict[str, object], model_type: Literal["matrix_with_display_name"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1971,7 +2063,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2034,7 +2126,7 @@ def create( def create( self, *, - bulk_with_proration_config: CustomRatingFunctionConfigModel, + bulk_with_proration_config: Dict[str, object], cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -2042,12 +2134,18 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingBulkWithProrationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2056,7 +2154,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2121,18 +2219,24 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_tiered_package_config: CustomRatingFunctionConfigModel, + grouped_tiered_package_config: Dict[str, object], item_id: str, model_type: Literal["grouped_tiered_package"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2141,7 +2245,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2209,15 +2313,21 @@ def create( item_id: str, model_type: Literal["scalable_matrix_with_unit_pricing"], name: str, - scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel, + scalable_matrix_with_unit_pricing_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2226,7 +2336,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2294,15 +2404,21 @@ def create( item_id: str, model_type: Literal["scalable_matrix_with_tiered_pricing"], name: str, - scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel, + scalable_matrix_with_tiered_pricing_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2311,7 +2427,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2375,19 +2491,25 @@ def create( self, *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], - cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel, + cumulative_grouped_bulk_config: Dict[str, object], currency: str, item_id: str, model_type: Literal["cumulative_grouped_bulk"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2396,7 +2518,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2520,43 +2642,46 @@ def create( | Literal["scalable_matrix_with_tiered_pricing"] | Literal["cumulative_grouped_bulk"], name: str, - unit_config: UnitConfigModel | NotGiven = NOT_GIVEN, + unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, - package_config: PackageConfigModel | NotGiven = NOT_GIVEN, - matrix_config: MatrixConfigModel | NotGiven = NOT_GIVEN, - matrix_with_allocation_config: MatrixWithAllocationConfigModel | NotGiven = NOT_GIVEN, - tiered_config: TieredConfigModel | NotGiven = NOT_GIVEN, - tiered_bps_config: TieredBpsConfigModel | NotGiven = NOT_GIVEN, - bps_config: BpsConfigModel | NotGiven = NOT_GIVEN, - bulk_bps_config: BulkBpsConfigModel | NotGiven = NOT_GIVEN, - bulk_config: BulkConfigModel | NotGiven = NOT_GIVEN, - threshold_total_amount_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - tiered_package_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - grouped_tiered_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - max_group_tiered_package_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - tiered_with_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - package_with_allocation_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - tiered_package_with_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - unit_with_percent_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - tiered_with_proration_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - unit_with_proration_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - grouped_allocation_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - matrix_with_display_name_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - bulk_with_proration_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - grouped_tiered_package_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + package_config: price_create_params.NewFloatingPackagePricePackageConfig | NotGiven = NOT_GIVEN, + matrix_config: price_create_params.NewFloatingMatrixPriceMatrixConfig | NotGiven = NOT_GIVEN, + matrix_with_allocation_config: price_create_params.NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig + | NotGiven = NOT_GIVEN, + tiered_config: price_create_params.NewFloatingTieredPriceTieredConfig | NotGiven = NOT_GIVEN, + tiered_bps_config: price_create_params.NewFloatingTieredBpsPriceTieredBpsConfig | NotGiven = NOT_GIVEN, + bps_config: price_create_params.NewFloatingBpsPriceBpsConfig | NotGiven = NOT_GIVEN, + bulk_bps_config: price_create_params.NewFloatingBulkBpsPriceBulkBpsConfig | NotGiven = NOT_GIVEN, + bulk_config: price_create_params.NewFloatingBulkPriceBulkConfig | NotGiven = NOT_GIVEN, + threshold_total_amount_config: Dict[str, object] | NotGiven = NOT_GIVEN, + tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, + grouped_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN, + max_group_tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, + tiered_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, + package_with_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN, + tiered_package_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, + unit_with_percent_config: Dict[str, object] | NotGiven = NOT_GIVEN, + tiered_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, + unit_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, + grouped_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN, + grouped_with_prorated_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, + grouped_with_metered_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, + matrix_with_display_name_config: Dict[str, object] | NotGiven = NOT_GIVEN, + bulk_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, + grouped_tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, + scalable_matrix_with_unit_pricing_config: Dict[str, object] | NotGiven = NOT_GIVEN, + scalable_matrix_with_tiered_pricing_config: Dict[str, object] | NotGiven = NOT_GIVEN, + cumulative_grouped_bulk_config: Dict[str, object] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2564,9 +2689,9 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: return cast( - PriceModel, + Price, self._post( "/prices", body=maybe_transform( @@ -2623,7 +2748,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system ), ) @@ -2639,7 +2764,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """This endpoint allows you to update the `metadata` property on a price. If you @@ -2664,7 +2789,7 @@ def update( if not price_id: raise ValueError(f"Expected a non-empty value for `price_id` but received {price_id!r}") return cast( - PriceModel, + Price, self._put( f"/prices/{price_id}", body=maybe_transform({"metadata": metadata}, price_update_params.PriceUpdateParams), @@ -2675,7 +2800,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system ), ) @@ -2690,7 +2815,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[PriceModel]: + ) -> SyncPage[Price]: """ This endpoint is used to list all add-on prices created using the [price creation endpoint](/api-reference/price/create-price). @@ -2711,7 +2836,7 @@ def list( """ return self._get_api_list( "/prices", - page=SyncPage[PriceModel], + page=SyncPage[Price], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2725,7 +2850,7 @@ def list( price_list_params.PriceListParams, ), ), - model=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system + model=cast(Any, Price), # Union types cannot be passed in as arguments in the type system ) def evaluate( @@ -2831,7 +2956,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PriceModel: + ) -> Price: """ This endpoint returns a price given an identifier. @@ -2847,13 +2972,13 @@ def fetch( if not price_id: raise ValueError(f"Expected a non-empty value for `price_id` but received {price_id!r}") return cast( - PriceModel, + Price, self._get( f"/prices/{price_id}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system ), ) @@ -2891,15 +3016,17 @@ async def create( item_id: str, model_type: Literal["unit"], name: str, - unit_config: UnitConfigModel, + unit_config: price_create_params.NewFloatingUnitPriceUnitConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2908,7 +3035,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2976,15 +3103,17 @@ async def create( item_id: str, model_type: Literal["package"], name: str, - package_config: PackageConfigModel, + package_config: price_create_params.NewFloatingPackagePricePackageConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingPackagePriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingPackagePriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2993,7 +3122,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3059,17 +3188,19 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - matrix_config: MatrixConfigModel, + matrix_config: price_create_params.NewFloatingMatrixPriceMatrixConfig, model_type: Literal["matrix"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingMatrixPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingMatrixPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3078,7 +3209,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3144,17 +3275,23 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - matrix_with_allocation_config: MatrixWithAllocationConfigModel, + matrix_with_allocation_config: price_create_params.NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig, model_type: Literal["matrix_with_allocation"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3163,7 +3300,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3231,15 +3368,17 @@ async def create( item_id: str, model_type: Literal["tiered"], name: str, - tiered_config: TieredConfigModel, + tiered_config: price_create_params.NewFloatingTieredPriceTieredConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingTieredPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingTieredPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3248,7 +3387,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3316,15 +3455,19 @@ async def create( item_id: str, model_type: Literal["tiered_bps"], name: str, - tiered_bps_config: TieredBpsConfigModel, + tiered_bps_config: price_create_params.NewFloatingTieredBpsPriceTieredBpsConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingTieredBpsPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredBpsPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3333,7 +3476,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3396,7 +3539,7 @@ async def create( async def create( self, *, - bps_config: BpsConfigModel, + bps_config: price_create_params.NewFloatingBpsPriceBpsConfig, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -3404,12 +3547,14 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingBpsPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBpsPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3418,7 +3563,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3481,7 +3626,7 @@ async def create( async def create( self, *, - bulk_bps_config: BulkBpsConfigModel, + bulk_bps_config: price_create_params.NewFloatingBulkBpsPriceBulkBpsConfig, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -3489,12 +3634,14 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingBulkBpsPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBulkBpsPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3503,7 +3650,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3566,7 +3713,7 @@ async def create( async def create( self, *, - bulk_config: BulkConfigModel, + bulk_config: price_create_params.NewFloatingBulkPriceBulkConfig, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -3574,12 +3721,14 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingBulkPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBulkPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3588,7 +3737,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3656,15 +3805,21 @@ async def create( item_id: str, model_type: Literal["threshold_total_amount"], name: str, - threshold_total_amount_config: CustomRatingFunctionConfigModel, + threshold_total_amount_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3673,7 +3828,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3741,15 +3896,21 @@ async def create( item_id: str, model_type: Literal["tiered_package"], name: str, - tiered_package_config: CustomRatingFunctionConfigModel, + tiered_package_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackagePriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackagePriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3758,7 +3919,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3823,18 +3984,24 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_tiered_config: CustomRatingFunctionConfigModel, + grouped_tiered_config: Dict[str, object], item_id: str, model_type: Literal["grouped_tiered"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedTieredPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedTieredPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3843,7 +4010,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3909,17 +4076,23 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - max_group_tiered_package_config: CustomRatingFunctionConfigModel, + max_group_tiered_package_config: Dict[str, object], model_type: Literal["max_group_tiered_package"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3928,7 +4101,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3996,15 +4169,21 @@ async def create( item_id: str, model_type: Literal["tiered_with_minimum"], name: str, - tiered_with_minimum_config: CustomRatingFunctionConfigModel, + tiered_with_minimum_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithMinimumPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4013,7 +4192,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4081,15 +4260,21 @@ async def create( item_id: str, model_type: Literal["package_with_allocation"], name: str, - package_with_allocation_config: CustomRatingFunctionConfigModel, + package_with_allocation_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingPackageWithAllocationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4098,7 +4283,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4166,15 +4351,21 @@ async def create( item_id: str, model_type: Literal["tiered_package_with_minimum"], name: str, - tiered_package_with_minimum_config: CustomRatingFunctionConfigModel, + tiered_package_with_minimum_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4183,7 +4374,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4251,15 +4442,21 @@ async def create( item_id: str, model_type: Literal["unit_with_percent"], name: str, - unit_with_percent_config: CustomRatingFunctionConfigModel, + unit_with_percent_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithPercentPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4268,7 +4465,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4336,15 +4533,21 @@ async def create( item_id: str, model_type: Literal["tiered_with_proration"], name: str, - tiered_with_proration_config: CustomRatingFunctionConfigModel, + tiered_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithProrationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4353,7 +4556,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4421,15 +4624,21 @@ async def create( item_id: str, model_type: Literal["unit_with_proration"], name: str, - unit_with_proration_config: CustomRatingFunctionConfigModel, + unit_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithProrationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4438,7 +4647,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4503,18 +4712,24 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_allocation_config: CustomRatingFunctionConfigModel, + grouped_allocation_config: Dict[str, object], item_id: str, model_type: Literal["grouped_allocation"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedAllocationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4523,7 +4738,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4588,18 +4803,24 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel, + grouped_with_prorated_minimum_config: Dict[str, object], item_id: str, model_type: Literal["grouped_with_prorated_minimum"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4608,7 +4829,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4673,18 +4894,24 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel, + grouped_with_metered_minimum_config: Dict[str, object], item_id: str, model_type: Literal["grouped_with_metered_minimum"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4693,7 +4920,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4759,17 +4986,23 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - matrix_with_display_name_config: CustomRatingFunctionConfigModel, + matrix_with_display_name_config: Dict[str, object], model_type: Literal["matrix_with_display_name"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4778,7 +5011,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4841,7 +5074,7 @@ async def create( async def create( self, *, - bulk_with_proration_config: CustomRatingFunctionConfigModel, + bulk_with_proration_config: Dict[str, object], cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -4849,12 +5082,18 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingBulkWithProrationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4863,7 +5102,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4928,18 +5167,24 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_tiered_package_config: CustomRatingFunctionConfigModel, + grouped_tiered_package_config: Dict[str, object], item_id: str, model_type: Literal["grouped_tiered_package"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4948,7 +5193,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -5016,15 +5261,21 @@ async def create( item_id: str, model_type: Literal["scalable_matrix_with_unit_pricing"], name: str, - scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel, + scalable_matrix_with_unit_pricing_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5033,7 +5284,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -5101,15 +5352,21 @@ async def create( item_id: str, model_type: Literal["scalable_matrix_with_tiered_pricing"], name: str, - scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel, + scalable_matrix_with_tiered_pricing_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5118,7 +5375,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -5182,19 +5439,25 @@ async def create( self, *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], - cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel, + cumulative_grouped_bulk_config: Dict[str, object], currency: str, item_id: str, model_type: Literal["cumulative_grouped_bulk"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5203,7 +5466,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -5327,43 +5590,46 @@ async def create( | Literal["scalable_matrix_with_tiered_pricing"] | Literal["cumulative_grouped_bulk"], name: str, - unit_config: UnitConfigModel | NotGiven = NOT_GIVEN, + unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, - package_config: PackageConfigModel | NotGiven = NOT_GIVEN, - matrix_config: MatrixConfigModel | NotGiven = NOT_GIVEN, - matrix_with_allocation_config: MatrixWithAllocationConfigModel | NotGiven = NOT_GIVEN, - tiered_config: TieredConfigModel | NotGiven = NOT_GIVEN, - tiered_bps_config: TieredBpsConfigModel | NotGiven = NOT_GIVEN, - bps_config: BpsConfigModel | NotGiven = NOT_GIVEN, - bulk_bps_config: BulkBpsConfigModel | NotGiven = NOT_GIVEN, - bulk_config: BulkConfigModel | NotGiven = NOT_GIVEN, - threshold_total_amount_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - tiered_package_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - grouped_tiered_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - max_group_tiered_package_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - tiered_with_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - package_with_allocation_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - tiered_package_with_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - unit_with_percent_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - tiered_with_proration_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - unit_with_proration_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - grouped_allocation_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - matrix_with_display_name_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - bulk_with_proration_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - grouped_tiered_package_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, - cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + package_config: price_create_params.NewFloatingPackagePricePackageConfig | NotGiven = NOT_GIVEN, + matrix_config: price_create_params.NewFloatingMatrixPriceMatrixConfig | NotGiven = NOT_GIVEN, + matrix_with_allocation_config: price_create_params.NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig + | NotGiven = NOT_GIVEN, + tiered_config: price_create_params.NewFloatingTieredPriceTieredConfig | NotGiven = NOT_GIVEN, + tiered_bps_config: price_create_params.NewFloatingTieredBpsPriceTieredBpsConfig | NotGiven = NOT_GIVEN, + bps_config: price_create_params.NewFloatingBpsPriceBpsConfig | NotGiven = NOT_GIVEN, + bulk_bps_config: price_create_params.NewFloatingBulkBpsPriceBulkBpsConfig | NotGiven = NOT_GIVEN, + bulk_config: price_create_params.NewFloatingBulkPriceBulkConfig | NotGiven = NOT_GIVEN, + threshold_total_amount_config: Dict[str, object] | NotGiven = NOT_GIVEN, + tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, + grouped_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN, + max_group_tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, + tiered_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, + package_with_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN, + tiered_package_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, + unit_with_percent_config: Dict[str, object] | NotGiven = NOT_GIVEN, + tiered_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, + unit_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, + grouped_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN, + grouped_with_prorated_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, + grouped_with_metered_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, + matrix_with_display_name_config: Dict[str, object] | NotGiven = NOT_GIVEN, + bulk_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, + grouped_tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, + scalable_matrix_with_unit_pricing_config: Dict[str, object] | NotGiven = NOT_GIVEN, + scalable_matrix_with_tiered_pricing_config: Dict[str, object] | NotGiven = NOT_GIVEN, + cumulative_grouped_bulk_config: Dict[str, object] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5371,9 +5637,9 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: return cast( - PriceModel, + Price, await self._post( "/prices", body=await async_maybe_transform( @@ -5430,7 +5696,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system ), ) @@ -5446,7 +5712,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> PriceModel: + ) -> Price: """This endpoint allows you to update the `metadata` property on a price. If you @@ -5471,7 +5737,7 @@ async def update( if not price_id: raise ValueError(f"Expected a non-empty value for `price_id` but received {price_id!r}") return cast( - PriceModel, + Price, await self._put( f"/prices/{price_id}", body=await async_maybe_transform({"metadata": metadata}, price_update_params.PriceUpdateParams), @@ -5482,7 +5748,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system ), ) @@ -5497,7 +5763,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PriceModel, AsyncPage[PriceModel]]: + ) -> AsyncPaginator[Price, AsyncPage[Price]]: """ This endpoint is used to list all add-on prices created using the [price creation endpoint](/api-reference/price/create-price). @@ -5518,7 +5784,7 @@ def list( """ return self._get_api_list( "/prices", - page=AsyncPage[PriceModel], + page=AsyncPage[Price], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -5532,7 +5798,7 @@ def list( price_list_params.PriceListParams, ), ), - model=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system + model=cast(Any, Price), # Union types cannot be passed in as arguments in the type system ) async def evaluate( @@ -5638,7 +5904,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PriceModel: + ) -> Price: """ This endpoint returns a price given an identifier. @@ -5654,13 +5920,13 @@ async def fetch( if not price_id: raise ValueError(f"Expected a non-empty value for `price_id` but received {price_id!r}") return cast( - PriceModel, + Price, await self._get( f"/prices/{price_id}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/orb/resources/subscriptions.py b/src/orb/resources/subscriptions.py index 34291afc..bc0ca16b 100644 --- a/src/orb/resources/subscriptions.py +++ b/src/orb/resources/subscriptions.py @@ -34,18 +34,30 @@ from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage from .._base_client import AsyncPaginator, make_request_options +from ..types.subscription import Subscription from ..types.subscription_usage import SubscriptionUsage -from ..types.shared.subscription_model import SubscriptionModel -from ..types.shared.mutated_subscription_model import MutatedSubscriptionModel +from ..types.subscription_cancel_response import SubscriptionCancelResponse +from ..types.subscription_create_response import SubscriptionCreateResponse from ..types.subscription_fetch_costs_response import SubscriptionFetchCostsResponse +from ..types.subscription_update_trial_response import SubscriptionUpdateTrialResponse +from ..types.subscription_trigger_phase_response import SubscriptionTriggerPhaseResponse from ..types.subscription_fetch_schedule_response import SubscriptionFetchScheduleResponse +from ..types.subscription_price_intervals_response import SubscriptionPriceIntervalsResponse +from ..types.subscription_schedule_plan_change_response import SubscriptionSchedulePlanChangeResponse from ..types.shared_params.add_subscription_price_params import AddSubscriptionPriceParams +from ..types.subscription_unschedule_cancellation_response import SubscriptionUnscheduleCancellationResponse from ..types.shared_params.remove_subscription_price_params import RemoveSubscriptionPriceParams from ..types.shared_params.replace_subscription_price_params import ReplaceSubscriptionPriceParams +from ..types.subscription_update_fixed_fee_quantity_response import SubscriptionUpdateFixedFeeQuantityResponse from ..types.shared_params.add_subscription_adjustment_params import AddSubscriptionAdjustmentParams from ..types.shared_params.remove_subscription_adjustment_params import RemoveSubscriptionAdjustmentParams from ..types.shared_params.replace_subscription_adjustment_params import ReplaceSubscriptionAdjustmentParams -from ..types.shared_params.billing_cycle_anchor_configuration_model import BillingCycleAnchorConfigurationModel +from ..types.subscription_unschedule_pending_plan_changes_response import ( + SubscriptionUnschedulePendingPlanChangesResponse, +) +from ..types.subscription_unschedule_fixed_fee_quantity_updates_response import ( + SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, +) __all__ = ["Subscriptions", "AsyncSubscriptions"] @@ -78,7 +90,8 @@ def create( align_billing_with_subscription_start_date: bool | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, aws_region: Optional[str] | NotGiven = NOT_GIVEN, - billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_anchor_configuration: Optional[subscription_create_params.BillingCycleAnchorConfiguration] + | NotGiven = NOT_GIVEN, coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, customer_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -111,7 +124,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionCreateResponse: """A subscription represents the purchase of a plan by a customer. The customer is @@ -498,7 +511,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionCreateResponse, ) def update( @@ -517,7 +530,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionModel: + ) -> Subscription: """ This endpoint can be used to update the `metadata`, `net terms`, `auto_collection`, `invoicing_threshold`, and `default_invoice_memo` properties @@ -575,7 +588,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionModel, + cast_to=Subscription, ) def list( @@ -596,7 +609,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[SubscriptionModel]: + ) -> SyncPage[Subscription]: """ This endpoint returns a list of all subscriptions for an account as a [paginated](/api-reference/pagination) list, ordered starting from the most @@ -624,7 +637,7 @@ def list( """ return self._get_api_list( "/subscriptions", - page=SyncPage[SubscriptionModel], + page=SyncPage[Subscription], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -645,7 +658,7 @@ def list( subscription_list_params.SubscriptionListParams, ), ), - model=SubscriptionModel, + model=Subscription, ) def cancel( @@ -662,7 +675,7 @@ def cancel( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionCancelResponse: """This endpoint can be used to cancel an existing subscription. It returns the @@ -766,7 +779,7 @@ def cancel( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionCancelResponse, ) def fetch( @@ -779,7 +792,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionModel: + ) -> Subscription: """ This endpoint is used to fetch a [Subscription](/core-concepts##subscription) given an identifier. @@ -800,7 +813,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=SubscriptionModel, + cast_to=Subscription, ) def fetch_costs( @@ -1225,7 +1238,7 @@ def price_intervals( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionPriceIntervalsResponse: """ This endpoint is used to add and edit subscription [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By @@ -1344,7 +1357,7 @@ def price_intervals( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionPriceIntervalsResponse, ) def schedule_plan_change( @@ -1358,7 +1371,10 @@ def schedule_plan_change( auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] | NotGiven = NOT_GIVEN, - billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_anchor_configuration: Optional[ + subscription_schedule_plan_change_params.BillingCycleAnchorConfiguration + ] + | NotGiven = NOT_GIVEN, change_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, @@ -1385,7 +1401,7 @@ def schedule_plan_change( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionSchedulePlanChangeResponse: """This endpoint can be used to change an existing subscription's plan. It returns @@ -1703,7 +1719,7 @@ def schedule_plan_change( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionSchedulePlanChangeResponse, ) def trigger_phase( @@ -1719,7 +1735,7 @@ def trigger_phase( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionTriggerPhaseResponse: """ Manually trigger a phase, effective the given date (or the current time, if not specified). @@ -1760,7 +1776,7 @@ def trigger_phase( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionTriggerPhaseResponse, ) def unschedule_cancellation( @@ -1774,7 +1790,7 @@ def unschedule_cancellation( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionUnscheduleCancellationResponse: """ This endpoint can be used to unschedule any pending cancellations for a subscription. @@ -1805,7 +1821,7 @@ def unschedule_cancellation( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionUnscheduleCancellationResponse, ) def unschedule_fixed_fee_quantity_updates( @@ -1820,7 +1836,7 @@ def unschedule_fixed_fee_quantity_updates( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse: """ This endpoint can be used to clear scheduled updates to the quantity for a fixed fee. @@ -1856,7 +1872,7 @@ def unschedule_fixed_fee_quantity_updates( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, ) def unschedule_pending_plan_changes( @@ -1870,7 +1886,7 @@ def unschedule_pending_plan_changes( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionUnschedulePendingPlanChangesResponse: """ This endpoint can be used to unschedule any pending plan changes on an existing subscription. @@ -1897,7 +1913,7 @@ def unschedule_pending_plan_changes( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionUnschedulePendingPlanChangesResponse, ) def update_fixed_fee_quantity( @@ -1916,7 +1932,7 @@ def update_fixed_fee_quantity( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionUpdateFixedFeeQuantityResponse: """ This endpoint can be used to update the quantity for a fixed fee. @@ -1979,7 +1995,7 @@ def update_fixed_fee_quantity( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionUpdateFixedFeeQuantityResponse, ) def update_trial( @@ -1995,7 +2011,7 @@ def update_trial( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionUpdateTrialResponse: """This endpoint is used to update the trial end date for a subscription. The new @@ -2052,7 +2068,7 @@ def update_trial( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionUpdateTrialResponse, ) @@ -2084,7 +2100,8 @@ async def create( align_billing_with_subscription_start_date: bool | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, aws_region: Optional[str] | NotGiven = NOT_GIVEN, - billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_anchor_configuration: Optional[subscription_create_params.BillingCycleAnchorConfiguration] + | NotGiven = NOT_GIVEN, coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, customer_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -2117,7 +2134,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionCreateResponse: """A subscription represents the purchase of a plan by a customer. The customer is @@ -2504,7 +2521,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionCreateResponse, ) async def update( @@ -2523,7 +2540,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionModel: + ) -> Subscription: """ This endpoint can be used to update the `metadata`, `net terms`, `auto_collection`, `invoicing_threshold`, and `default_invoice_memo` properties @@ -2581,7 +2598,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionModel, + cast_to=Subscription, ) def list( @@ -2602,7 +2619,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[SubscriptionModel, AsyncPage[SubscriptionModel]]: + ) -> AsyncPaginator[Subscription, AsyncPage[Subscription]]: """ This endpoint returns a list of all subscriptions for an account as a [paginated](/api-reference/pagination) list, ordered starting from the most @@ -2630,7 +2647,7 @@ def list( """ return self._get_api_list( "/subscriptions", - page=AsyncPage[SubscriptionModel], + page=AsyncPage[Subscription], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2651,7 +2668,7 @@ def list( subscription_list_params.SubscriptionListParams, ), ), - model=SubscriptionModel, + model=Subscription, ) async def cancel( @@ -2668,7 +2685,7 @@ async def cancel( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionCancelResponse: """This endpoint can be used to cancel an existing subscription. It returns the @@ -2772,7 +2789,7 @@ async def cancel( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionCancelResponse, ) async def fetch( @@ -2785,7 +2802,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubscriptionModel: + ) -> Subscription: """ This endpoint is used to fetch a [Subscription](/core-concepts##subscription) given an identifier. @@ -2806,7 +2823,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=SubscriptionModel, + cast_to=Subscription, ) async def fetch_costs( @@ -3231,7 +3248,7 @@ async def price_intervals( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionPriceIntervalsResponse: """ This endpoint is used to add and edit subscription [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By @@ -3350,7 +3367,7 @@ async def price_intervals( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionPriceIntervalsResponse, ) async def schedule_plan_change( @@ -3364,7 +3381,10 @@ async def schedule_plan_change( auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] | NotGiven = NOT_GIVEN, - billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfigurationModel] | NotGiven = NOT_GIVEN, + billing_cycle_anchor_configuration: Optional[ + subscription_schedule_plan_change_params.BillingCycleAnchorConfiguration + ] + | NotGiven = NOT_GIVEN, change_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, @@ -3391,7 +3411,7 @@ async def schedule_plan_change( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionSchedulePlanChangeResponse: """This endpoint can be used to change an existing subscription's plan. It returns @@ -3709,7 +3729,7 @@ async def schedule_plan_change( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionSchedulePlanChangeResponse, ) async def trigger_phase( @@ -3725,7 +3745,7 @@ async def trigger_phase( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionTriggerPhaseResponse: """ Manually trigger a phase, effective the given date (or the current time, if not specified). @@ -3766,7 +3786,7 @@ async def trigger_phase( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionTriggerPhaseResponse, ) async def unschedule_cancellation( @@ -3780,7 +3800,7 @@ async def unschedule_cancellation( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionUnscheduleCancellationResponse: """ This endpoint can be used to unschedule any pending cancellations for a subscription. @@ -3811,7 +3831,7 @@ async def unschedule_cancellation( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionUnscheduleCancellationResponse, ) async def unschedule_fixed_fee_quantity_updates( @@ -3826,7 +3846,7 @@ async def unschedule_fixed_fee_quantity_updates( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse: """ This endpoint can be used to clear scheduled updates to the quantity for a fixed fee. @@ -3862,7 +3882,7 @@ async def unschedule_fixed_fee_quantity_updates( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, ) async def unschedule_pending_plan_changes( @@ -3876,7 +3896,7 @@ async def unschedule_pending_plan_changes( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionUnschedulePendingPlanChangesResponse: """ This endpoint can be used to unschedule any pending plan changes on an existing subscription. @@ -3903,7 +3923,7 @@ async def unschedule_pending_plan_changes( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionUnschedulePendingPlanChangesResponse, ) async def update_fixed_fee_quantity( @@ -3922,7 +3942,7 @@ async def update_fixed_fee_quantity( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionUpdateFixedFeeQuantityResponse: """ This endpoint can be used to update the quantity for a fixed fee. @@ -3985,7 +4005,7 @@ async def update_fixed_fee_quantity( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionUpdateFixedFeeQuantityResponse, ) async def update_trial( @@ -4001,7 +4021,7 @@ async def update_trial( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> MutatedSubscriptionModel: + ) -> SubscriptionUpdateTrialResponse: """This endpoint is used to update the trial end date for a subscription. The new @@ -4058,7 +4078,7 @@ async def update_trial( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=MutatedSubscriptionModel, + cast_to=SubscriptionUpdateTrialResponse, ) diff --git a/src/orb/types/__init__.py b/src/orb/types/__init__.py index 40f00195..eb07f36d 100644 --- a/src/orb/types/__init__.py +++ b/src/orb/types/__init__.py @@ -2,114 +2,36 @@ from __future__ import annotations +from .item import Item as Item +from .plan import Plan as Plan +from .alert import Alert as Alert +from .price import Price as Price +from .coupon import Coupon as Coupon from .shared import ( Discount as Discount, - ItemModel as ItemModel, - PlanModel as PlanModel, - AlertModel as AlertModel, - PriceModel as PriceModel, - TopUpModel as TopUpModel, - UsageModel as UsageModel, - CouponModel as CouponModel, - TopUpsModel as TopUpsModel, - AddressModel as AddressModel, - InvoiceModel as InvoiceModel, - MaximumModel as MaximumModel, - MinimumModel as MinimumModel, - BackfillModel as BackfillModel, - CustomerModel as CustomerModel, - DiscountModel as DiscountModel, - EditPlanModel as EditPlanModel, - ItemSlimModel as ItemSlimModel, TrialDiscount as TrialDiscount, AmountDiscount as AmountDiscount, - BpsConfigModel as BpsConfigModel, - TaxAmountModel as TaxAmountModel, - ThresholdModel as ThresholdModel, - AdjustmentModel as AdjustmentModel, - AllocationModel as AllocationModel, - BulkConfigModel as BulkConfigModel, - CreditNoteModel as CreditNoteModel, - UnitConfigModel as UnitConfigModel, - MatrixValueModel as MatrixValueModel, - AddressInputModel as AddressInputModel, - EditCustomerModel as EditCustomerModel, - MatrixConfigModel as MatrixConfigModel, - PlanMinifiedModel as PlanMinifiedModel, - SubscriptionModel as SubscriptionModel, - TieredConfigModel as TieredConfigModel, - AffectedBlockModel as AffectedBlockModel, - BulkBpsConfigModel as BulkBpsConfigModel, - CustomerCostsModel as CustomerCostsModel, - CustomerTaxIDModel as CustomerTaxIDModel, - NewAdjustmentModel as NewAdjustmentModel, - PackageConfigModel as PackageConfigModel, PaginationMetadata as PaginationMetadata, PercentageDiscount as PercentageDiscount, - PriceIntervalModel as PriceIntervalModel, - SubscriptionsModel as SubscriptionsModel, - TrialDiscountModel as TrialDiscountModel, - AggregatedCostModel as AggregatedCostModel, - AmountDiscountModel as AmountDiscountModel, - AutoCollectionModel as AutoCollectionModel, - BillableMetricModel as BillableMetricModel, - PaymentAttemptModel as PaymentAttemptModel, InvoiceLevelDiscount as InvoiceLevelDiscount, - InvoiceLineItemModel as InvoiceLineItemModel, - MaximumIntervalModel as MaximumIntervalModel, - MinimumIntervalModel as MinimumIntervalModel, - TieredBpsConfigModel as TieredBpsConfigModel, AddCreditTopUpRequest as AddCreditTopUpRequest, - CouponRedemptionModel as CouponRedemptionModel, - CustomerMinifiedModel as CustomerMinifiedModel, - DiscountOverrideModel as DiscountOverrideModel, - NewFloatingPriceModel as NewFloatingPriceModel, - CreditLedgerEntryModel as CreditLedgerEntryModel, - CreditNoteSummaryModel as CreditNoteSummaryModel, - AdjustmentIntervalModel as AdjustmentIntervalModel, - BillableMetricTinyModel as BillableMetricTinyModel, - CreditNoteDiscountModel as CreditNoteDiscountModel, - NewAllocationPriceModel as NewAllocationPriceModel, - PaginationMetadataModel as PaginationMetadataModel, - PercentageDiscountModel as PercentageDiscountModel, BillingCycleRelativeDate as BillingCycleRelativeDate, - CreditLedgerEntriesModel as CreditLedgerEntriesModel, - MutatedSubscriptionModel as MutatedSubscriptionModel, - NewTaxConfigurationModel as NewTaxConfigurationModel, - SubLineItemGroupingModel as SubLineItemGroupingModel, UpdatePriceRequestParams as UpdatePriceRequestParams, - BillableMetricSimpleModel as BillableMetricSimpleModel, - InvoiceLevelDiscountModel as InvoiceLevelDiscountModel, - NewSubscriptionPriceModel as NewSubscriptionPriceModel, - SubscriptionMinifiedModel as SubscriptionMinifiedModel, AddSubscriptionPriceParams as AddSubscriptionPriceParams, CreateCustomerAlertRequest as CreateCustomerAlertRequest, - DimensionalPriceGroupModel as DimensionalPriceGroupModel, - SubscriptionTrialInfoModel as SubscriptionTrialInfoModel, - UsageDiscountIntervalModel as UsageDiscountIntervalModel, AddCreditLedgerEntryRequest as AddCreditLedgerEntryRequest, - AmountDiscountIntervalModel as AmountDiscountIntervalModel, - CustomerCreditBalancesModel as CustomerCreditBalancesModel, - ItemExternalConnectionModel as ItemExternalConnectionModel, - CustomerHierarchyConfigModel as CustomerHierarchyConfigModel, RemoveSubscriptionPriceParams as RemoveSubscriptionPriceParams, - BillingCycleConfigurationModel as BillingCycleConfigurationModel, - NewReportingConfigurationModel as NewReportingConfigurationModel, ReplaceSubscriptionPriceParams as ReplaceSubscriptionPriceParams, AddSubscriptionAdjustmentParams as AddSubscriptionAdjustmentParams, - CustomerBalanceTransactionModel as CustomerBalanceTransactionModel, - CustomRatingFunctionConfigModel as CustomRatingFunctionConfigModel, - MatrixWithAllocationConfigModel as MatrixWithAllocationConfigModel, - PercentageDiscountIntervalModel as PercentageDiscountIntervalModel, - NewBillingCycleConfigurationModel as NewBillingCycleConfigurationModel, - DimensionalPriceConfigurationModel as DimensionalPriceConfigurationModel, - FixedFeeQuantityScheduleEntryModel as FixedFeeQuantityScheduleEntryModel, RemoveSubscriptionAdjustmentParams as RemoveSubscriptionAdjustmentParams, - NewAccountingSyncConfigurationModel as NewAccountingSyncConfigurationModel, ReplaceSubscriptionAdjustmentParams as ReplaceSubscriptionAdjustmentParams, - BillingCycleAnchorConfigurationModel as BillingCycleAnchorConfigurationModel, - PriceIntervalFixedFeeQuantityTransitionModel as PriceIntervalFixedFeeQuantityTransitionModel, ) +from .invoice import Invoice as Invoice +from .customer import Customer as Customer +from .credit_note import CreditNote as CreditNote +from .subscription import Subscription as Subscription +from .subscriptions import Subscriptions as Subscriptions +from .billable_metric import BillableMetric as BillableMetric from .item_list_params import ItemListParams as ItemListParams from .plan_list_params import PlanListParams as PlanListParams from .alert_list_params import AlertListParams as AlertListParams @@ -145,6 +67,7 @@ from .customer_create_params import CustomerCreateParams as CustomerCreateParams from .customer_update_params import CustomerUpdateParams as CustomerUpdateParams from .credit_note_list_params import CreditNoteListParams as CreditNoteListParams +from .dimensional_price_group import DimensionalPriceGroup as DimensionalPriceGroup from .price_evaluate_response import PriceEvaluateResponse as PriceEvaluateResponse from .top_level_ping_response import TopLevelPingResponse as TopLevelPingResponse from .dimensional_price_groups import DimensionalPriceGroups as DimensionalPriceGroups @@ -155,6 +78,8 @@ from .subscription_cancel_params import SubscriptionCancelParams as SubscriptionCancelParams from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams +from .subscription_cancel_response import SubscriptionCancelResponse as SubscriptionCancelResponse +from .subscription_create_response import SubscriptionCreateResponse as SubscriptionCreateResponse from .invoice_fetch_upcoming_params import InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams from .invoice_fetch_upcoming_response import InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse from .invoice_line_item_create_params import InvoiceLineItemCreateParams as InvoiceLineItemCreateParams @@ -162,26 +87,47 @@ from .subscription_fetch_usage_params import SubscriptionFetchUsageParams as SubscriptionFetchUsageParams from .alert_create_for_customer_params import AlertCreateForCustomerParams as AlertCreateForCustomerParams from .subscription_update_trial_params import SubscriptionUpdateTrialParams as SubscriptionUpdateTrialParams +from .invoice_line_item_create_response import InvoiceLineItemCreateResponse as InvoiceLineItemCreateResponse from .subscription_fetch_costs_response import SubscriptionFetchCostsResponse as SubscriptionFetchCostsResponse from .subscription_trigger_phase_params import SubscriptionTriggerPhaseParams as SubscriptionTriggerPhaseParams from .subscription_fetch_schedule_params import SubscriptionFetchScheduleParams as SubscriptionFetchScheduleParams +from .subscription_update_trial_response import SubscriptionUpdateTrialResponse as SubscriptionUpdateTrialResponse from .dimensional_price_group_list_params import DimensionalPriceGroupListParams as DimensionalPriceGroupListParams from .subscription_price_intervals_params import SubscriptionPriceIntervalsParams as SubscriptionPriceIntervalsParams +from .subscription_trigger_phase_response import SubscriptionTriggerPhaseResponse as SubscriptionTriggerPhaseResponse from .alert_create_for_subscription_params import AlertCreateForSubscriptionParams as AlertCreateForSubscriptionParams from .subscription_fetch_schedule_response import SubscriptionFetchScheduleResponse as SubscriptionFetchScheduleResponse from .customer_update_by_external_id_params import CustomerUpdateByExternalIDParams as CustomerUpdateByExternalIDParams from .dimensional_price_group_create_params import ( DimensionalPriceGroupCreateParams as DimensionalPriceGroupCreateParams, ) +from .subscription_price_intervals_response import ( + SubscriptionPriceIntervalsResponse as SubscriptionPriceIntervalsResponse, +) from .subscription_schedule_plan_change_params import ( SubscriptionSchedulePlanChangeParams as SubscriptionSchedulePlanChangeParams, ) from .alert_create_for_external_customer_params import ( AlertCreateForExternalCustomerParams as AlertCreateForExternalCustomerParams, ) +from .subscription_schedule_plan_change_response import ( + SubscriptionSchedulePlanChangeResponse as SubscriptionSchedulePlanChangeResponse, +) +from .subscription_unschedule_cancellation_response import ( + SubscriptionUnscheduleCancellationResponse as SubscriptionUnscheduleCancellationResponse, +) from .subscription_update_fixed_fee_quantity_params import ( SubscriptionUpdateFixedFeeQuantityParams as SubscriptionUpdateFixedFeeQuantityParams, ) +from .subscription_update_fixed_fee_quantity_response import ( + SubscriptionUpdateFixedFeeQuantityResponse as SubscriptionUpdateFixedFeeQuantityResponse, +) +from .subscription_unschedule_pending_plan_changes_response import ( + SubscriptionUnschedulePendingPlanChangesResponse as SubscriptionUnschedulePendingPlanChangesResponse, +) from .subscription_unschedule_fixed_fee_quantity_updates_params import ( SubscriptionUnscheduleFixedFeeQuantityUpdatesParams as SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, ) +from .subscription_unschedule_fixed_fee_quantity_updates_response import ( + SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse as SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, +) diff --git a/src/orb/types/shared/alert_model.py b/src/orb/types/alert.py similarity index 70% rename from src/orb/types/shared/alert_model.py rename to src/orb/types/alert.py index 63be322f..0ef04360 100644 --- a/src/orb/types/shared/alert_model.py +++ b/src/orb/types/alert.py @@ -4,12 +4,15 @@ from datetime import datetime from typing_extensions import Literal -from ..._models import BaseModel -from .threshold_model import ThresholdModel -from .customer_minified_model import CustomerMinifiedModel -from .subscription_minified_model import SubscriptionMinifiedModel +from .._models import BaseModel -__all__ = ["AlertModel", "Metric", "Plan"] +__all__ = ["Alert", "Customer", "Metric", "Plan", "Subscription", "Threshold"] + + +class Customer(BaseModel): + id: str + + external_customer_id: Optional[str] = None class Metric(BaseModel): @@ -31,7 +34,20 @@ class Plan(BaseModel): plan_version: str -class AlertModel(BaseModel): +class Subscription(BaseModel): + id: str + + +class Threshold(BaseModel): + value: float + """The value at which an alert will fire. + + For credit balance alerts, the alert will fire at or below this value. For usage + and cost alerts, the alert will fire at or above this value. + """ + + +class Alert(BaseModel): id: str """Also referred to as alert_id in this documentation.""" @@ -41,7 +57,7 @@ class AlertModel(BaseModel): currency: Optional[str] = None """The name of the currency the credit balance or invoice cost is denominated in.""" - customer: Optional[CustomerMinifiedModel] = None + customer: Optional[Customer] = None """The customer the alert applies to.""" enabled: bool @@ -53,10 +69,10 @@ class AlertModel(BaseModel): plan: Optional[Plan] = None """The plan the alert applies to.""" - subscription: Optional[SubscriptionMinifiedModel] = None + subscription: Optional[Subscription] = None """The subscription the alert applies to.""" - thresholds: Optional[List[ThresholdModel]] = None + thresholds: Optional[List[Threshold]] = None """ The thresholds that define the conditions under which the alert will be triggered. diff --git a/src/orb/types/alert_create_for_customer_params.py b/src/orb/types/alert_create_for_customer_params.py index 9543c95d..5eeec557 100644 --- a/src/orb/types/alert_create_for_customer_params.py +++ b/src/orb/types/alert_create_for_customer_params.py @@ -5,9 +5,7 @@ from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict -from .shared_params.threshold_model import ThresholdModel - -__all__ = ["AlertCreateForCustomerParams"] +__all__ = ["AlertCreateForCustomerParams", "Threshold"] class AlertCreateForCustomerParams(TypedDict, total=False): @@ -25,5 +23,14 @@ class AlertCreateForCustomerParams(TypedDict, total=False): ] """The type of alert to create. This must be a valid alert type.""" - thresholds: Optional[Iterable[ThresholdModel]] + thresholds: Optional[Iterable[Threshold]] """The thresholds that define the values at which the alert will be triggered.""" + + +class Threshold(TypedDict, total=False): + value: Required[float] + """The value at which an alert will fire. + + For credit balance alerts, the alert will fire at or below this value. For usage + and cost alerts, the alert will fire at or above this value. + """ diff --git a/src/orb/types/alert_create_for_external_customer_params.py b/src/orb/types/alert_create_for_external_customer_params.py index 404a1c49..6732f61c 100644 --- a/src/orb/types/alert_create_for_external_customer_params.py +++ b/src/orb/types/alert_create_for_external_customer_params.py @@ -5,9 +5,7 @@ from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict -from .shared_params.threshold_model import ThresholdModel - -__all__ = ["AlertCreateForExternalCustomerParams"] +__all__ = ["AlertCreateForExternalCustomerParams", "Threshold"] class AlertCreateForExternalCustomerParams(TypedDict, total=False): @@ -25,5 +23,14 @@ class AlertCreateForExternalCustomerParams(TypedDict, total=False): ] """The type of alert to create. This must be a valid alert type.""" - thresholds: Optional[Iterable[ThresholdModel]] + thresholds: Optional[Iterable[Threshold]] """The thresholds that define the values at which the alert will be triggered.""" + + +class Threshold(TypedDict, total=False): + value: Required[float] + """The value at which an alert will fire. + + For credit balance alerts, the alert will fire at or below this value. For usage + and cost alerts, the alert will fire at or above this value. + """ diff --git a/src/orb/types/alert_create_for_subscription_params.py b/src/orb/types/alert_create_for_subscription_params.py index 84a76254..767408dc 100644 --- a/src/orb/types/alert_create_for_subscription_params.py +++ b/src/orb/types/alert_create_for_subscription_params.py @@ -5,13 +5,11 @@ from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict -from .shared_params.threshold_model import ThresholdModel - -__all__ = ["AlertCreateForSubscriptionParams"] +__all__ = ["AlertCreateForSubscriptionParams", "Threshold"] class AlertCreateForSubscriptionParams(TypedDict, total=False): - thresholds: Required[Iterable[ThresholdModel]] + thresholds: Required[Iterable[Threshold]] """The thresholds that define the values at which the alert will be triggered.""" type: Required[ @@ -27,3 +25,12 @@ class AlertCreateForSubscriptionParams(TypedDict, total=False): metric_id: Optional[str] """The metric to track usage for.""" + + +class Threshold(TypedDict, total=False): + value: Required[float] + """The value at which an alert will fire. + + For credit balance alerts, the alert will fire at or below this value. For usage + and cost alerts, the alert will fire at or above this value. + """ diff --git a/src/orb/types/alert_update_params.py b/src/orb/types/alert_update_params.py index 85c76599..6be6b1d2 100644 --- a/src/orb/types/alert_update_params.py +++ b/src/orb/types/alert_update_params.py @@ -5,11 +5,18 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from .shared_params.threshold_model import ThresholdModel - -__all__ = ["AlertUpdateParams"] +__all__ = ["AlertUpdateParams", "Threshold"] class AlertUpdateParams(TypedDict, total=False): - thresholds: Required[Iterable[ThresholdModel]] + thresholds: Required[Iterable[Threshold]] """The thresholds that define the values at which the alert will be triggered.""" + + +class Threshold(TypedDict, total=False): + value: Required[float] + """The value at which an alert will fire. + + For credit balance alerts, the alert will fire at or below this value. For usage + and cost alerts, the alert will fire at or above this value. + """ diff --git a/src/orb/types/shared/billable_metric_model.py b/src/orb/types/billable_metric.py similarity index 83% rename from src/orb/types/shared/billable_metric_model.py rename to src/orb/types/billable_metric.py index 566dc515..ac70464c 100644 --- a/src/orb/types/shared/billable_metric_model.py +++ b/src/orb/types/billable_metric.py @@ -3,18 +3,18 @@ from typing import Dict, Optional from typing_extensions import Literal -from ..._models import BaseModel -from .item_model import ItemModel +from .item import Item +from .._models import BaseModel -__all__ = ["BillableMetricModel"] +__all__ = ["BillableMetric"] -class BillableMetricModel(BaseModel): +class BillableMetric(BaseModel): id: str description: Optional[str] = None - item: ItemModel + item: Item """The Item resource represents a sellable product or good. Items are associated with all line items, billable metrics, and prices and are diff --git a/src/orb/types/shared/coupon_model.py b/src/orb/types/coupon.py similarity index 83% rename from src/orb/types/shared/coupon_model.py rename to src/orb/types/coupon.py index f2520755..c0ac61bd 100644 --- a/src/orb/types/shared/coupon_model.py +++ b/src/orb/types/coupon.py @@ -4,17 +4,17 @@ from datetime import datetime from typing_extensions import Annotated, TypeAlias -from ..._utils import PropertyInfo -from ..._models import BaseModel -from .amount_discount import AmountDiscount -from .percentage_discount import PercentageDiscount +from .._utils import PropertyInfo +from .._models import BaseModel +from .shared.amount_discount import AmountDiscount +from .shared.percentage_discount import PercentageDiscount -__all__ = ["CouponModel", "Discount"] +__all__ = ["Coupon", "Discount"] Discount: TypeAlias = Annotated[Union[PercentageDiscount, AmountDiscount], PropertyInfo(discriminator="discount_type")] -class CouponModel(BaseModel): +class Coupon(BaseModel): id: str """Also referred to as coupon_id in this documentation.""" diff --git a/src/orb/types/shared/credit_note_model.py b/src/orb/types/credit_note.py similarity index 61% rename from src/orb/types/shared/credit_note_model.py rename to src/orb/types/credit_note.py index 2988e51c..ac789c61 100644 --- a/src/orb/types/shared/credit_note_model.py +++ b/src/orb/types/credit_note.py @@ -4,12 +4,36 @@ from datetime import datetime from typing_extensions import Literal -from ..._models import BaseModel -from .tax_amount_model import TaxAmountModel -from .customer_minified_model import CustomerMinifiedModel -from .credit_note_discount_model import CreditNoteDiscountModel +from .._models import BaseModel + +__all__ = [ + "CreditNote", + "Customer", + "LineItem", + "LineItemTaxAmount", + "LineItemDiscount", + "MaximumAmountAdjustment", + "MaximumAmountAdjustmentAppliesToPrice", + "Discount", + "DiscountAppliesToPrice", +] + + +class Customer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class LineItemTaxAmount(BaseModel): + amount: str + """The amount of additional tax incurred by this tax rate.""" -__all__ = ["CreditNoteModel", "LineItem", "LineItemDiscount"] + tax_rate_description: str + """The human-readable description of the applied tax rate.""" + + tax_rate_percentage: Optional[str] = None + """The tax rate percentage, out of 100.""" class LineItemDiscount(BaseModel): @@ -47,14 +71,50 @@ class LineItem(BaseModel): subtotal: str """The amount of the line item, excluding any line item minimums and discounts.""" - tax_amounts: List[TaxAmountModel] + tax_amounts: List[LineItemTaxAmount] """Any tax amounts applied onto the line item.""" discounts: Optional[List[LineItemDiscount]] = None """Any line item discounts from the invoice's line item.""" -class CreditNoteModel(BaseModel): +class MaximumAmountAdjustmentAppliesToPrice(BaseModel): + id: str + + name: str + + +class MaximumAmountAdjustment(BaseModel): + amount_applied: str + + discount_type: Literal["percentage"] + + percentage_discount: float + + applies_to_prices: Optional[List[MaximumAmountAdjustmentAppliesToPrice]] = None + + reason: Optional[str] = None + + +class DiscountAppliesToPrice(BaseModel): + id: str + + name: str + + +class Discount(BaseModel): + amount_applied: str + + discount_type: Literal["percentage"] + + percentage_discount: float + + applies_to_prices: Optional[List[DiscountAppliesToPrice]] = None + + reason: Optional[str] = None + + +class CreditNote(BaseModel): id: str """The Orb id of this credit note.""" @@ -67,7 +127,7 @@ class CreditNoteModel(BaseModel): credit_note_pdf: Optional[str] = None """A URL to a PDF of the credit note.""" - customer: CustomerMinifiedModel + customer: Customer invoice_id: str """The id of the invoice resource that this credit note is applied to.""" @@ -75,7 +135,7 @@ class CreditNoteModel(BaseModel): line_items: List[LineItem] """All of the line items associated with this credit note.""" - maximum_amount_adjustment: Optional[CreditNoteDiscountModel] = None + maximum_amount_adjustment: Optional[MaximumAmountAdjustment] = None """The maximum amount applied on the original invoice""" memo: Optional[str] = None @@ -97,5 +157,5 @@ class CreditNoteModel(BaseModel): voided_at: Optional[datetime] = None """The time at which the credit note was voided in Orb, if applicable.""" - discounts: Optional[List[CreditNoteDiscountModel]] = None + discounts: Optional[List[Discount]] = None """Any discounts applied on the original invoice.""" diff --git a/src/orb/types/shared/customer_model.py b/src/orb/types/customer.py similarity index 83% rename from src/orb/types/shared/customer_model.py rename to src/orb/types/customer.py index 47e35314..a47f3057 100644 --- a/src/orb/types/shared/customer_model.py +++ b/src/orb/types/customer.py @@ -4,24 +4,225 @@ from datetime import datetime from typing_extensions import Literal -from ..._models import BaseModel -from .address_model import AddressModel -from .customer_tax_id_model import CustomerTaxIDModel -from .customer_minified_model import CustomerMinifiedModel +from .._models import BaseModel __all__ = [ - "CustomerModel", + "Customer", + "BillingAddress", "Hierarchy", + "HierarchyChild", + "HierarchyParent", + "ShippingAddress", + "TaxID", "AccountingSyncConfiguration", "AccountingSyncConfigurationAccountingProvider", "ReportingConfiguration", ] -class Hierarchy(BaseModel): - children: List[CustomerMinifiedModel] +class BillingAddress(BaseModel): + city: Optional[str] = None + + country: Optional[str] = None + + line1: Optional[str] = None + + line2: Optional[str] = None + + postal_code: Optional[str] = None + + state: Optional[str] = None + + +class HierarchyChild(BaseModel): + id: str - parent: Optional[CustomerMinifiedModel] = None + external_customer_id: Optional[str] = None + + +class HierarchyParent(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class Hierarchy(BaseModel): + children: List[HierarchyChild] + + parent: Optional[HierarchyParent] = None + + +class ShippingAddress(BaseModel): + city: Optional[str] = None + + country: Optional[str] = None + + line1: Optional[str] = None + + line2: Optional[str] = None + + postal_code: Optional[str] = None + + state: Optional[str] = None + + +class TaxID(BaseModel): + country: Literal[ + "AD", + "AE", + "AR", + "AT", + "AU", + "BE", + "BG", + "BH", + "BO", + "BR", + "CA", + "CH", + "CL", + "CN", + "CO", + "CR", + "CY", + "CZ", + "DE", + "DK", + "EE", + "DO", + "EC", + "EG", + "ES", + "EU", + "FI", + "FR", + "GB", + "GE", + "GR", + "HK", + "HR", + "HU", + "ID", + "IE", + "IL", + "IN", + "IS", + "IT", + "JP", + "KE", + "KR", + "KZ", + "LI", + "LT", + "LU", + "LV", + "MT", + "MX", + "MY", + "NG", + "NL", + "NO", + "NZ", + "OM", + "PE", + "PH", + "PL", + "PT", + "RO", + "RS", + "RU", + "SA", + "SE", + "SG", + "SI", + "SK", + "SV", + "TH", + "TR", + "TW", + "UA", + "US", + "UY", + "VE", + "VN", + "ZA", + ] + + type: Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "eu_vat", + "au_abn", + "au_arn", + "bg_uic", + "bh_vat", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "kz_bin", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + + value: str class AccountingSyncConfigurationAccountingProvider(BaseModel): @@ -40,7 +241,7 @@ class ReportingConfiguration(BaseModel): exempt: bool -class CustomerModel(BaseModel): +class Customer(BaseModel): id: str additional_emails: List[str] @@ -50,7 +251,7 @@ class CustomerModel(BaseModel): balance: str """The customer's current balance in their currency.""" - billing_address: Optional[AddressModel] = None + billing_address: Optional[BillingAddress] = None created_at: datetime @@ -103,9 +304,9 @@ class CustomerModel(BaseModel): portal_url: Optional[str] = None - shipping_address: Optional[AddressModel] = None + shipping_address: Optional[ShippingAddress] = None - tax_id: Optional[CustomerTaxIDModel] = None + tax_id: Optional[TaxID] = None """ Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. diff --git a/src/orb/types/customer_create_params.py b/src/orb/types/customer_create_params.py index 5330c6d7..7e1c1732 100644 --- a/src/orb/types/customer_create_params.py +++ b/src/orb/types/customer_create_params.py @@ -2,17 +2,22 @@ from __future__ import annotations -from typing import Dict, List, Optional -from typing_extensions import Literal, Required, TypedDict +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .shared_params.address_input_model import AddressInputModel -from .shared_params.customer_tax_id_model import CustomerTaxIDModel -from .shared_params.new_tax_configuration_model import NewTaxConfigurationModel -from .shared_params.customer_hierarchy_config_model import CustomerHierarchyConfigModel -from .shared_params.new_reporting_configuration_model import NewReportingConfigurationModel -from .shared_params.new_accounting_sync_configuration_model import NewAccountingSyncConfigurationModel - -__all__ = ["CustomerCreateParams"] +__all__ = [ + "CustomerCreateParams", + "AccountingSyncConfiguration", + "AccountingSyncConfigurationAccountingProvider", + "BillingAddress", + "Hierarchy", + "ReportingConfiguration", + "ShippingAddress", + "TaxConfiguration", + "TaxConfigurationNewAvalaraTaxConfiguration", + "TaxConfigurationNewTaxJarConfiguration", + "TaxID", +] class CustomerCreateParams(TypedDict, total=False): @@ -26,7 +31,7 @@ class CustomerCreateParams(TypedDict, total=False): name: Required[str] """The full name of the customer""" - accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] + accounting_sync_configuration: Optional[AccountingSyncConfiguration] additional_emails: Optional[List[str]] """Additional email addresses for this customer. @@ -41,7 +46,7 @@ class CustomerCreateParams(TypedDict, total=False): when a payment provider is provided on customer creation. """ - billing_address: Optional[AddressInputModel] + billing_address: Optional[BillingAddress] currency: Optional[str] """An ISO 4217 currency string used for the customer's invoices and balance. @@ -58,7 +63,7 @@ class CustomerCreateParams(TypedDict, total=False): an existing identifier in your system. """ - hierarchy: Optional[CustomerHierarchyConfigModel] + hierarchy: Optional[Hierarchy] """The hierarchical relationships for this customer.""" metadata: Optional[Dict[str, Optional[str]]] @@ -81,13 +86,13 @@ class CustomerCreateParams(TypedDict, total=False): This is used for creating charges or invoices in the external system via Orb. """ - reporting_configuration: Optional[NewReportingConfigurationModel] + reporting_configuration: Optional[ReportingConfiguration] - shipping_address: Optional[AddressInputModel] + shipping_address: Optional[ShippingAddress] - tax_configuration: Optional[NewTaxConfigurationModel] + tax_configuration: Optional[TaxConfiguration] - tax_id: Optional[CustomerTaxIDModel] + tax_id: Optional[TaxID] """ Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. @@ -202,3 +207,241 @@ class CustomerCreateParams(TypedDict, total=False): `"America/Los_Angeles"`. This defaults to your account's timezone if not set. This cannot be changed after customer creation. """ + + +class AccountingSyncConfigurationAccountingProvider(TypedDict, total=False): + external_provider_id: Required[str] + + provider_type: Required[str] + + +class AccountingSyncConfiguration(TypedDict, total=False): + accounting_providers: Optional[Iterable[AccountingSyncConfigurationAccountingProvider]] + + excluded: Optional[bool] + + +class BillingAddress(TypedDict, total=False): + city: Optional[str] + + country: Optional[str] + + line1: Optional[str] + + line2: Optional[str] + + postal_code: Optional[str] + + state: Optional[str] + + +class Hierarchy(TypedDict, total=False): + child_customer_ids: List[str] + """A list of child customer IDs to add to the hierarchy. + + The desired child customers must not already be part of another hierarchy. + """ + + parent_customer_id: Optional[str] + """The ID of the parent customer in the hierarchy. + + The desired parent customer must not be a child of another customer. + """ + + +class ReportingConfiguration(TypedDict, total=False): + exempt: Required[bool] + + +class ShippingAddress(TypedDict, total=False): + city: Optional[str] + + country: Optional[str] + + line1: Optional[str] + + line2: Optional[str] + + postal_code: Optional[str] + + state: Optional[str] + + +class TaxConfigurationNewAvalaraTaxConfiguration(TypedDict, total=False): + tax_exempt: Required[bool] + + tax_provider: Required[Literal["avalara"]] + + tax_exemption_code: Optional[str] + + +class TaxConfigurationNewTaxJarConfiguration(TypedDict, total=False): + tax_exempt: Required[bool] + + tax_provider: Required[Literal["taxjar"]] + + +TaxConfiguration: TypeAlias = Union[TaxConfigurationNewAvalaraTaxConfiguration, TaxConfigurationNewTaxJarConfiguration] + + +class TaxID(TypedDict, total=False): + country: Required[ + Literal[ + "AD", + "AE", + "AR", + "AT", + "AU", + "BE", + "BG", + "BH", + "BO", + "BR", + "CA", + "CH", + "CL", + "CN", + "CO", + "CR", + "CY", + "CZ", + "DE", + "DK", + "EE", + "DO", + "EC", + "EG", + "ES", + "EU", + "FI", + "FR", + "GB", + "GE", + "GR", + "HK", + "HR", + "HU", + "ID", + "IE", + "IL", + "IN", + "IS", + "IT", + "JP", + "KE", + "KR", + "KZ", + "LI", + "LT", + "LU", + "LV", + "MT", + "MX", + "MY", + "NG", + "NL", + "NO", + "NZ", + "OM", + "PE", + "PH", + "PL", + "PT", + "RO", + "RS", + "RU", + "SA", + "SE", + "SG", + "SI", + "SK", + "SV", + "TH", + "TR", + "TW", + "UA", + "US", + "UY", + "VE", + "VN", + "ZA", + ] + ] + + type: Required[ + Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "eu_vat", + "au_abn", + "au_arn", + "bg_uic", + "bh_vat", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "kz_bin", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + ] + + value: Required[str] diff --git a/src/orb/types/customer_update_by_external_id_params.py b/src/orb/types/customer_update_by_external_id_params.py index 4e50c365..cb1dfd2d 100644 --- a/src/orb/types/customer_update_by_external_id_params.py +++ b/src/orb/types/customer_update_by_external_id_params.py @@ -2,21 +2,26 @@ from __future__ import annotations -from typing import Dict, List, Optional -from typing_extensions import Literal, TypedDict +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .shared_params.address_input_model import AddressInputModel -from .shared_params.customer_tax_id_model import CustomerTaxIDModel -from .shared_params.new_tax_configuration_model import NewTaxConfigurationModel -from .shared_params.customer_hierarchy_config_model import CustomerHierarchyConfigModel -from .shared_params.new_reporting_configuration_model import NewReportingConfigurationModel -from .shared_params.new_accounting_sync_configuration_model import NewAccountingSyncConfigurationModel - -__all__ = ["CustomerUpdateByExternalIDParams"] +__all__ = [ + "CustomerUpdateByExternalIDParams", + "AccountingSyncConfiguration", + "AccountingSyncConfigurationAccountingProvider", + "BillingAddress", + "Hierarchy", + "ReportingConfiguration", + "ShippingAddress", + "TaxConfiguration", + "TaxConfigurationNewAvalaraTaxConfiguration", + "TaxConfigurationNewTaxJarConfiguration", + "TaxID", +] class CustomerUpdateByExternalIDParams(TypedDict, total=False): - accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] + accounting_sync_configuration: Optional[AccountingSyncConfiguration] additional_emails: Optional[List[str]] """Additional email addresses for this customer. @@ -31,7 +36,7 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): when a payment provider is provided on customer creation. """ - billing_address: Optional[AddressInputModel] + billing_address: Optional[BillingAddress] currency: Optional[str] """An ISO 4217 currency string used for the customer's invoices and balance. @@ -51,7 +56,7 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): subscriptions. """ - hierarchy: Optional[CustomerHierarchyConfigModel] + hierarchy: Optional[Hierarchy] """The hierarchical relationships for this customer.""" metadata: Optional[Dict[str, Optional[str]]] @@ -81,13 +86,13 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): This is used for creating charges or invoices in the external system via Orb. """ - reporting_configuration: Optional[NewReportingConfigurationModel] + reporting_configuration: Optional[ReportingConfiguration] - shipping_address: Optional[AddressInputModel] + shipping_address: Optional[ShippingAddress] - tax_configuration: Optional[NewTaxConfigurationModel] + tax_configuration: Optional[TaxConfiguration] - tax_id: Optional[CustomerTaxIDModel] + tax_id: Optional[TaxID] """ Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. @@ -195,3 +200,241 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): | Venezuela | `ve_rif` | Venezuelan RIF Number | | Vietnam | `vn_tin` | Vietnamese Tax ID Number | """ + + +class AccountingSyncConfigurationAccountingProvider(TypedDict, total=False): + external_provider_id: Required[str] + + provider_type: Required[str] + + +class AccountingSyncConfiguration(TypedDict, total=False): + accounting_providers: Optional[Iterable[AccountingSyncConfigurationAccountingProvider]] + + excluded: Optional[bool] + + +class BillingAddress(TypedDict, total=False): + city: Optional[str] + + country: Optional[str] + + line1: Optional[str] + + line2: Optional[str] + + postal_code: Optional[str] + + state: Optional[str] + + +class Hierarchy(TypedDict, total=False): + child_customer_ids: List[str] + """A list of child customer IDs to add to the hierarchy. + + The desired child customers must not already be part of another hierarchy. + """ + + parent_customer_id: Optional[str] + """The ID of the parent customer in the hierarchy. + + The desired parent customer must not be a child of another customer. + """ + + +class ReportingConfiguration(TypedDict, total=False): + exempt: Required[bool] + + +class ShippingAddress(TypedDict, total=False): + city: Optional[str] + + country: Optional[str] + + line1: Optional[str] + + line2: Optional[str] + + postal_code: Optional[str] + + state: Optional[str] + + +class TaxConfigurationNewAvalaraTaxConfiguration(TypedDict, total=False): + tax_exempt: Required[bool] + + tax_provider: Required[Literal["avalara"]] + + tax_exemption_code: Optional[str] + + +class TaxConfigurationNewTaxJarConfiguration(TypedDict, total=False): + tax_exempt: Required[bool] + + tax_provider: Required[Literal["taxjar"]] + + +TaxConfiguration: TypeAlias = Union[TaxConfigurationNewAvalaraTaxConfiguration, TaxConfigurationNewTaxJarConfiguration] + + +class TaxID(TypedDict, total=False): + country: Required[ + Literal[ + "AD", + "AE", + "AR", + "AT", + "AU", + "BE", + "BG", + "BH", + "BO", + "BR", + "CA", + "CH", + "CL", + "CN", + "CO", + "CR", + "CY", + "CZ", + "DE", + "DK", + "EE", + "DO", + "EC", + "EG", + "ES", + "EU", + "FI", + "FR", + "GB", + "GE", + "GR", + "HK", + "HR", + "HU", + "ID", + "IE", + "IL", + "IN", + "IS", + "IT", + "JP", + "KE", + "KR", + "KZ", + "LI", + "LT", + "LU", + "LV", + "MT", + "MX", + "MY", + "NG", + "NL", + "NO", + "NZ", + "OM", + "PE", + "PH", + "PL", + "PT", + "RO", + "RS", + "RU", + "SA", + "SE", + "SG", + "SI", + "SK", + "SV", + "TH", + "TR", + "TW", + "UA", + "US", + "UY", + "VE", + "VN", + "ZA", + ] + ] + + type: Required[ + Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "eu_vat", + "au_abn", + "au_arn", + "bg_uic", + "bh_vat", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "kz_bin", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + ] + + value: Required[str] diff --git a/src/orb/types/customer_update_params.py b/src/orb/types/customer_update_params.py index 30c224ab..886737d6 100644 --- a/src/orb/types/customer_update_params.py +++ b/src/orb/types/customer_update_params.py @@ -2,21 +2,26 @@ from __future__ import annotations -from typing import Dict, List, Optional -from typing_extensions import Literal, TypedDict +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .shared_params.address_input_model import AddressInputModel -from .shared_params.customer_tax_id_model import CustomerTaxIDModel -from .shared_params.new_tax_configuration_model import NewTaxConfigurationModel -from .shared_params.customer_hierarchy_config_model import CustomerHierarchyConfigModel -from .shared_params.new_reporting_configuration_model import NewReportingConfigurationModel -from .shared_params.new_accounting_sync_configuration_model import NewAccountingSyncConfigurationModel - -__all__ = ["CustomerUpdateParams"] +__all__ = [ + "CustomerUpdateParams", + "AccountingSyncConfiguration", + "AccountingSyncConfigurationAccountingProvider", + "BillingAddress", + "Hierarchy", + "ReportingConfiguration", + "ShippingAddress", + "TaxConfiguration", + "TaxConfigurationNewAvalaraTaxConfiguration", + "TaxConfigurationNewTaxJarConfiguration", + "TaxID", +] class CustomerUpdateParams(TypedDict, total=False): - accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] + accounting_sync_configuration: Optional[AccountingSyncConfiguration] additional_emails: Optional[List[str]] """Additional email addresses for this customer. @@ -31,7 +36,7 @@ class CustomerUpdateParams(TypedDict, total=False): when a payment provider is provided on customer creation. """ - billing_address: Optional[AddressInputModel] + billing_address: Optional[BillingAddress] currency: Optional[str] """An ISO 4217 currency string used for the customer's invoices and balance. @@ -51,7 +56,7 @@ class CustomerUpdateParams(TypedDict, total=False): subscriptions. """ - hierarchy: Optional[CustomerHierarchyConfigModel] + hierarchy: Optional[Hierarchy] """The hierarchical relationships for this customer.""" metadata: Optional[Dict[str, Optional[str]]] @@ -81,13 +86,13 @@ class CustomerUpdateParams(TypedDict, total=False): This is used for creating charges or invoices in the external system via Orb. """ - reporting_configuration: Optional[NewReportingConfigurationModel] + reporting_configuration: Optional[ReportingConfiguration] - shipping_address: Optional[AddressInputModel] + shipping_address: Optional[ShippingAddress] - tax_configuration: Optional[NewTaxConfigurationModel] + tax_configuration: Optional[TaxConfiguration] - tax_id: Optional[CustomerTaxIDModel] + tax_id: Optional[TaxID] """ Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. @@ -195,3 +200,241 @@ class CustomerUpdateParams(TypedDict, total=False): | Venezuela | `ve_rif` | Venezuelan RIF Number | | Vietnam | `vn_tin` | Vietnamese Tax ID Number | """ + + +class AccountingSyncConfigurationAccountingProvider(TypedDict, total=False): + external_provider_id: Required[str] + + provider_type: Required[str] + + +class AccountingSyncConfiguration(TypedDict, total=False): + accounting_providers: Optional[Iterable[AccountingSyncConfigurationAccountingProvider]] + + excluded: Optional[bool] + + +class BillingAddress(TypedDict, total=False): + city: Optional[str] + + country: Optional[str] + + line1: Optional[str] + + line2: Optional[str] + + postal_code: Optional[str] + + state: Optional[str] + + +class Hierarchy(TypedDict, total=False): + child_customer_ids: List[str] + """A list of child customer IDs to add to the hierarchy. + + The desired child customers must not already be part of another hierarchy. + """ + + parent_customer_id: Optional[str] + """The ID of the parent customer in the hierarchy. + + The desired parent customer must not be a child of another customer. + """ + + +class ReportingConfiguration(TypedDict, total=False): + exempt: Required[bool] + + +class ShippingAddress(TypedDict, total=False): + city: Optional[str] + + country: Optional[str] + + line1: Optional[str] + + line2: Optional[str] + + postal_code: Optional[str] + + state: Optional[str] + + +class TaxConfigurationNewAvalaraTaxConfiguration(TypedDict, total=False): + tax_exempt: Required[bool] + + tax_provider: Required[Literal["avalara"]] + + tax_exemption_code: Optional[str] + + +class TaxConfigurationNewTaxJarConfiguration(TypedDict, total=False): + tax_exempt: Required[bool] + + tax_provider: Required[Literal["taxjar"]] + + +TaxConfiguration: TypeAlias = Union[TaxConfigurationNewAvalaraTaxConfiguration, TaxConfigurationNewTaxJarConfiguration] + + +class TaxID(TypedDict, total=False): + country: Required[ + Literal[ + "AD", + "AE", + "AR", + "AT", + "AU", + "BE", + "BG", + "BH", + "BO", + "BR", + "CA", + "CH", + "CL", + "CN", + "CO", + "CR", + "CY", + "CZ", + "DE", + "DK", + "EE", + "DO", + "EC", + "EG", + "ES", + "EU", + "FI", + "FR", + "GB", + "GE", + "GR", + "HK", + "HR", + "HU", + "ID", + "IE", + "IL", + "IN", + "IS", + "IT", + "JP", + "KE", + "KR", + "KZ", + "LI", + "LT", + "LU", + "LV", + "MT", + "MX", + "MY", + "NG", + "NL", + "NO", + "NZ", + "OM", + "PE", + "PH", + "PL", + "PT", + "RO", + "RS", + "RU", + "SA", + "SE", + "SG", + "SI", + "SK", + "SV", + "TH", + "TR", + "TW", + "UA", + "US", + "UY", + "VE", + "VN", + "ZA", + ] + ] + + type: Required[ + Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "eu_vat", + "au_abn", + "au_arn", + "bg_uic", + "bh_vat", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "kz_bin", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + ] + + value: Required[str] diff --git a/src/orb/types/customers/__init__.py b/src/orb/types/customers/__init__.py index ce40c42f..ba43a9b2 100644 --- a/src/orb/types/customers/__init__.py +++ b/src/orb/types/customers/__init__.py @@ -3,8 +3,14 @@ from __future__ import annotations from .cost_list_params import CostListParams as CostListParams +from .cost_list_response import CostListResponse as CostListResponse from .credit_list_params import CreditListParams as CreditListParams +from .credit_list_response import CreditListResponse as CreditListResponse from .balance_transaction_list_params import BalanceTransactionListParams as BalanceTransactionListParams from .cost_list_by_external_id_params import CostListByExternalIDParams as CostListByExternalIDParams from .balance_transaction_create_params import BalanceTransactionCreateParams as BalanceTransactionCreateParams +from .balance_transaction_list_response import BalanceTransactionListResponse as BalanceTransactionListResponse +from .cost_list_by_external_id_response import CostListByExternalIDResponse as CostListByExternalIDResponse from .credit_list_by_external_id_params import CreditListByExternalIDParams as CreditListByExternalIDParams +from .balance_transaction_create_response import BalanceTransactionCreateResponse as BalanceTransactionCreateResponse +from .credit_list_by_external_id_response import CreditListByExternalIDResponse as CreditListByExternalIDResponse diff --git a/src/orb/types/customers/balance_transaction_create_response.py b/src/orb/types/customers/balance_transaction_create_response.py new file mode 100644 index 00000000..37b07da1 --- /dev/null +++ b/src/orb/types/customers/balance_transaction_create_response.py @@ -0,0 +1,63 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BalanceTransactionCreateResponse", "CreditNote", "Invoice"] + + +class CreditNote(BaseModel): + id: str + """The id of the Credit note""" + + +class Invoice(BaseModel): + id: str + """The Invoice id""" + + +class BalanceTransactionCreateResponse(BaseModel): + id: str + """A unique id for this transaction.""" + + action: Literal[ + "applied_to_invoice", + "manual_adjustment", + "prorated_refund", + "revert_prorated_refund", + "return_from_voiding", + "credit_note_applied", + "credit_note_voided", + "overpayment_refund", + "external_payment", + ] + + amount: str + """The value of the amount changed in the transaction.""" + + created_at: datetime + """The creation time of this transaction.""" + + credit_note: Optional[CreditNote] = None + + description: Optional[str] = None + """An optional description provided for manual customer balance adjustments.""" + + ending_balance: str + """ + The new value of the customer's balance prior to the transaction, in the + customer's currency. + """ + + invoice: Optional[Invoice] = None + + starting_balance: str + """ + The original value of the customer's balance prior to the transaction, in the + customer's currency. + """ + + type: Literal["increment", "decrement"] diff --git a/src/orb/types/shared/customer_balance_transaction_model.py b/src/orb/types/customers/balance_transaction_list_response.py similarity index 92% rename from src/orb/types/shared/customer_balance_transaction_model.py rename to src/orb/types/customers/balance_transaction_list_response.py index 8da970b3..4f39b39d 100644 --- a/src/orb/types/shared/customer_balance_transaction_model.py +++ b/src/orb/types/customers/balance_transaction_list_response.py @@ -6,7 +6,7 @@ from ..._models import BaseModel -__all__ = ["CustomerBalanceTransactionModel", "CreditNote", "Invoice"] +__all__ = ["BalanceTransactionListResponse", "CreditNote", "Invoice"] class CreditNote(BaseModel): @@ -19,7 +19,7 @@ class Invoice(BaseModel): """The Invoice id""" -class CustomerBalanceTransactionModel(BaseModel): +class BalanceTransactionListResponse(BaseModel): id: str """A unique id for this transaction.""" diff --git a/src/orb/types/customers/cost_list_by_external_id_response.py b/src/orb/types/customers/cost_list_by_external_id_response.py new file mode 100644 index 00000000..ff23d144 --- /dev/null +++ b/src/orb/types/customers/cost_list_by_external_id_response.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ..price import Price +from ..._models import BaseModel + +__all__ = ["CostListByExternalIDResponse", "Data", "DataPerPriceCost"] + + +class DataPerPriceCost(BaseModel): + price: Price + """The price object""" + + price_id: str + """The price the cost is associated with""" + + subtotal: str + """Price's contributions for the timeframe, excluding any minimums and discounts.""" + + total: str + """Price's contributions for the timeframe, including minimums and discounts.""" + + quantity: Optional[float] = None + """The price's quantity for the timeframe""" + + +class Data(BaseModel): + per_price_costs: List[DataPerPriceCost] + + subtotal: str + """Total costs for the timeframe, excluding any minimums and discounts.""" + + timeframe_end: datetime + + timeframe_start: datetime + + total: str + """Total costs for the timeframe, including any minimums and discounts.""" + + +class CostListByExternalIDResponse(BaseModel): + data: List[Data] diff --git a/src/orb/types/shared/aggregated_cost_model.py b/src/orb/types/customers/cost_list_response.py similarity index 76% rename from src/orb/types/shared/aggregated_cost_model.py rename to src/orb/types/customers/cost_list_response.py index c0cbb2ec..48921e0f 100644 --- a/src/orb/types/shared/aggregated_cost_model.py +++ b/src/orb/types/customers/cost_list_response.py @@ -3,14 +3,14 @@ from typing import List, Optional from datetime import datetime +from ..price import Price from ..._models import BaseModel -from .price_model import PriceModel -__all__ = ["AggregatedCostModel", "PerPriceCost"] +__all__ = ["CostListResponse", "Data", "DataPerPriceCost"] -class PerPriceCost(BaseModel): - price: PriceModel +class DataPerPriceCost(BaseModel): + price: Price """The price object""" price_id: str @@ -26,8 +26,8 @@ class PerPriceCost(BaseModel): """The price's quantity for the timeframe""" -class AggregatedCostModel(BaseModel): - per_price_costs: List[PerPriceCost] +class Data(BaseModel): + per_price_costs: List[DataPerPriceCost] subtotal: str """Total costs for the timeframe, excluding any minimums and discounts.""" @@ -38,3 +38,7 @@ class AggregatedCostModel(BaseModel): total: str """Total costs for the timeframe, including any minimums and discounts.""" + + +class CostListResponse(BaseModel): + data: List[Data] diff --git a/src/orb/types/shared/customer_credit_balances_model.py b/src/orb/types/customers/credit_list_by_external_id_response.py similarity index 63% rename from src/orb/types/shared/customer_credit_balances_model.py rename to src/orb/types/customers/credit_list_by_external_id_response.py index 7a8627da..d88e900b 100644 --- a/src/orb/types/shared/customer_credit_balances_model.py +++ b/src/orb/types/customers/credit_list_by_external_id_response.py @@ -1,16 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -from .pagination_metadata import PaginationMetadata -__all__ = ["CustomerCreditBalancesModel", "Data"] +__all__ = ["CreditListByExternalIDResponse"] -class Data(BaseModel): +class CreditListByExternalIDResponse(BaseModel): id: str balance: float @@ -24,9 +23,3 @@ class Data(BaseModel): per_unit_cost_basis: Optional[str] = None status: Literal["active", "pending_payment"] - - -class CustomerCreditBalancesModel(BaseModel): - data: List[Data] - - pagination_metadata: PaginationMetadata diff --git a/src/orb/types/shared/affected_block_model.py b/src/orb/types/customers/credit_list_response.py similarity index 50% rename from src/orb/types/shared/affected_block_model.py rename to src/orb/types/customers/credit_list_response.py index 31e33f77..7ccbfcf1 100644 --- a/src/orb/types/shared/affected_block_model.py +++ b/src/orb/types/customers/credit_list_response.py @@ -2,15 +2,24 @@ from typing import Optional from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["AffectedBlockModel"] +__all__ = ["CreditListResponse"] -class AffectedBlockModel(BaseModel): +class CreditListResponse(BaseModel): id: str + balance: float + + effective_date: Optional[datetime] = None + expiry_date: Optional[datetime] = None + maximum_initial_balance: Optional[float] = None + per_unit_cost_basis: Optional[str] = None + + status: Literal["active", "pending_payment"] diff --git a/src/orb/types/customers/credits/__init__.py b/src/orb/types/customers/credits/__init__.py index 5784e8f4..9baa17d8 100644 --- a/src/orb/types/customers/credits/__init__.py +++ b/src/orb/types/customers/credits/__init__.py @@ -4,11 +4,21 @@ from .ledger_list_params import LedgerListParams as LedgerListParams from .top_up_list_params import TopUpListParams as TopUpListParams +from .ledger_list_response import LedgerListResponse as LedgerListResponse from .top_up_create_params import TopUpCreateParams as TopUpCreateParams +from .top_up_list_response import TopUpListResponse as TopUpListResponse +from .top_up_create_response import TopUpCreateResponse as TopUpCreateResponse from .ledger_create_entry_params import LedgerCreateEntryParams as LedgerCreateEntryParams +from .ledger_create_entry_response import LedgerCreateEntryResponse as LedgerCreateEntryResponse from .ledger_list_by_external_id_params import LedgerListByExternalIDParams as LedgerListByExternalIDParams from .top_up_list_by_external_id_params import TopUpListByExternalIDParams as TopUpListByExternalIDParams +from .ledger_list_by_external_id_response import LedgerListByExternalIDResponse as LedgerListByExternalIDResponse from .top_up_create_by_external_id_params import TopUpCreateByExternalIDParams as TopUpCreateByExternalIDParams +from .top_up_list_by_external_id_response import TopUpListByExternalIDResponse as TopUpListByExternalIDResponse +from .top_up_create_by_external_id_response import TopUpCreateByExternalIDResponse as TopUpCreateByExternalIDResponse from .ledger_create_entry_by_external_id_params import ( LedgerCreateEntryByExternalIDParams as LedgerCreateEntryByExternalIDParams, ) +from .ledger_create_entry_by_external_id_response import ( + LedgerCreateEntryByExternalIDResponse as LedgerCreateEntryByExternalIDResponse, +) diff --git a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py new file mode 100644 index 00000000..903d95f3 --- /dev/null +++ b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py @@ -0,0 +1,401 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ...._utils import PropertyInfo +from ...._models import BaseModel + +__all__ = [ + "LedgerCreateEntryByExternalIDResponse", + "IncrementLedgerEntry", + "IncrementLedgerEntryCreditBlock", + "IncrementLedgerEntryCustomer", + "DecrementLedgerEntry", + "DecrementLedgerEntryCreditBlock", + "DecrementLedgerEntryCustomer", + "ExpirationChangeLedgerEntry", + "ExpirationChangeLedgerEntryCreditBlock", + "ExpirationChangeLedgerEntryCustomer", + "CreditBlockExpiryLedgerEntry", + "CreditBlockExpiryLedgerEntryCreditBlock", + "CreditBlockExpiryLedgerEntryCustomer", + "VoidLedgerEntry", + "VoidLedgerEntryCreditBlock", + "VoidLedgerEntryCustomer", + "VoidInitiatedLedgerEntry", + "VoidInitiatedLedgerEntryCreditBlock", + "VoidInitiatedLedgerEntryCustomer", + "AmendmentLedgerEntry", + "AmendmentLedgerEntryCreditBlock", + "AmendmentLedgerEntryCustomer", +] + + +class IncrementLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class IncrementLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class IncrementLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: IncrementLedgerEntryCreditBlock + + currency: str + + customer: IncrementLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["increment"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + +class DecrementLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class DecrementLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class DecrementLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: DecrementLedgerEntryCreditBlock + + currency: str + + customer: DecrementLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["decrement"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + event_id: Optional[str] = None + + invoice_id: Optional[str] = None + + price_id: Optional[str] = None + + +class ExpirationChangeLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class ExpirationChangeLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class ExpirationChangeLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: ExpirationChangeLedgerEntryCreditBlock + + currency: str + + customer: ExpirationChangeLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["expiration_change"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + new_block_expiry_date: Optional[datetime] = None + + starting_balance: float + + +class CreditBlockExpiryLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class CreditBlockExpiryLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class CreditBlockExpiryLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: CreditBlockExpiryLedgerEntryCreditBlock + + currency: str + + customer: CreditBlockExpiryLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["credit_block_expiry"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + +class VoidLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class VoidLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class VoidLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: VoidLedgerEntryCreditBlock + + currency: str + + customer: VoidLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["void"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + void_amount: float + + void_reason: Optional[str] = None + + +class VoidInitiatedLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class VoidInitiatedLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class VoidInitiatedLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: VoidInitiatedLedgerEntryCreditBlock + + currency: str + + customer: VoidInitiatedLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["void_initiated"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + new_block_expiry_date: datetime + + starting_balance: float + + void_amount: float + + void_reason: Optional[str] = None + + +class AmendmentLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class AmendmentLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class AmendmentLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: AmendmentLedgerEntryCreditBlock + + currency: str + + customer: AmendmentLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["amendment"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + +LedgerCreateEntryByExternalIDResponse: TypeAlias = Annotated[ + Union[ + IncrementLedgerEntry, + DecrementLedgerEntry, + ExpirationChangeLedgerEntry, + CreditBlockExpiryLedgerEntry, + VoidLedgerEntry, + VoidInitiatedLedgerEntry, + AmendmentLedgerEntry, + ], + PropertyInfo(discriminator="entry_type"), +] diff --git a/src/orb/types/customers/credits/ledger_create_entry_response.py b/src/orb/types/customers/credits/ledger_create_entry_response.py new file mode 100644 index 00000000..f21c2562 --- /dev/null +++ b/src/orb/types/customers/credits/ledger_create_entry_response.py @@ -0,0 +1,401 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ...._utils import PropertyInfo +from ...._models import BaseModel + +__all__ = [ + "LedgerCreateEntryResponse", + "IncrementLedgerEntry", + "IncrementLedgerEntryCreditBlock", + "IncrementLedgerEntryCustomer", + "DecrementLedgerEntry", + "DecrementLedgerEntryCreditBlock", + "DecrementLedgerEntryCustomer", + "ExpirationChangeLedgerEntry", + "ExpirationChangeLedgerEntryCreditBlock", + "ExpirationChangeLedgerEntryCustomer", + "CreditBlockExpiryLedgerEntry", + "CreditBlockExpiryLedgerEntryCreditBlock", + "CreditBlockExpiryLedgerEntryCustomer", + "VoidLedgerEntry", + "VoidLedgerEntryCreditBlock", + "VoidLedgerEntryCustomer", + "VoidInitiatedLedgerEntry", + "VoidInitiatedLedgerEntryCreditBlock", + "VoidInitiatedLedgerEntryCustomer", + "AmendmentLedgerEntry", + "AmendmentLedgerEntryCreditBlock", + "AmendmentLedgerEntryCustomer", +] + + +class IncrementLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class IncrementLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class IncrementLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: IncrementLedgerEntryCreditBlock + + currency: str + + customer: IncrementLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["increment"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + +class DecrementLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class DecrementLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class DecrementLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: DecrementLedgerEntryCreditBlock + + currency: str + + customer: DecrementLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["decrement"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + event_id: Optional[str] = None + + invoice_id: Optional[str] = None + + price_id: Optional[str] = None + + +class ExpirationChangeLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class ExpirationChangeLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class ExpirationChangeLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: ExpirationChangeLedgerEntryCreditBlock + + currency: str + + customer: ExpirationChangeLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["expiration_change"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + new_block_expiry_date: Optional[datetime] = None + + starting_balance: float + + +class CreditBlockExpiryLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class CreditBlockExpiryLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class CreditBlockExpiryLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: CreditBlockExpiryLedgerEntryCreditBlock + + currency: str + + customer: CreditBlockExpiryLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["credit_block_expiry"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + +class VoidLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class VoidLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class VoidLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: VoidLedgerEntryCreditBlock + + currency: str + + customer: VoidLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["void"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + void_amount: float + + void_reason: Optional[str] = None + + +class VoidInitiatedLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class VoidInitiatedLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class VoidInitiatedLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: VoidInitiatedLedgerEntryCreditBlock + + currency: str + + customer: VoidInitiatedLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["void_initiated"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + new_block_expiry_date: datetime + + starting_balance: float + + void_amount: float + + void_reason: Optional[str] = None + + +class AmendmentLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class AmendmentLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class AmendmentLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: AmendmentLedgerEntryCreditBlock + + currency: str + + customer: AmendmentLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["amendment"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + +LedgerCreateEntryResponse: TypeAlias = Annotated[ + Union[ + IncrementLedgerEntry, + DecrementLedgerEntry, + ExpirationChangeLedgerEntry, + CreditBlockExpiryLedgerEntry, + VoidLedgerEntry, + VoidInitiatedLedgerEntry, + AmendmentLedgerEntry, + ], + PropertyInfo(discriminator="entry_type"), +] diff --git a/src/orb/types/customers/credits/ledger_list_by_external_id_response.py b/src/orb/types/customers/credits/ledger_list_by_external_id_response.py new file mode 100644 index 00000000..e7b515fd --- /dev/null +++ b/src/orb/types/customers/credits/ledger_list_by_external_id_response.py @@ -0,0 +1,401 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ...._utils import PropertyInfo +from ...._models import BaseModel + +__all__ = [ + "LedgerListByExternalIDResponse", + "IncrementLedgerEntry", + "IncrementLedgerEntryCreditBlock", + "IncrementLedgerEntryCustomer", + "DecrementLedgerEntry", + "DecrementLedgerEntryCreditBlock", + "DecrementLedgerEntryCustomer", + "ExpirationChangeLedgerEntry", + "ExpirationChangeLedgerEntryCreditBlock", + "ExpirationChangeLedgerEntryCustomer", + "CreditBlockExpiryLedgerEntry", + "CreditBlockExpiryLedgerEntryCreditBlock", + "CreditBlockExpiryLedgerEntryCustomer", + "VoidLedgerEntry", + "VoidLedgerEntryCreditBlock", + "VoidLedgerEntryCustomer", + "VoidInitiatedLedgerEntry", + "VoidInitiatedLedgerEntryCreditBlock", + "VoidInitiatedLedgerEntryCustomer", + "AmendmentLedgerEntry", + "AmendmentLedgerEntryCreditBlock", + "AmendmentLedgerEntryCustomer", +] + + +class IncrementLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class IncrementLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class IncrementLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: IncrementLedgerEntryCreditBlock + + currency: str + + customer: IncrementLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["increment"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + +class DecrementLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class DecrementLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class DecrementLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: DecrementLedgerEntryCreditBlock + + currency: str + + customer: DecrementLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["decrement"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + event_id: Optional[str] = None + + invoice_id: Optional[str] = None + + price_id: Optional[str] = None + + +class ExpirationChangeLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class ExpirationChangeLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class ExpirationChangeLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: ExpirationChangeLedgerEntryCreditBlock + + currency: str + + customer: ExpirationChangeLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["expiration_change"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + new_block_expiry_date: Optional[datetime] = None + + starting_balance: float + + +class CreditBlockExpiryLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class CreditBlockExpiryLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class CreditBlockExpiryLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: CreditBlockExpiryLedgerEntryCreditBlock + + currency: str + + customer: CreditBlockExpiryLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["credit_block_expiry"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + +class VoidLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class VoidLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class VoidLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: VoidLedgerEntryCreditBlock + + currency: str + + customer: VoidLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["void"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + void_amount: float + + void_reason: Optional[str] = None + + +class VoidInitiatedLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class VoidInitiatedLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class VoidInitiatedLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: VoidInitiatedLedgerEntryCreditBlock + + currency: str + + customer: VoidInitiatedLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["void_initiated"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + new_block_expiry_date: datetime + + starting_balance: float + + void_amount: float + + void_reason: Optional[str] = None + + +class AmendmentLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class AmendmentLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class AmendmentLedgerEntry(BaseModel): + id: str + + amount: float + + created_at: datetime + + credit_block: AmendmentLedgerEntryCreditBlock + + currency: str + + customer: AmendmentLedgerEntryCustomer + + description: Optional[str] = None + + ending_balance: float + + entry_status: Literal["committed", "pending"] + + entry_type: Literal["amendment"] + + ledger_sequence_number: int + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + starting_balance: float + + +LedgerListByExternalIDResponse: TypeAlias = Annotated[ + Union[ + IncrementLedgerEntry, + DecrementLedgerEntry, + ExpirationChangeLedgerEntry, + CreditBlockExpiryLedgerEntry, + VoidLedgerEntry, + VoidInitiatedLedgerEntry, + AmendmentLedgerEntry, + ], + PropertyInfo(discriminator="entry_type"), +] diff --git a/src/orb/types/shared/credit_ledger_entry_model.py b/src/orb/types/customers/credits/ledger_list_response.py similarity index 63% rename from src/orb/types/shared/credit_ledger_entry_model.py rename to src/orb/types/customers/credits/ledger_list_response.py index d418fcd3..26008bcc 100644 --- a/src/orb/types/shared/credit_ledger_entry_model.py +++ b/src/orb/types/customers/credits/ledger_list_response.py @@ -4,23 +4,49 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias -from ..._utils import PropertyInfo -from ..._models import BaseModel -from .affected_block_model import AffectedBlockModel -from .customer_minified_model import CustomerMinifiedModel +from ...._utils import PropertyInfo +from ...._models import BaseModel __all__ = [ - "CreditLedgerEntryModel", + "LedgerListResponse", "IncrementLedgerEntry", + "IncrementLedgerEntryCreditBlock", + "IncrementLedgerEntryCustomer", "DecrementLedgerEntry", + "DecrementLedgerEntryCreditBlock", + "DecrementLedgerEntryCustomer", "ExpirationChangeLedgerEntry", + "ExpirationChangeLedgerEntryCreditBlock", + "ExpirationChangeLedgerEntryCustomer", "CreditBlockExpiryLedgerEntry", + "CreditBlockExpiryLedgerEntryCreditBlock", + "CreditBlockExpiryLedgerEntryCustomer", "VoidLedgerEntry", + "VoidLedgerEntryCreditBlock", + "VoidLedgerEntryCustomer", "VoidInitiatedLedgerEntry", + "VoidInitiatedLedgerEntryCreditBlock", + "VoidInitiatedLedgerEntryCustomer", "AmendmentLedgerEntry", + "AmendmentLedgerEntryCreditBlock", + "AmendmentLedgerEntryCustomer", ] +class IncrementLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class IncrementLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + class IncrementLedgerEntry(BaseModel): id: str @@ -28,11 +54,11 @@ class IncrementLedgerEntry(BaseModel): created_at: datetime - credit_block: AffectedBlockModel + credit_block: IncrementLedgerEntryCreditBlock currency: str - customer: CustomerMinifiedModel + customer: IncrementLedgerEntryCustomer description: Optional[str] = None @@ -55,6 +81,20 @@ class IncrementLedgerEntry(BaseModel): starting_balance: float +class DecrementLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class DecrementLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + class DecrementLedgerEntry(BaseModel): id: str @@ -62,11 +102,11 @@ class DecrementLedgerEntry(BaseModel): created_at: datetime - credit_block: AffectedBlockModel + credit_block: DecrementLedgerEntryCreditBlock currency: str - customer: CustomerMinifiedModel + customer: DecrementLedgerEntryCustomer description: Optional[str] = None @@ -95,6 +135,20 @@ class DecrementLedgerEntry(BaseModel): price_id: Optional[str] = None +class ExpirationChangeLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class ExpirationChangeLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + class ExpirationChangeLedgerEntry(BaseModel): id: str @@ -102,11 +156,11 @@ class ExpirationChangeLedgerEntry(BaseModel): created_at: datetime - credit_block: AffectedBlockModel + credit_block: ExpirationChangeLedgerEntryCreditBlock currency: str - customer: CustomerMinifiedModel + customer: ExpirationChangeLedgerEntryCustomer description: Optional[str] = None @@ -131,6 +185,20 @@ class ExpirationChangeLedgerEntry(BaseModel): starting_balance: float +class CreditBlockExpiryLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class CreditBlockExpiryLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + class CreditBlockExpiryLedgerEntry(BaseModel): id: str @@ -138,11 +206,11 @@ class CreditBlockExpiryLedgerEntry(BaseModel): created_at: datetime - credit_block: AffectedBlockModel + credit_block: CreditBlockExpiryLedgerEntryCreditBlock currency: str - customer: CustomerMinifiedModel + customer: CreditBlockExpiryLedgerEntryCustomer description: Optional[str] = None @@ -165,6 +233,20 @@ class CreditBlockExpiryLedgerEntry(BaseModel): starting_balance: float +class VoidLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class VoidLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + class VoidLedgerEntry(BaseModel): id: str @@ -172,11 +254,11 @@ class VoidLedgerEntry(BaseModel): created_at: datetime - credit_block: AffectedBlockModel + credit_block: VoidLedgerEntryCreditBlock currency: str - customer: CustomerMinifiedModel + customer: VoidLedgerEntryCustomer description: Optional[str] = None @@ -203,6 +285,20 @@ class VoidLedgerEntry(BaseModel): void_reason: Optional[str] = None +class VoidInitiatedLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class VoidInitiatedLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + class VoidInitiatedLedgerEntry(BaseModel): id: str @@ -210,11 +306,11 @@ class VoidInitiatedLedgerEntry(BaseModel): created_at: datetime - credit_block: AffectedBlockModel + credit_block: VoidInitiatedLedgerEntryCreditBlock currency: str - customer: CustomerMinifiedModel + customer: VoidInitiatedLedgerEntryCustomer description: Optional[str] = None @@ -243,6 +339,20 @@ class VoidInitiatedLedgerEntry(BaseModel): void_reason: Optional[str] = None +class AmendmentLedgerEntryCreditBlock(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None + + +class AmendmentLedgerEntryCustomer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + class AmendmentLedgerEntry(BaseModel): id: str @@ -250,11 +360,11 @@ class AmendmentLedgerEntry(BaseModel): created_at: datetime - credit_block: AffectedBlockModel + credit_block: AmendmentLedgerEntryCreditBlock currency: str - customer: CustomerMinifiedModel + customer: AmendmentLedgerEntryCustomer description: Optional[str] = None @@ -277,7 +387,7 @@ class AmendmentLedgerEntry(BaseModel): starting_balance: float -CreditLedgerEntryModel: TypeAlias = Annotated[ +LedgerListResponse: TypeAlias = Annotated[ Union[ IncrementLedgerEntry, DecrementLedgerEntry, diff --git a/src/orb/types/customers/credits/top_up_create_by_external_id_response.py b/src/orb/types/customers/credits/top_up_create_by_external_id_response.py new file mode 100644 index 00000000..9b889e61 --- /dev/null +++ b/src/orb/types/customers/credits/top_up_create_by_external_id_response.py @@ -0,0 +1,67 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["TopUpCreateByExternalIDResponse", "InvoiceSettings"] + + +class InvoiceSettings(BaseModel): + auto_collection: bool + """ + Whether the credits purchase invoice should auto collect with the customer's + saved payment method. + """ + + net_terms: int + """ + The net terms determines the difference between the invoice date and the issue + date for the invoice. If you intend the invoice to be due on issue, set this + to 0. + """ + + memo: Optional[str] = None + """An optional memo to display on the invoice.""" + + require_successful_payment: Optional[bool] = None + """ + If true, new credit blocks created by this top-up will require that the + corresponding invoice is paid before they can be drawn down from. + """ + + +class TopUpCreateByExternalIDResponse(BaseModel): + id: str + + amount: str + """The amount to increment when the threshold is reached.""" + + currency: str + """The currency or custom pricing unit to use for this top-up. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + invoice_settings: InvoiceSettings + """Settings for invoices generated by triggered top-ups.""" + + per_unit_cost_basis: str + """How much, in the customer's currency, to charge for each unit.""" + + threshold: str + """The threshold at which to trigger the top-up. + + If the balance is at or below this threshold, the top-up will be triggered. + """ + + expires_after: Optional[int] = None + """The number of days or months after which the top-up expires. + + If unspecified, it does not expire. + """ + + expires_after_unit: Optional[Literal["day", "month"]] = None + """The unit of expires_after.""" diff --git a/src/orb/types/customers/credits/top_up_create_response.py b/src/orb/types/customers/credits/top_up_create_response.py new file mode 100644 index 00000000..d9497888 --- /dev/null +++ b/src/orb/types/customers/credits/top_up_create_response.py @@ -0,0 +1,67 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["TopUpCreateResponse", "InvoiceSettings"] + + +class InvoiceSettings(BaseModel): + auto_collection: bool + """ + Whether the credits purchase invoice should auto collect with the customer's + saved payment method. + """ + + net_terms: int + """ + The net terms determines the difference between the invoice date and the issue + date for the invoice. If you intend the invoice to be due on issue, set this + to 0. + """ + + memo: Optional[str] = None + """An optional memo to display on the invoice.""" + + require_successful_payment: Optional[bool] = None + """ + If true, new credit blocks created by this top-up will require that the + corresponding invoice is paid before they can be drawn down from. + """ + + +class TopUpCreateResponse(BaseModel): + id: str + + amount: str + """The amount to increment when the threshold is reached.""" + + currency: str + """The currency or custom pricing unit to use for this top-up. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + invoice_settings: InvoiceSettings + """Settings for invoices generated by triggered top-ups.""" + + per_unit_cost_basis: str + """How much, in the customer's currency, to charge for each unit.""" + + threshold: str + """The threshold at which to trigger the top-up. + + If the balance is at or below this threshold, the top-up will be triggered. + """ + + expires_after: Optional[int] = None + """The number of days or months after which the top-up expires. + + If unspecified, it does not expire. + """ + + expires_after_unit: Optional[Literal["day", "month"]] = None + """The unit of expires_after.""" diff --git a/src/orb/types/customers/credits/top_up_list_by_external_id_response.py b/src/orb/types/customers/credits/top_up_list_by_external_id_response.py new file mode 100644 index 00000000..fc3088ad --- /dev/null +++ b/src/orb/types/customers/credits/top_up_list_by_external_id_response.py @@ -0,0 +1,67 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["TopUpListByExternalIDResponse", "InvoiceSettings"] + + +class InvoiceSettings(BaseModel): + auto_collection: bool + """ + Whether the credits purchase invoice should auto collect with the customer's + saved payment method. + """ + + net_terms: int + """ + The net terms determines the difference between the invoice date and the issue + date for the invoice. If you intend the invoice to be due on issue, set this + to 0. + """ + + memo: Optional[str] = None + """An optional memo to display on the invoice.""" + + require_successful_payment: Optional[bool] = None + """ + If true, new credit blocks created by this top-up will require that the + corresponding invoice is paid before they can be drawn down from. + """ + + +class TopUpListByExternalIDResponse(BaseModel): + id: str + + amount: str + """The amount to increment when the threshold is reached.""" + + currency: str + """The currency or custom pricing unit to use for this top-up. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + invoice_settings: InvoiceSettings + """Settings for invoices generated by triggered top-ups.""" + + per_unit_cost_basis: str + """How much, in the customer's currency, to charge for each unit.""" + + threshold: str + """The threshold at which to trigger the top-up. + + If the balance is at or below this threshold, the top-up will be triggered. + """ + + expires_after: Optional[int] = None + """The number of days or months after which the top-up expires. + + If unspecified, it does not expire. + """ + + expires_after_unit: Optional[Literal["day", "month"]] = None + """The unit of expires_after.""" diff --git a/src/orb/types/shared/top_up_model.py b/src/orb/types/customers/credits/top_up_list_response.py similarity index 93% rename from src/orb/types/shared/top_up_model.py rename to src/orb/types/customers/credits/top_up_list_response.py index f6e0f5d7..69a59f4d 100644 --- a/src/orb/types/shared/top_up_model.py +++ b/src/orb/types/customers/credits/top_up_list_response.py @@ -3,9 +3,9 @@ from typing import Optional from typing_extensions import Literal -from ..._models import BaseModel +from ...._models import BaseModel -__all__ = ["TopUpModel", "InvoiceSettings"] +__all__ = ["TopUpListResponse", "InvoiceSettings"] class InvoiceSettings(BaseModel): @@ -32,7 +32,7 @@ class InvoiceSettings(BaseModel): """ -class TopUpModel(BaseModel): +class TopUpListResponse(BaseModel): id: str amount: str diff --git a/src/orb/types/shared/dimensional_price_group_model.py b/src/orb/types/dimensional_price_group.py similarity index 88% rename from src/orb/types/shared/dimensional_price_group_model.py rename to src/orb/types/dimensional_price_group.py index f57ae0dd..da103128 100644 --- a/src/orb/types/shared/dimensional_price_group_model.py +++ b/src/orb/types/dimensional_price_group.py @@ -2,12 +2,12 @@ from typing import Dict, List, Optional -from ..._models import BaseModel +from .._models import BaseModel -__all__ = ["DimensionalPriceGroupModel"] +__all__ = ["DimensionalPriceGroup"] -class DimensionalPriceGroupModel(BaseModel): +class DimensionalPriceGroup(BaseModel): id: str billable_metric_id: str diff --git a/src/orb/types/dimensional_price_groups/dimensional_price_groups.py b/src/orb/types/dimensional_price_groups/dimensional_price_groups.py index 21272dad..78893603 100644 --- a/src/orb/types/dimensional_price_groups/dimensional_price_groups.py +++ b/src/orb/types/dimensional_price_groups/dimensional_price_groups.py @@ -3,13 +3,13 @@ from typing import List from ..._models import BaseModel +from ..dimensional_price_group import DimensionalPriceGroup from ..shared.pagination_metadata import PaginationMetadata -from ..shared.dimensional_price_group_model import DimensionalPriceGroupModel __all__ = ["DimensionalPriceGroups"] class DimensionalPriceGroups(BaseModel): - data: List[DimensionalPriceGroupModel] + data: List[DimensionalPriceGroup] pagination_metadata: PaginationMetadata diff --git a/src/orb/types/events/__init__.py b/src/orb/types/events/__init__.py index e28a527f..554bf2a0 100644 --- a/src/orb/types/events/__init__.py +++ b/src/orb/types/events/__init__.py @@ -6,3 +6,8 @@ from .volume_list_params import VolumeListParams as VolumeListParams from .backfill_list_params import BackfillListParams as BackfillListParams from .backfill_create_params import BackfillCreateParams as BackfillCreateParams +from .backfill_list_response import BackfillListResponse as BackfillListResponse +from .backfill_close_response import BackfillCloseResponse as BackfillCloseResponse +from .backfill_fetch_response import BackfillFetchResponse as BackfillFetchResponse +from .backfill_create_response import BackfillCreateResponse as BackfillCreateResponse +from .backfill_revert_response import BackfillRevertResponse as BackfillRevertResponse diff --git a/src/orb/types/events/backfill_close_response.py b/src/orb/types/events/backfill_close_response.py new file mode 100644 index 00000000..058edebe --- /dev/null +++ b/src/orb/types/events/backfill_close_response.py @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BackfillCloseResponse"] + + +class BackfillCloseResponse(BaseModel): + id: str + + close_time: Optional[datetime] = None + """If in the future, the time at which the backfill will automatically close. + + If in the past, the time at which the backfill was closed. + """ + + created_at: datetime + + customer_id: Optional[str] = None + """The Orb-generated ID of the customer to which this backfill is scoped. + + If `null`, this backfill is scoped to all customers. + """ + + 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.""" + + status: Literal["pending", "reflected", "pending_revert", "reverted"] + """The status of the backfill.""" + + timeframe_end: datetime + + timeframe_start: datetime + + deprecation_filter: Optional[str] = None + """ + A boolean + [computed property](/extensibility/advanced-metrics#computed-properties) used to + filter the set of events to deprecate + """ diff --git a/src/orb/types/events/backfill_create_response.py b/src/orb/types/events/backfill_create_response.py new file mode 100644 index 00000000..90e185d5 --- /dev/null +++ b/src/orb/types/events/backfill_create_response.py @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BackfillCreateResponse"] + + +class BackfillCreateResponse(BaseModel): + id: str + + close_time: Optional[datetime] = None + """If in the future, the time at which the backfill will automatically close. + + If in the past, the time at which the backfill was closed. + """ + + created_at: datetime + + customer_id: Optional[str] = None + """The Orb-generated ID of the customer to which this backfill is scoped. + + If `null`, this backfill is scoped to all customers. + """ + + 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.""" + + status: Literal["pending", "reflected", "pending_revert", "reverted"] + """The status of the backfill.""" + + timeframe_end: datetime + + timeframe_start: datetime + + deprecation_filter: Optional[str] = None + """ + A boolean + [computed property](/extensibility/advanced-metrics#computed-properties) used to + filter the set of events to deprecate + """ diff --git a/src/orb/types/events/backfill_fetch_response.py b/src/orb/types/events/backfill_fetch_response.py new file mode 100644 index 00000000..2c253373 --- /dev/null +++ b/src/orb/types/events/backfill_fetch_response.py @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BackfillFetchResponse"] + + +class BackfillFetchResponse(BaseModel): + id: str + + close_time: Optional[datetime] = None + """If in the future, the time at which the backfill will automatically close. + + If in the past, the time at which the backfill was closed. + """ + + created_at: datetime + + customer_id: Optional[str] = None + """The Orb-generated ID of the customer to which this backfill is scoped. + + If `null`, this backfill is scoped to all customers. + """ + + 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.""" + + status: Literal["pending", "reflected", "pending_revert", "reverted"] + """The status of the backfill.""" + + timeframe_end: datetime + + timeframe_start: datetime + + deprecation_filter: Optional[str] = None + """ + A boolean + [computed property](/extensibility/advanced-metrics#computed-properties) used to + filter the set of events to deprecate + """ diff --git a/src/orb/types/shared/backfill_model.py b/src/orb/types/events/backfill_list_response.py similarity index 95% rename from src/orb/types/shared/backfill_model.py rename to src/orb/types/events/backfill_list_response.py index 75c1da23..b470ba1f 100644 --- a/src/orb/types/shared/backfill_model.py +++ b/src/orb/types/events/backfill_list_response.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["BackfillModel"] +__all__ = ["BackfillListResponse"] -class BackfillModel(BaseModel): +class BackfillListResponse(BaseModel): id: str close_time: Optional[datetime] = None diff --git a/src/orb/types/events/backfill_revert_response.py b/src/orb/types/events/backfill_revert_response.py new file mode 100644 index 00000000..52ec1314 --- /dev/null +++ b/src/orb/types/events/backfill_revert_response.py @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BackfillRevertResponse"] + + +class BackfillRevertResponse(BaseModel): + id: str + + close_time: Optional[datetime] = None + """If in the future, the time at which the backfill will automatically close. + + If in the past, the time at which the backfill was closed. + """ + + created_at: datetime + + customer_id: Optional[str] = None + """The Orb-generated ID of the customer to which this backfill is scoped. + + If `null`, this backfill is scoped to all customers. + """ + + 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.""" + + status: Literal["pending", "reflected", "pending_revert", "reverted"] + """The status of the backfill.""" + + timeframe_end: datetime + + timeframe_start: datetime + + deprecation_filter: Optional[str] = None + """ + A boolean + [computed property](/extensibility/advanced-metrics#computed-properties) used to + filter the set of events to deprecate + """ diff --git a/src/orb/types/shared/invoice_model.py b/src/orb/types/invoice.py similarity index 51% rename from src/orb/types/shared/invoice_model.py rename to src/orb/types/invoice.py index db2238ba..ebc09d4e 100644 --- a/src/orb/types/shared/invoice_model.py +++ b/src/orb/types/invoice.py @@ -1,27 +1,756 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel -from .address_model import AddressModel -from .maximum_model import MaximumModel -from .minimum_model import MinimumModel -from .auto_collection_model import AutoCollectionModel -from .customer_tax_id_model import CustomerTaxIDModel -from .payment_attempt_model import PaymentAttemptModel -from .invoice_level_discount import InvoiceLevelDiscount -from .customer_minified_model import CustomerMinifiedModel -from .invoice_line_item_model import InvoiceLineItemModel -from .credit_note_summary_model import CreditNoteSummaryModel -from .subscription_minified_model import SubscriptionMinifiedModel -from .customer_balance_transaction_model import CustomerBalanceTransactionModel - -__all__ = ["InvoiceModel"] - - -class InvoiceModel(BaseModel): +from typing_extensions import Literal, Annotated, TypeAlias + +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .shared.discount import Discount +from .shared.invoice_level_discount import InvoiceLevelDiscount + +__all__ = [ + "Invoice", + "AutoCollection", + "BillingAddress", + "CreditNote", + "Customer", + "CustomerBalanceTransaction", + "CustomerBalanceTransactionCreditNote", + "CustomerBalanceTransactionInvoice", + "CustomerTaxID", + "LineItem", + "LineItemAdjustment", + "LineItemAdjustmentMonetaryUsageDiscountAdjustment", + "LineItemAdjustmentMonetaryAmountDiscountAdjustment", + "LineItemAdjustmentMonetaryPercentageDiscountAdjustment", + "LineItemAdjustmentMonetaryMinimumAdjustment", + "LineItemAdjustmentMonetaryMaximumAdjustment", + "LineItemMaximum", + "LineItemMinimum", + "LineItemSubLineItem", + "LineItemSubLineItemMatrixSubLineItem", + "LineItemSubLineItemMatrixSubLineItemGrouping", + "LineItemSubLineItemMatrixSubLineItemMatrixConfig", + "LineItemSubLineItemTierSubLineItem", + "LineItemSubLineItemTierSubLineItemGrouping", + "LineItemSubLineItemTierSubLineItemTierConfig", + "LineItemSubLineItemOtherSubLineItem", + "LineItemSubLineItemOtherSubLineItemGrouping", + "LineItemTaxAmount", + "Maximum", + "Minimum", + "PaymentAttempt", + "ShippingAddress", + "Subscription", +] + + +class AutoCollection(BaseModel): + enabled: Optional[bool] = None + """True only if auto-collection is enabled for this invoice.""" + + next_attempt_at: Optional[datetime] = None + """ + If the invoice is scheduled for auto-collection, this field will reflect when + the next attempt will occur. If dunning has been exhausted, or auto-collection + is not enabled for this invoice, this field will be `null`. + """ + + num_attempts: Optional[int] = None + """Number of auto-collection payment attempts.""" + + previously_attempted_at: Optional[datetime] = None + """ + If Orb has ever attempted payment auto-collection for this invoice, this field + will reflect when that attempt occurred. In conjunction with `next_attempt_at`, + this can be used to tell whether the invoice is currently in dunning (that is, + `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or + if dunning has been exhausted (`previously_attempted_at` is non-null, but + `next_attempt_time` is null). + """ + + +class BillingAddress(BaseModel): + city: Optional[str] = None + + country: Optional[str] = None + + line1: Optional[str] = None + + line2: Optional[str] = None + + postal_code: Optional[str] = None + + state: Optional[str] = None + + +class CreditNote(BaseModel): + id: str + + credit_note_number: str + + memo: Optional[str] = None + """An optional memo supplied on the credit note.""" + + reason: str + + total: str + + type: str + + voided_at: Optional[datetime] = None + """ + If the credit note has a status of `void`, this gives a timestamp when the + credit note was voided. + """ + + +class Customer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class CustomerBalanceTransactionCreditNote(BaseModel): + id: str + """The id of the Credit note""" + + +class CustomerBalanceTransactionInvoice(BaseModel): + id: str + """The Invoice id""" + + +class CustomerBalanceTransaction(BaseModel): + id: str + """A unique id for this transaction.""" + + action: Literal[ + "applied_to_invoice", + "manual_adjustment", + "prorated_refund", + "revert_prorated_refund", + "return_from_voiding", + "credit_note_applied", + "credit_note_voided", + "overpayment_refund", + "external_payment", + ] + + amount: str + """The value of the amount changed in the transaction.""" + + created_at: datetime + """The creation time of this transaction.""" + + credit_note: Optional[CustomerBalanceTransactionCreditNote] = None + + description: Optional[str] = None + """An optional description provided for manual customer balance adjustments.""" + + ending_balance: str + """ + The new value of the customer's balance prior to the transaction, in the + customer's currency. + """ + + invoice: Optional[CustomerBalanceTransactionInvoice] = None + + starting_balance: str + """ + The original value of the customer's balance prior to the transaction, in the + customer's currency. + """ + + type: Literal["increment", "decrement"] + + +class CustomerTaxID(BaseModel): + country: Literal[ + "AD", + "AE", + "AR", + "AT", + "AU", + "BE", + "BG", + "BH", + "BO", + "BR", + "CA", + "CH", + "CL", + "CN", + "CO", + "CR", + "CY", + "CZ", + "DE", + "DK", + "EE", + "DO", + "EC", + "EG", + "ES", + "EU", + "FI", + "FR", + "GB", + "GE", + "GR", + "HK", + "HR", + "HU", + "ID", + "IE", + "IL", + "IN", + "IS", + "IT", + "JP", + "KE", + "KR", + "KZ", + "LI", + "LT", + "LU", + "LV", + "MT", + "MX", + "MY", + "NG", + "NL", + "NO", + "NZ", + "OM", + "PE", + "PH", + "PL", + "PT", + "RO", + "RS", + "RU", + "SA", + "SE", + "SG", + "SI", + "SK", + "SV", + "TH", + "TR", + "TW", + "UA", + "US", + "UY", + "VE", + "VN", + "ZA", + ] + + type: Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "eu_vat", + "au_abn", + "au_arn", + "bg_uic", + "bh_vat", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "kz_bin", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + + value: str + + +class LineItemAdjustmentMonetaryUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + amount: str + """The value applied by an adjustment.""" + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + 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 LineItemAdjustmentMonetaryAmountDiscountAdjustment(BaseModel): + id: str + + 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.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class LineItemAdjustmentMonetaryPercentageDiscountAdjustment(BaseModel): + id: str + + 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.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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. + """ + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +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.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + adjustment applies to. + """ + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +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.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + adjustment applies to. + """ + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +LineItemAdjustment: TypeAlias = Annotated[ + Union[ + LineItemAdjustmentMonetaryUsageDiscountAdjustment, + LineItemAdjustmentMonetaryAmountDiscountAdjustment, + LineItemAdjustmentMonetaryPercentageDiscountAdjustment, + LineItemAdjustmentMonetaryMinimumAdjustment, + LineItemAdjustmentMonetaryMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class LineItemMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class LineItemMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class LineItemSubLineItemMatrixSubLineItemGrouping(BaseModel): + key: str + + value: Optional[str] = None + """No value indicates the default group""" + + +class LineItemSubLineItemMatrixSubLineItemMatrixConfig(BaseModel): + dimension_values: List[Optional[str]] + """The ordered dimension values for this line item.""" + + +class LineItemSubLineItemMatrixSubLineItem(BaseModel): + amount: str + """The total amount for this sub line item.""" + + grouping: Optional[LineItemSubLineItemMatrixSubLineItemGrouping] = None + + matrix_config: LineItemSubLineItemMatrixSubLineItemMatrixConfig + + name: str + + quantity: float + + type: Literal["matrix"] + + +class LineItemSubLineItemTierSubLineItemGrouping(BaseModel): + key: str + + value: Optional[str] = None + """No value indicates the default group""" + + +class LineItemSubLineItemTierSubLineItemTierConfig(BaseModel): + first_unit: float + + last_unit: Optional[float] = None + + unit_amount: str + + +class LineItemSubLineItemTierSubLineItem(BaseModel): + amount: str + """The total amount for this sub line item.""" + + grouping: Optional[LineItemSubLineItemTierSubLineItemGrouping] = None + + name: str + + quantity: float + + tier_config: LineItemSubLineItemTierSubLineItemTierConfig + + type: Literal["tier"] + + +class LineItemSubLineItemOtherSubLineItemGrouping(BaseModel): + key: str + + value: Optional[str] = None + """No value indicates the default group""" + + +class LineItemSubLineItemOtherSubLineItem(BaseModel): + amount: str + """The total amount for this sub line item.""" + + grouping: Optional[LineItemSubLineItemOtherSubLineItemGrouping] = None + + name: str + + quantity: float + + type: Literal["'null'"] + + +LineItemSubLineItem: TypeAlias = Annotated[ + Union[ + LineItemSubLineItemMatrixSubLineItem, LineItemSubLineItemTierSubLineItem, LineItemSubLineItemOtherSubLineItem + ], + PropertyInfo(discriminator="type"), +] + + +class LineItemTaxAmount(BaseModel): + amount: str + """The amount of additional tax incurred by this tax rate.""" + + tax_rate_description: str + """The human-readable description of the applied tax rate.""" + + tax_rate_percentage: Optional[str] = None + """The tax rate percentage, out of 100.""" + + +class LineItem(BaseModel): + id: str + """A unique ID for this line item.""" + + adjusted_subtotal: str + """ + The line amount after any adjustments and before overage conversion, credits and + partial invoicing. + """ + + adjustments: List[LineItemAdjustment] + """All adjustments (ie. maximums, minimums, discounts) applied to the line item.""" + + amount: str + """ + The final amount for a line item after all adjustments and pre paid credits have + been applied. + """ + + credits_applied: str + """The number of prepaid credits applied.""" + + discount: Optional[Discount] = None + + end_date: datetime + """The end date of the range of time applied for this line item's price.""" + + filter: Optional[str] = None + """An additional filter that was used to calculate the usage for this line item.""" + + grouping: Optional[str] = None + """ + [DEPRECATED] For configured prices that are split by a grouping key, this will + be populated with the key and a value. The `amount` and `subtotal` will be the + values for this particular grouping. + """ + + maximum: Optional[LineItemMaximum] = None + """This field is deprecated in favor of `adjustments`.""" + + maximum_amount: Optional[str] = None + """This field is deprecated in favor of `adjustments`.""" + + minimum: Optional[LineItemMinimum] = None + """This field is deprecated in favor of `adjustments`.""" + + minimum_amount: Optional[str] = None + """This field is deprecated in favor of `adjustments`.""" + + name: str + """The name of the price associated with this line item.""" + + partially_invoiced_amount: str + """Any amount applied from a partial invoice""" + + price: Optional[Price] = None + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + 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.""" + + sub_line_items: List[LineItemSubLineItem] + """ + For complex pricing structures, the line item can be broken down further in + `sub_line_items`. + """ + + subtotal: str + """The line amount before before any adjustments.""" + + tax_amounts: List[LineItemTaxAmount] + """An array of tax rates and their incurred tax amounts. + + Empty if no tax integration is configured. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer ids that were used to calculate the usage for this line item. + """ + + +class Maximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class Minimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class PaymentAttempt(BaseModel): + id: str + """The ID of the payment attempt.""" + + amount: str + """The amount of the payment attempt.""" + + created_at: datetime + """The time at which the payment attempt was created.""" + + payment_provider: Optional[Literal["stripe"]] = None + """The payment provider that attempted to collect the payment.""" + + payment_provider_id: Optional[str] = None + """The ID of the payment attempt in the payment provider.""" + + succeeded: bool + """Whether the payment attempt succeeded.""" + + +class ShippingAddress(BaseModel): + city: Optional[str] = None + + country: Optional[str] = None + + line1: Optional[str] = None + + line2: Optional[str] = None + + postal_code: Optional[str] = None + + state: Optional[str] = None + + +class Subscription(BaseModel): + id: str + + +class Invoice(BaseModel): id: str amount_due: str @@ -30,24 +759,24 @@ class InvoiceModel(BaseModel): application of the customer balance to the `total` of the invoice. """ - auto_collection: AutoCollectionModel + auto_collection: AutoCollection - billing_address: Optional[AddressModel] = None + billing_address: Optional[BillingAddress] = None created_at: datetime """The creation time of the resource in Orb.""" - credit_notes: List[CreditNoteSummaryModel] + credit_notes: List[CreditNote] """A list of credit notes associated with the invoice""" currency: str """An ISO 4217 currency string or `credits`""" - customer: CustomerMinifiedModel + customer: Customer - customer_balance_transactions: List[CustomerBalanceTransactionModel] + customer_balance_transactions: List[CustomerBalanceTransaction] - customer_tax_id: Optional[CustomerTaxIDModel] = None + customer_tax_id: Optional[CustomerTaxID] = None """ Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. @@ -212,10 +941,10 @@ class InvoiceModel(BaseModel): `issued` (even if it is now in a different state.) """ - line_items: List[InvoiceLineItemModel] + line_items: List[LineItem] """The breakdown of prices in this invoice.""" - maximum: Optional[MaximumModel] = None + maximum: Optional[Maximum] = None maximum_amount: Optional[str] = None @@ -232,7 +961,7 @@ class InvoiceModel(BaseModel): cleared by setting `metadata` to `null`. """ - minimum: Optional[MinimumModel] = None + minimum: Optional[Minimum] = None minimum_amount: Optional[str] = None @@ -242,7 +971,7 @@ class InvoiceModel(BaseModel): was paid. """ - payment_attempts: List[PaymentAttemptModel] + payment_attempts: List[PaymentAttempt] """A list of payment attempts associated with the invoice""" payment_failed_at: Optional[datetime] = None @@ -264,11 +993,11 @@ class InvoiceModel(BaseModel): scheduled to be issued. """ - shipping_address: Optional[AddressModel] = None + shipping_address: Optional[ShippingAddress] = None status: Literal["issued", "paid", "synced", "void", "draft"] - subscription: Optional[SubscriptionMinifiedModel] = None + subscription: Optional[Subscription] = None subtotal: str """The total before any discounts and minimums are applied.""" diff --git a/src/orb/types/invoice_create_params.py b/src/orb/types/invoice_create_params.py index 417e04c5..78e22ea8 100644 --- a/src/orb/types/invoice_create_params.py +++ b/src/orb/types/invoice_create_params.py @@ -8,9 +8,8 @@ from .._utils import PropertyInfo from .shared_params.discount import Discount -from .shared_params.unit_config_model import UnitConfigModel -__all__ = ["InvoiceCreateParams", "LineItem"] +__all__ = ["InvoiceCreateParams", "LineItem", "LineItemUnitConfig"] class InvoiceCreateParams(TypedDict, total=False): @@ -70,6 +69,11 @@ class InvoiceCreateParams(TypedDict, total=False): """ +class LineItemUnitConfig(TypedDict, total=False): + unit_amount: Required[str] + """Rate per unit of usage""" + + class LineItem(TypedDict, total=False): end_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] """A date string to specify the line item's end date in the customer's timezone.""" @@ -87,4 +91,4 @@ class LineItem(TypedDict, total=False): start_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] """A date string to specify the line item's start date in the customer's timezone.""" - unit_config: Required[UnitConfigModel] + unit_config: Required[LineItemUnitConfig] diff --git a/src/orb/types/invoice_fetch_upcoming_response.py b/src/orb/types/invoice_fetch_upcoming_response.py index ac680775..ca7af8dc 100644 --- a/src/orb/types/invoice_fetch_upcoming_response.py +++ b/src/orb/types/invoice_fetch_upcoming_response.py @@ -1,24 +1,753 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, Annotated, TypeAlias +from .price import Price +from .._utils import PropertyInfo from .._models import BaseModel -from .shared.address_model import AddressModel -from .shared.maximum_model import MaximumModel -from .shared.minimum_model import MinimumModel -from .shared.auto_collection_model import AutoCollectionModel -from .shared.customer_tax_id_model import CustomerTaxIDModel -from .shared.payment_attempt_model import PaymentAttemptModel +from .shared.discount import Discount from .shared.invoice_level_discount import InvoiceLevelDiscount -from .shared.customer_minified_model import CustomerMinifiedModel -from .shared.invoice_line_item_model import InvoiceLineItemModel -from .shared.credit_note_summary_model import CreditNoteSummaryModel -from .shared.subscription_minified_model import SubscriptionMinifiedModel -from .shared.customer_balance_transaction_model import CustomerBalanceTransactionModel -__all__ = ["InvoiceFetchUpcomingResponse"] +__all__ = [ + "InvoiceFetchUpcomingResponse", + "AutoCollection", + "BillingAddress", + "CreditNote", + "Customer", + "CustomerBalanceTransaction", + "CustomerBalanceTransactionCreditNote", + "CustomerBalanceTransactionInvoice", + "CustomerTaxID", + "LineItem", + "LineItemAdjustment", + "LineItemAdjustmentMonetaryUsageDiscountAdjustment", + "LineItemAdjustmentMonetaryAmountDiscountAdjustment", + "LineItemAdjustmentMonetaryPercentageDiscountAdjustment", + "LineItemAdjustmentMonetaryMinimumAdjustment", + "LineItemAdjustmentMonetaryMaximumAdjustment", + "LineItemMaximum", + "LineItemMinimum", + "LineItemSubLineItem", + "LineItemSubLineItemMatrixSubLineItem", + "LineItemSubLineItemMatrixSubLineItemGrouping", + "LineItemSubLineItemMatrixSubLineItemMatrixConfig", + "LineItemSubLineItemTierSubLineItem", + "LineItemSubLineItemTierSubLineItemGrouping", + "LineItemSubLineItemTierSubLineItemTierConfig", + "LineItemSubLineItemOtherSubLineItem", + "LineItemSubLineItemOtherSubLineItemGrouping", + "LineItemTaxAmount", + "Maximum", + "Minimum", + "PaymentAttempt", + "ShippingAddress", + "Subscription", +] + + +class AutoCollection(BaseModel): + enabled: Optional[bool] = None + """True only if auto-collection is enabled for this invoice.""" + + next_attempt_at: Optional[datetime] = None + """ + If the invoice is scheduled for auto-collection, this field will reflect when + the next attempt will occur. If dunning has been exhausted, or auto-collection + is not enabled for this invoice, this field will be `null`. + """ + + num_attempts: Optional[int] = None + """Number of auto-collection payment attempts.""" + + previously_attempted_at: Optional[datetime] = None + """ + If Orb has ever attempted payment auto-collection for this invoice, this field + will reflect when that attempt occurred. In conjunction with `next_attempt_at`, + this can be used to tell whether the invoice is currently in dunning (that is, + `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or + if dunning has been exhausted (`previously_attempted_at` is non-null, but + `next_attempt_time` is null). + """ + + +class BillingAddress(BaseModel): + city: Optional[str] = None + + country: Optional[str] = None + + line1: Optional[str] = None + + line2: Optional[str] = None + + postal_code: Optional[str] = None + + state: Optional[str] = None + + +class CreditNote(BaseModel): + id: str + + credit_note_number: str + + memo: Optional[str] = None + """An optional memo supplied on the credit note.""" + + reason: str + + total: str + + type: str + + voided_at: Optional[datetime] = None + """ + If the credit note has a status of `void`, this gives a timestamp when the + credit note was voided. + """ + + +class Customer(BaseModel): + id: str + + external_customer_id: Optional[str] = None + + +class CustomerBalanceTransactionCreditNote(BaseModel): + id: str + """The id of the Credit note""" + + +class CustomerBalanceTransactionInvoice(BaseModel): + id: str + """The Invoice id""" + + +class CustomerBalanceTransaction(BaseModel): + id: str + """A unique id for this transaction.""" + + action: Literal[ + "applied_to_invoice", + "manual_adjustment", + "prorated_refund", + "revert_prorated_refund", + "return_from_voiding", + "credit_note_applied", + "credit_note_voided", + "overpayment_refund", + "external_payment", + ] + + amount: str + """The value of the amount changed in the transaction.""" + + created_at: datetime + """The creation time of this transaction.""" + + credit_note: Optional[CustomerBalanceTransactionCreditNote] = None + + description: Optional[str] = None + """An optional description provided for manual customer balance adjustments.""" + + ending_balance: str + """ + The new value of the customer's balance prior to the transaction, in the + customer's currency. + """ + + invoice: Optional[CustomerBalanceTransactionInvoice] = None + + starting_balance: str + """ + The original value of the customer's balance prior to the transaction, in the + customer's currency. + """ + + type: Literal["increment", "decrement"] + + +class CustomerTaxID(BaseModel): + country: Literal[ + "AD", + "AE", + "AR", + "AT", + "AU", + "BE", + "BG", + "BH", + "BO", + "BR", + "CA", + "CH", + "CL", + "CN", + "CO", + "CR", + "CY", + "CZ", + "DE", + "DK", + "EE", + "DO", + "EC", + "EG", + "ES", + "EU", + "FI", + "FR", + "GB", + "GE", + "GR", + "HK", + "HR", + "HU", + "ID", + "IE", + "IL", + "IN", + "IS", + "IT", + "JP", + "KE", + "KR", + "KZ", + "LI", + "LT", + "LU", + "LV", + "MT", + "MX", + "MY", + "NG", + "NL", + "NO", + "NZ", + "OM", + "PE", + "PH", + "PL", + "PT", + "RO", + "RS", + "RU", + "SA", + "SE", + "SG", + "SI", + "SK", + "SV", + "TH", + "TR", + "TW", + "UA", + "US", + "UY", + "VE", + "VN", + "ZA", + ] + + type: Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "eu_vat", + "au_abn", + "au_arn", + "bg_uic", + "bh_vat", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "kz_bin", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + + value: str + + +class LineItemAdjustmentMonetaryUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + amount: str + """The value applied by an adjustment.""" + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + 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 LineItemAdjustmentMonetaryAmountDiscountAdjustment(BaseModel): + id: str + + 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.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class LineItemAdjustmentMonetaryPercentageDiscountAdjustment(BaseModel): + id: str + + 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.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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. + """ + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +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.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + adjustment applies to. + """ + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +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.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + adjustment applies to. + """ + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +LineItemAdjustment: TypeAlias = Annotated[ + Union[ + LineItemAdjustmentMonetaryUsageDiscountAdjustment, + LineItemAdjustmentMonetaryAmountDiscountAdjustment, + LineItemAdjustmentMonetaryPercentageDiscountAdjustment, + LineItemAdjustmentMonetaryMinimumAdjustment, + LineItemAdjustmentMonetaryMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class LineItemMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class LineItemMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class LineItemSubLineItemMatrixSubLineItemGrouping(BaseModel): + key: str + + value: Optional[str] = None + """No value indicates the default group""" + + +class LineItemSubLineItemMatrixSubLineItemMatrixConfig(BaseModel): + dimension_values: List[Optional[str]] + """The ordered dimension values for this line item.""" + + +class LineItemSubLineItemMatrixSubLineItem(BaseModel): + amount: str + """The total amount for this sub line item.""" + + grouping: Optional[LineItemSubLineItemMatrixSubLineItemGrouping] = None + + matrix_config: LineItemSubLineItemMatrixSubLineItemMatrixConfig + + name: str + + quantity: float + + type: Literal["matrix"] + + +class LineItemSubLineItemTierSubLineItemGrouping(BaseModel): + key: str + + value: Optional[str] = None + """No value indicates the default group""" + + +class LineItemSubLineItemTierSubLineItemTierConfig(BaseModel): + first_unit: float + + last_unit: Optional[float] = None + + unit_amount: str + + +class LineItemSubLineItemTierSubLineItem(BaseModel): + amount: str + """The total amount for this sub line item.""" + + grouping: Optional[LineItemSubLineItemTierSubLineItemGrouping] = None + + name: str + + quantity: float + + tier_config: LineItemSubLineItemTierSubLineItemTierConfig + + type: Literal["tier"] + + +class LineItemSubLineItemOtherSubLineItemGrouping(BaseModel): + key: str + + value: Optional[str] = None + """No value indicates the default group""" + + +class LineItemSubLineItemOtherSubLineItem(BaseModel): + amount: str + """The total amount for this sub line item.""" + + grouping: Optional[LineItemSubLineItemOtherSubLineItemGrouping] = None + + name: str + + quantity: float + + type: Literal["'null'"] + + +LineItemSubLineItem: TypeAlias = Annotated[ + Union[ + LineItemSubLineItemMatrixSubLineItem, LineItemSubLineItemTierSubLineItem, LineItemSubLineItemOtherSubLineItem + ], + PropertyInfo(discriminator="type"), +] + + +class LineItemTaxAmount(BaseModel): + amount: str + """The amount of additional tax incurred by this tax rate.""" + + tax_rate_description: str + """The human-readable description of the applied tax rate.""" + + tax_rate_percentage: Optional[str] = None + """The tax rate percentage, out of 100.""" + + +class LineItem(BaseModel): + id: str + """A unique ID for this line item.""" + + adjusted_subtotal: str + """ + The line amount after any adjustments and before overage conversion, credits and + partial invoicing. + """ + + adjustments: List[LineItemAdjustment] + """All adjustments (ie. maximums, minimums, discounts) applied to the line item.""" + + amount: str + """ + The final amount for a line item after all adjustments and pre paid credits have + been applied. + """ + + credits_applied: str + """The number of prepaid credits applied.""" + + discount: Optional[Discount] = None + + end_date: datetime + """The end date of the range of time applied for this line item's price.""" + + filter: Optional[str] = None + """An additional filter that was used to calculate the usage for this line item.""" + + grouping: Optional[str] = None + """ + [DEPRECATED] For configured prices that are split by a grouping key, this will + be populated with the key and a value. The `amount` and `subtotal` will be the + values for this particular grouping. + """ + + maximum: Optional[LineItemMaximum] = None + """This field is deprecated in favor of `adjustments`.""" + + maximum_amount: Optional[str] = None + """This field is deprecated in favor of `adjustments`.""" + + minimum: Optional[LineItemMinimum] = None + """This field is deprecated in favor of `adjustments`.""" + + minimum_amount: Optional[str] = None + """This field is deprecated in favor of `adjustments`.""" + + name: str + """The name of the price associated with this line item.""" + + partially_invoiced_amount: str + """Any amount applied from a partial invoice""" + + price: Optional[Price] = None + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + 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.""" + + sub_line_items: List[LineItemSubLineItem] + """ + For complex pricing structures, the line item can be broken down further in + `sub_line_items`. + """ + + subtotal: str + """The line amount before before any adjustments.""" + + tax_amounts: List[LineItemTaxAmount] + """An array of tax rates and their incurred tax amounts. + + Empty if no tax integration is configured. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer ids that were used to calculate the usage for this line item. + """ + + +class Maximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class Minimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class PaymentAttempt(BaseModel): + id: str + """The ID of the payment attempt.""" + + amount: str + """The amount of the payment attempt.""" + + created_at: datetime + """The time at which the payment attempt was created.""" + + payment_provider: Optional[Literal["stripe"]] = None + """The payment provider that attempted to collect the payment.""" + + payment_provider_id: Optional[str] = None + """The ID of the payment attempt in the payment provider.""" + + succeeded: bool + """Whether the payment attempt succeeded.""" + + +class ShippingAddress(BaseModel): + city: Optional[str] = None + + country: Optional[str] = None + + line1: Optional[str] = None + + line2: Optional[str] = None + + postal_code: Optional[str] = None + + state: Optional[str] = None + + +class Subscription(BaseModel): + id: str class InvoiceFetchUpcomingResponse(BaseModel): @@ -30,24 +759,24 @@ class InvoiceFetchUpcomingResponse(BaseModel): application of the customer balance to the `total` of the invoice. """ - auto_collection: AutoCollectionModel + auto_collection: AutoCollection - billing_address: Optional[AddressModel] = None + billing_address: Optional[BillingAddress] = None created_at: datetime """The creation time of the resource in Orb.""" - credit_notes: List[CreditNoteSummaryModel] + credit_notes: List[CreditNote] """A list of credit notes associated with the invoice""" currency: str """An ISO 4217 currency string or `credits`""" - customer: CustomerMinifiedModel + customer: Customer - customer_balance_transactions: List[CustomerBalanceTransactionModel] + customer_balance_transactions: List[CustomerBalanceTransaction] - customer_tax_id: Optional[CustomerTaxIDModel] = None + customer_tax_id: Optional[CustomerTaxID] = None """ Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. @@ -209,10 +938,10 @@ class InvoiceFetchUpcomingResponse(BaseModel): `issued` (even if it is now in a different state.) """ - line_items: List[InvoiceLineItemModel] + line_items: List[LineItem] """The breakdown of prices in this invoice.""" - maximum: Optional[MaximumModel] = None + maximum: Optional[Maximum] = None maximum_amount: Optional[str] = None @@ -229,7 +958,7 @@ class InvoiceFetchUpcomingResponse(BaseModel): cleared by setting `metadata` to `null`. """ - minimum: Optional[MinimumModel] = None + minimum: Optional[Minimum] = None minimum_amount: Optional[str] = None @@ -239,7 +968,7 @@ class InvoiceFetchUpcomingResponse(BaseModel): was paid. """ - payment_attempts: List[PaymentAttemptModel] + payment_attempts: List[PaymentAttempt] """A list of payment attempts associated with the invoice""" payment_failed_at: Optional[datetime] = None @@ -261,11 +990,11 @@ class InvoiceFetchUpcomingResponse(BaseModel): scheduled to be issued. """ - shipping_address: Optional[AddressModel] = None + shipping_address: Optional[ShippingAddress] = None status: Literal["issued", "paid", "synced", "void", "draft"] - subscription: Optional[SubscriptionMinifiedModel] = None + subscription: Optional[Subscription] = None subtotal: str """The total before any discounts and minimums are applied.""" diff --git a/src/orb/types/shared/invoice_line_item_model.py b/src/orb/types/invoice_line_item_create_response.py similarity index 80% rename from src/orb/types/shared/invoice_line_item_model.py rename to src/orb/types/invoice_line_item_create_response.py index 10af6ef7..b046e206 100644 --- a/src/orb/types/shared/invoice_line_item_model.py +++ b/src/orb/types/invoice_line_item_create_response.py @@ -4,29 +4,31 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias -from ..._utils import PropertyInfo -from .discount import Discount -from ..._models import BaseModel -from .price_model import PriceModel -from .maximum_model import MaximumModel -from .minimum_model import MinimumModel -from .tax_amount_model import TaxAmountModel -from .sub_line_item_grouping_model import SubLineItemGroupingModel +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .shared.discount import Discount __all__ = [ - "InvoiceLineItemModel", + "InvoiceLineItemCreateResponse", "Adjustment", "AdjustmentMonetaryUsageDiscountAdjustment", "AdjustmentMonetaryAmountDiscountAdjustment", "AdjustmentMonetaryPercentageDiscountAdjustment", "AdjustmentMonetaryMinimumAdjustment", "AdjustmentMonetaryMaximumAdjustment", + "Maximum", + "Minimum", "SubLineItem", "SubLineItemMatrixSubLineItem", + "SubLineItemMatrixSubLineItemGrouping", "SubLineItemMatrixSubLineItemMatrixConfig", "SubLineItemTierSubLineItem", + "SubLineItemTierSubLineItemGrouping", "SubLineItemTierSubLineItemTierConfig", "SubLineItemOtherSubLineItem", + "SubLineItemOtherSubLineItemGrouping", + "TaxAmount", ] @@ -180,6 +182,35 @@ class AdjustmentMonetaryMaximumAdjustment(BaseModel): ] +class Maximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class Minimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class SubLineItemMatrixSubLineItemGrouping(BaseModel): + key: str + + value: Optional[str] = None + """No value indicates the default group""" + + class SubLineItemMatrixSubLineItemMatrixConfig(BaseModel): dimension_values: List[Optional[str]] """The ordered dimension values for this line item.""" @@ -189,7 +220,7 @@ class SubLineItemMatrixSubLineItem(BaseModel): amount: str """The total amount for this sub line item.""" - grouping: Optional[SubLineItemGroupingModel] = None + grouping: Optional[SubLineItemMatrixSubLineItemGrouping] = None matrix_config: SubLineItemMatrixSubLineItemMatrixConfig @@ -200,6 +231,13 @@ class SubLineItemMatrixSubLineItem(BaseModel): type: Literal["matrix"] +class SubLineItemTierSubLineItemGrouping(BaseModel): + key: str + + value: Optional[str] = None + """No value indicates the default group""" + + class SubLineItemTierSubLineItemTierConfig(BaseModel): first_unit: float @@ -212,7 +250,7 @@ class SubLineItemTierSubLineItem(BaseModel): amount: str """The total amount for this sub line item.""" - grouping: Optional[SubLineItemGroupingModel] = None + grouping: Optional[SubLineItemTierSubLineItemGrouping] = None name: str @@ -223,11 +261,18 @@ class SubLineItemTierSubLineItem(BaseModel): type: Literal["tier"] +class SubLineItemOtherSubLineItemGrouping(BaseModel): + key: str + + value: Optional[str] = None + """No value indicates the default group""" + + class SubLineItemOtherSubLineItem(BaseModel): amount: str """The total amount for this sub line item.""" - grouping: Optional[SubLineItemGroupingModel] = None + grouping: Optional[SubLineItemOtherSubLineItemGrouping] = None name: str @@ -242,7 +287,18 @@ class SubLineItemOtherSubLineItem(BaseModel): ] -class InvoiceLineItemModel(BaseModel): +class TaxAmount(BaseModel): + amount: str + """The amount of additional tax incurred by this tax rate.""" + + tax_rate_description: str + """The human-readable description of the applied tax rate.""" + + tax_rate_percentage: Optional[str] = None + """The tax rate percentage, out of 100.""" + + +class InvoiceLineItemCreateResponse(BaseModel): id: str """A unique ID for this line item.""" @@ -279,13 +335,13 @@ class InvoiceLineItemModel(BaseModel): values for this particular grouping. """ - maximum: Optional[MaximumModel] = None + maximum: Optional[Maximum] = None """This field is deprecated in favor of `adjustments`.""" maximum_amount: Optional[str] = None """This field is deprecated in favor of `adjustments`.""" - minimum: Optional[MinimumModel] = None + minimum: Optional[Minimum] = None """This field is deprecated in favor of `adjustments`.""" minimum_amount: Optional[str] = None @@ -297,7 +353,7 @@ class InvoiceLineItemModel(BaseModel): partially_invoiced_amount: str """Any amount applied from a partial invoice""" - price: Optional[PriceModel] = None + price: Optional[Price] = None """ The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in the form of an invoice line item. Prices @@ -326,7 +382,7 @@ class InvoiceLineItemModel(BaseModel): subtotal: str """The line amount before before any adjustments.""" - tax_amounts: List[TaxAmountModel] + tax_amounts: List[TaxAmount] """An array of tax rates and their incurred tax amounts. Empty if no tax integration is configured. diff --git a/src/orb/types/item.py b/src/orb/types/item.py new file mode 100644 index 00000000..ad22a1dd --- /dev/null +++ b/src/orb/types/item.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["Item", "ExternalConnection"] + + +class ExternalConnection(BaseModel): + external_connection_name: Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok"] + + external_entity_id: str + + +class Item(BaseModel): + id: str + + created_at: datetime + + external_connections: List[ExternalConnection] + + name: str diff --git a/src/orb/types/item_update_params.py b/src/orb/types/item_update_params.py index 83156dcf..a94f7c59 100644 --- a/src/orb/types/item_update_params.py +++ b/src/orb/types/item_update_params.py @@ -3,14 +3,20 @@ from __future__ import annotations from typing import Iterable, Optional -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, TypedDict -from .shared_params.item_external_connection_model import ItemExternalConnectionModel - -__all__ = ["ItemUpdateParams"] +__all__ = ["ItemUpdateParams", "ExternalConnection"] class ItemUpdateParams(TypedDict, total=False): - external_connections: Optional[Iterable[ItemExternalConnectionModel]] + external_connections: Optional[Iterable[ExternalConnection]] name: Optional[str] + + +class ExternalConnection(TypedDict, total=False): + external_connection_name: Required[ + Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok"] + ] + + external_entity_id: Required[str] diff --git a/src/orb/types/plan.py b/src/orb/types/plan.py new file mode 100644 index 00000000..a4b43d96 --- /dev/null +++ b/src/orb/types/plan.py @@ -0,0 +1,370 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .shared.discount import Discount + +__all__ = [ + "Plan", + "Adjustment", + "AdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentPlanPhaseMaximumAdjustment", + "BasePlan", + "Maximum", + "Minimum", + "PlanPhase", + "PlanPhaseMaximum", + "PlanPhaseMinimum", + "Product", + "TrialConfig", +] + + +class AdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentPlanPhaseAmountDiscountAdjustment(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. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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.""" + + +class AdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentPlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + 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 AdjustmentPlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + 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[ + AdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentPlanPhaseMinimumAdjustment, + AdjustmentPlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class BasePlan(BaseModel): + id: Optional[str] = None + + external_plan_id: Optional[str] = None + """ + An optional user-defined ID for this plan resource, used throughout the system + as an alias for this Plan. Use this field to identify a plan by an existing + identifier in your system. + """ + + name: Optional[str] = None + + +class Maximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class Minimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class PlanPhaseMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class PlanPhaseMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class PlanPhase(BaseModel): + id: str + + description: Optional[str] = None + + discount: Optional[Discount] = None + + duration: Optional[int] = None + """How many terms of length `duration_unit` this phase is active for. + + If null, this phase is evergreen and active indefinitely + """ + + duration_unit: Optional[Literal["daily", "monthly", "quarterly", "semi_annual", "annual"]] = None + + maximum: Optional[PlanPhaseMaximum] = None + + maximum_amount: Optional[str] = None + + minimum: Optional[PlanPhaseMinimum] = None + + minimum_amount: Optional[str] = None + + name: str + + order: int + """Determines the ordering of the phase in a plan's lifecycle. 1 = first phase.""" + + +class Product(BaseModel): + id: str + + created_at: datetime + + name: str + + +class TrialConfig(BaseModel): + trial_period: Optional[int] = None + + trial_period_unit: Literal["days"] + + +class Plan(BaseModel): + id: str + + adjustments: List[Adjustment] + """Adjustments for this plan. + + If the plan has phases, this includes adjustments across all phases of the plan. + """ + + base_plan: Optional[BasePlan] = None + + base_plan_id: Optional[str] = None + """ + The parent plan id if the given plan was created by overriding one or more of + the parent's prices + """ + + created_at: datetime + + currency: str + """ + An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's + prices. + """ + + default_invoice_memo: Optional[str] = None + """ + The default memo text on the invoices corresponding to subscriptions on this + plan. Note that each subscription may configure its own memo. + """ + + description: str + + discount: Optional[Discount] = None + + external_plan_id: Optional[str] = None + """ + An optional user-defined ID for this plan resource, used throughout the system + as an alias for this Plan. Use this field to identify a plan by an existing + identifier in your system. + """ + + invoicing_currency: str + """An ISO 4217 currency string for which this plan is billed in. + + Matches `currency` unless `currency` is a custom pricing unit. + """ + + maximum: Optional[Maximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[Minimum] = None + + minimum_amount: Optional[str] = None + + name: str + + net_terms: Optional[int] = None + """Determines the difference between the invoice issue date and the due date. + + A value of "0" here signifies that invoices are due on issue, whereas a value of + "30" means that the customer has a month to pay the invoice before its overdue. + Note that individual subscriptions or invoices may set a different net terms + configuration. + """ + + plan_phases: Optional[List[PlanPhase]] = None + + prices: List[Price] + """Prices for this plan. + + If the plan has phases, this includes prices across all phases of the plan. + """ + + product: Product + + status: Literal["active", "archived", "draft"] + + trial_config: TrialConfig + + version: int diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index 6c133e4a..817ea7f3 100644 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -2,48 +2,100 @@ from __future__ import annotations -from typing import Dict, Union, Iterable, Optional +from typing import Dict, List, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .shared_params.bps_config_model import BpsConfigModel -from .shared_params.bulk_config_model import BulkConfigModel -from .shared_params.unit_config_model import UnitConfigModel -from .shared_params.matrix_config_model import MatrixConfigModel -from .shared_params.tiered_config_model import TieredConfigModel -from .shared_params.package_config_model import PackageConfigModel -from .shared_params.bulk_bps_config_model import BulkBpsConfigModel -from .shared_params.tiered_bps_config_model import TieredBpsConfigModel -from .shared_params.custom_rating_function_config_model import CustomRatingFunctionConfigModel -from .shared_params.new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel - __all__ = [ "PlanCreateParams", "Price", "PriceNewPlanUnitPrice", + "PriceNewPlanUnitPriceUnitConfig", + "PriceNewPlanUnitPriceBillingCycleConfiguration", + "PriceNewPlanUnitPriceInvoicingCycleConfiguration", "PriceNewPlanPackagePrice", + "PriceNewPlanPackagePricePackageConfig", + "PriceNewPlanPackagePriceBillingCycleConfiguration", + "PriceNewPlanPackagePriceInvoicingCycleConfiguration", "PriceNewPlanMatrixPrice", + "PriceNewPlanMatrixPriceMatrixConfig", + "PriceNewPlanMatrixPriceMatrixConfigMatrixValue", + "PriceNewPlanMatrixPriceBillingCycleConfiguration", + "PriceNewPlanMatrixPriceInvoicingCycleConfiguration", "PriceNewPlanTieredPrice", + "PriceNewPlanTieredPriceTieredConfig", + "PriceNewPlanTieredPriceTieredConfigTier", + "PriceNewPlanTieredPriceBillingCycleConfiguration", + "PriceNewPlanTieredPriceInvoicingCycleConfiguration", "PriceNewPlanTieredBpsPrice", + "PriceNewPlanTieredBpsPriceTieredBpsConfig", + "PriceNewPlanTieredBpsPriceTieredBpsConfigTier", + "PriceNewPlanTieredBpsPriceBillingCycleConfiguration", + "PriceNewPlanTieredBpsPriceInvoicingCycleConfiguration", "PriceNewPlanBpsPrice", + "PriceNewPlanBpsPriceBpsConfig", + "PriceNewPlanBpsPriceBillingCycleConfiguration", + "PriceNewPlanBpsPriceInvoicingCycleConfiguration", "PriceNewPlanBulkBpsPrice", + "PriceNewPlanBulkBpsPriceBulkBpsConfig", + "PriceNewPlanBulkBpsPriceBulkBpsConfigTier", + "PriceNewPlanBulkBpsPriceBillingCycleConfiguration", + "PriceNewPlanBulkBpsPriceInvoicingCycleConfiguration", "PriceNewPlanBulkPrice", + "PriceNewPlanBulkPriceBulkConfig", + "PriceNewPlanBulkPriceBulkConfigTier", + "PriceNewPlanBulkPriceBillingCycleConfiguration", + "PriceNewPlanBulkPriceInvoicingCycleConfiguration", "PriceNewPlanThresholdTotalAmountPrice", + "PriceNewPlanThresholdTotalAmountPriceBillingCycleConfiguration", + "PriceNewPlanThresholdTotalAmountPriceInvoicingCycleConfiguration", "PriceNewPlanTieredPackagePrice", + "PriceNewPlanTieredPackagePriceBillingCycleConfiguration", + "PriceNewPlanTieredPackagePriceInvoicingCycleConfiguration", "PriceNewPlanTieredWithMinimumPrice", + "PriceNewPlanTieredWithMinimumPriceBillingCycleConfiguration", + "PriceNewPlanTieredWithMinimumPriceInvoicingCycleConfiguration", "PriceNewPlanUnitWithPercentPrice", + "PriceNewPlanUnitWithPercentPriceBillingCycleConfiguration", + "PriceNewPlanUnitWithPercentPriceInvoicingCycleConfiguration", "PriceNewPlanPackageWithAllocationPrice", + "PriceNewPlanPackageWithAllocationPriceBillingCycleConfiguration", + "PriceNewPlanPackageWithAllocationPriceInvoicingCycleConfiguration", "PriceNewPlanTierWithProrationPrice", + "PriceNewPlanTierWithProrationPriceBillingCycleConfiguration", + "PriceNewPlanTierWithProrationPriceInvoicingCycleConfiguration", "PriceNewPlanUnitWithProrationPrice", + "PriceNewPlanUnitWithProrationPriceBillingCycleConfiguration", + "PriceNewPlanUnitWithProrationPriceInvoicingCycleConfiguration", "PriceNewPlanGroupedAllocationPrice", + "PriceNewPlanGroupedAllocationPriceBillingCycleConfiguration", + "PriceNewPlanGroupedAllocationPriceInvoicingCycleConfiguration", "PriceNewPlanGroupedWithProratedMinimumPrice", + "PriceNewPlanGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "PriceNewPlanGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", "PriceNewPlanGroupedWithMeteredMinimumPrice", + "PriceNewPlanGroupedWithMeteredMinimumPriceBillingCycleConfiguration", + "PriceNewPlanGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", "PriceNewPlanMatrixWithDisplayNamePrice", + "PriceNewPlanMatrixWithDisplayNamePriceBillingCycleConfiguration", + "PriceNewPlanMatrixWithDisplayNamePriceInvoicingCycleConfiguration", "PriceNewPlanBulkWithProrationPrice", + "PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration", + "PriceNewPlanBulkWithProrationPriceInvoicingCycleConfiguration", "PriceNewPlanGroupedTieredPackagePrice", + "PriceNewPlanGroupedTieredPackagePriceBillingCycleConfiguration", + "PriceNewPlanGroupedTieredPackagePriceInvoicingCycleConfiguration", "PriceNewPlanMaxGroupTieredPackagePrice", + "PriceNewPlanMaxGroupTieredPackagePriceBillingCycleConfiguration", + "PriceNewPlanMaxGroupTieredPackagePriceInvoicingCycleConfiguration", "PriceNewPlanScalableMatrixWithUnitPricingPrice", + "PriceNewPlanScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "PriceNewPlanScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", "PriceNewPlanScalableMatrixWithTieredPricingPrice", + "PriceNewPlanScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "PriceNewPlanScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", "PriceNewPlanCumulativeGroupedBulkPrice", + "PriceNewPlanCumulativeGroupedBulkPriceBillingCycleConfiguration", + "PriceNewPlanCumulativeGroupedBulkPriceInvoicingCycleConfiguration", ] @@ -90,6 +142,27 @@ class PlanCreateParams(TypedDict, total=False): """ +class PriceNewPlanUnitPriceUnitConfig(TypedDict, total=False): + unit_amount: Required[str] + """Rate per unit of usage""" + + +class PriceNewPlanUnitPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanUnitPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -102,7 +175,7 @@ class PriceNewPlanUnitPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - unit_config: Required[UnitConfigModel] + unit_config: Required[PriceNewPlanUnitPriceUnitConfig] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -116,7 +189,7 @@ class PriceNewPlanUnitPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanUnitPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -143,7 +216,7 @@ class PriceNewPlanUnitPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanUnitPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -157,6 +230,34 @@ class PriceNewPlanUnitPrice(TypedDict, total=False): """ +class PriceNewPlanPackagePricePackageConfig(TypedDict, total=False): + package_amount: Required[str] + """A currency amount to rate usage by""" + + package_size: Required[int] + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + +class PriceNewPlanPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -169,7 +270,7 @@ class PriceNewPlanPackagePrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - package_config: Required[PackageConfigModel] + package_config: Required[PriceNewPlanPackagePricePackageConfig] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -183,7 +284,7 @@ class PriceNewPlanPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanPackagePriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -210,7 +311,7 @@ class PriceNewPlanPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanPackagePriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -224,6 +325,45 @@ class PriceNewPlanPackagePrice(TypedDict, total=False): """ +class PriceNewPlanMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): + dimension_values: Required[List[Optional[str]]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: Required[str] + """Unit price for the specified dimension_values""" + + +class PriceNewPlanMatrixPriceMatrixConfig(TypedDict, total=False): + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[PriceNewPlanMatrixPriceMatrixConfigMatrixValue]] + """Matrix values for specified matrix grouping keys""" + + +class PriceNewPlanMatrixPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanMatrixPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -231,7 +371,7 @@ class PriceNewPlanMatrixPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - matrix_config: Required[MatrixConfigModel] + matrix_config: Required[PriceNewPlanMatrixPriceMatrixConfig] model_type: Required[Literal["matrix"]] @@ -250,7 +390,7 @@ class PriceNewPlanMatrixPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanMatrixPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -277,7 +417,7 @@ class PriceNewPlanMatrixPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanMatrixPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -291,6 +431,38 @@ class PriceNewPlanMatrixPrice(TypedDict, total=False): """ +class PriceNewPlanTieredPriceTieredConfigTier(TypedDict, total=False): + first_unit: Required[float] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + last_unit: Optional[float] + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class PriceNewPlanTieredPriceTieredConfig(TypedDict, total=False): + tiers: Required[Iterable[PriceNewPlanTieredPriceTieredConfigTier]] + """Tiers for rating based on total usage quantities into the specified tier""" + + +class PriceNewPlanTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanTieredPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -303,7 +475,7 @@ class PriceNewPlanTieredPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_config: Required[TieredConfigModel] + tiered_config: Required[PriceNewPlanTieredPriceTieredConfig] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -317,7 +489,7 @@ class PriceNewPlanTieredPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanTieredPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -344,7 +516,7 @@ class PriceNewPlanTieredPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanTieredPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -358,6 +530,44 @@ class PriceNewPlanTieredPrice(TypedDict, total=False): """ +class PriceNewPlanTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Per-event basis point rate""" + + minimum_amount: Required[str] + """Inclusive tier starting value""" + + maximum_amount: Optional[str] + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] + """Per unit maximum to charge""" + + +class PriceNewPlanTieredBpsPriceTieredBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[PriceNewPlanTieredBpsPriceTieredBpsConfigTier]] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + +class PriceNewPlanTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanTieredBpsPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -370,7 +580,7 @@ class PriceNewPlanTieredBpsPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_bps_config: Required[TieredBpsConfigModel] + tiered_bps_config: Required[PriceNewPlanTieredBpsPriceTieredBpsConfig] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -384,7 +594,7 @@ class PriceNewPlanTieredBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanTieredBpsPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -411,7 +621,7 @@ class PriceNewPlanTieredBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanTieredBpsPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -425,8 +635,32 @@ class PriceNewPlanTieredBpsPrice(TypedDict, total=False): """ +class PriceNewPlanBpsPriceBpsConfig(TypedDict, total=False): + bps: Required[float] + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] + """Optional currency amount maximum to cap spend per event""" + + +class PriceNewPlanBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanBpsPrice(TypedDict, total=False): - bps_config: Required[BpsConfigModel] + bps_config: Required[PriceNewPlanBpsPriceBpsConfig] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -451,7 +685,7 @@ class PriceNewPlanBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanBpsPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -478,7 +712,7 @@ class PriceNewPlanBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanBpsPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -492,8 +726,43 @@ class PriceNewPlanBpsPrice(TypedDict, total=False): """ +class PriceNewPlanBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Basis points to rate on""" + + maximum_amount: Optional[str] + """Upper bound for tier""" + + per_unit_maximum: Optional[str] + """The maximum amount to charge for any one event""" + + +class PriceNewPlanBulkBpsPriceBulkBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[PriceNewPlanBulkBpsPriceBulkBpsConfigTier]] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ + + +class PriceNewPlanBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[BulkBpsConfigModel] + bulk_bps_config: Required[PriceNewPlanBulkBpsPriceBulkBpsConfig] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -518,7 +787,7 @@ class PriceNewPlanBulkBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanBulkBpsPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -545,7 +814,7 @@ class PriceNewPlanBulkBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanBulkBpsPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -559,8 +828,37 @@ class PriceNewPlanBulkBpsPrice(TypedDict, total=False): """ +class PriceNewPlanBulkPriceBulkConfigTier(TypedDict, total=False): + unit_amount: Required[str] + """Amount per unit""" + + maximum_units: Optional[float] + """Upper bound for this tier""" + + +class PriceNewPlanBulkPriceBulkConfig(TypedDict, total=False): + tiers: Required[Iterable[PriceNewPlanBulkPriceBulkConfigTier]] + """Bulk tiers for rating based on total usage volume""" + + +class PriceNewPlanBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanBulkPrice(TypedDict, total=False): - bulk_config: Required[BulkConfigModel] + bulk_config: Required[PriceNewPlanBulkPriceBulkConfig] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -585,7 +883,7 @@ class PriceNewPlanBulkPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanBulkPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -612,7 +910,7 @@ class PriceNewPlanBulkPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanBulkPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -626,6 +924,22 @@ class PriceNewPlanBulkPrice(TypedDict, total=False): """ +class PriceNewPlanThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -638,7 +952,7 @@ class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - threshold_total_amount_config: Required[CustomRatingFunctionConfigModel] + threshold_total_amount_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -652,7 +966,7 @@ class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanThresholdTotalAmountPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -679,7 +993,7 @@ class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanThresholdTotalAmountPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -693,6 +1007,22 @@ class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): """ +class PriceNewPlanTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -705,7 +1035,7 @@ class PriceNewPlanTieredPackagePrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_package_config: Required[CustomRatingFunctionConfigModel] + tiered_package_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -719,7 +1049,7 @@ class PriceNewPlanTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanTieredPackagePriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -746,7 +1076,7 @@ class PriceNewPlanTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanTieredPackagePriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -760,6 +1090,22 @@ class PriceNewPlanTieredPackagePrice(TypedDict, total=False): """ +class PriceNewPlanTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -772,7 +1118,7 @@ class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_with_minimum_config: Required[CustomRatingFunctionConfigModel] + tiered_with_minimum_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -786,7 +1132,7 @@ class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanTieredWithMinimumPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -813,7 +1159,7 @@ class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanTieredWithMinimumPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -827,6 +1173,22 @@ class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): """ +class PriceNewPlanUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -839,7 +1201,7 @@ class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - unit_with_percent_config: Required[CustomRatingFunctionConfigModel] + unit_with_percent_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -853,7 +1215,7 @@ class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanUnitWithPercentPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -880,7 +1242,7 @@ class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanUnitWithPercentPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -894,6 +1256,22 @@ class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): """ +class PriceNewPlanPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -906,7 +1284,7 @@ class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - package_with_allocation_config: Required[CustomRatingFunctionConfigModel] + package_with_allocation_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -920,7 +1298,7 @@ class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanPackageWithAllocationPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -947,7 +1325,7 @@ class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanPackageWithAllocationPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -961,6 +1339,22 @@ class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): """ +class PriceNewPlanTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -973,7 +1367,7 @@ class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_with_proration_config: Required[CustomRatingFunctionConfigModel] + tiered_with_proration_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -987,7 +1381,7 @@ class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanTierWithProrationPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1014,7 +1408,7 @@ class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanTierWithProrationPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1028,6 +1422,22 @@ class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): """ +class PriceNewPlanUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1040,7 +1450,7 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - unit_with_proration_config: Required[CustomRatingFunctionConfigModel] + unit_with_proration_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1054,7 +1464,7 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanUnitWithProrationPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1081,7 +1491,7 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanUnitWithProrationPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1095,11 +1505,27 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): """ +class PriceNewPlanGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - grouped_allocation_config: Required[CustomRatingFunctionConfigModel] + grouped_allocation_config: Required[Dict[str, object]] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1121,7 +1547,7 @@ class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanGroupedAllocationPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1148,7 +1574,7 @@ class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanGroupedAllocationPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1162,11 +1588,27 @@ class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): """ +class PriceNewPlanGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanGroupedWithProratedMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - grouped_with_prorated_minimum_config: Required[CustomRatingFunctionConfigModel] + grouped_with_prorated_minimum_config: Required[Dict[str, object]] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1188,7 +1630,7 @@ class PriceNewPlanGroupedWithProratedMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanGroupedWithProratedMinimumPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1215,7 +1657,7 @@ class PriceNewPlanGroupedWithProratedMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanGroupedWithProratedMinimumPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1229,11 +1671,27 @@ class PriceNewPlanGroupedWithProratedMinimumPrice(TypedDict, total=False): """ +class PriceNewPlanGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanGroupedWithMeteredMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - grouped_with_metered_minimum_config: Required[CustomRatingFunctionConfigModel] + grouped_with_metered_minimum_config: Required[Dict[str, object]] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1255,7 +1713,7 @@ class PriceNewPlanGroupedWithMeteredMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanGroupedWithMeteredMinimumPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1282,7 +1740,7 @@ class PriceNewPlanGroupedWithMeteredMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1296,6 +1754,22 @@ class PriceNewPlanGroupedWithMeteredMinimumPrice(TypedDict, total=False): """ +class PriceNewPlanMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanMatrixWithDisplayNamePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1303,7 +1777,7 @@ class PriceNewPlanMatrixWithDisplayNamePrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - matrix_with_display_name_config: Required[CustomRatingFunctionConfigModel] + matrix_with_display_name_config: Required[Dict[str, object]] model_type: Required[Literal["matrix_with_display_name"]] @@ -1322,7 +1796,7 @@ class PriceNewPlanMatrixWithDisplayNamePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanMatrixWithDisplayNamePriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1349,7 +1823,7 @@ class PriceNewPlanMatrixWithDisplayNamePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanMatrixWithDisplayNamePriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1363,8 +1837,24 @@ class PriceNewPlanMatrixWithDisplayNamePrice(TypedDict, total=False): """ +class PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[CustomRatingFunctionConfigModel] + bulk_with_proration_config: Required[Dict[str, object]] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1389,7 +1879,7 @@ class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1416,7 +1906,7 @@ class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanBulkWithProrationPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1430,11 +1920,27 @@ class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False): """ +class PriceNewPlanGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanGroupedTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - grouped_tiered_package_config: Required[CustomRatingFunctionConfigModel] + grouped_tiered_package_config: Required[Dict[str, object]] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1456,7 +1962,7 @@ class PriceNewPlanGroupedTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanGroupedTieredPackagePriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1483,7 +1989,7 @@ class PriceNewPlanGroupedTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanGroupedTieredPackagePriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1497,6 +2003,22 @@ class PriceNewPlanGroupedTieredPackagePrice(TypedDict, total=False): """ +class PriceNewPlanMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1504,7 +2026,7 @@ class PriceNewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - max_group_tiered_package_config: Required[CustomRatingFunctionConfigModel] + max_group_tiered_package_config: Required[Dict[str, object]] model_type: Required[Literal["max_group_tiered_package"]] @@ -1523,7 +2045,7 @@ class PriceNewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanMaxGroupTieredPackagePriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1550,7 +2072,7 @@ class PriceNewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanMaxGroupTieredPackagePriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1564,6 +2086,22 @@ class PriceNewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): """ +class PriceNewPlanScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanScalableMatrixWithUnitPricingPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1576,7 +2114,7 @@ class PriceNewPlanScalableMatrixWithUnitPricingPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - scalable_matrix_with_unit_pricing_config: Required[CustomRatingFunctionConfigModel] + scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1590,7 +2128,7 @@ class PriceNewPlanScalableMatrixWithUnitPricingPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanScalableMatrixWithUnitPricingPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1617,7 +2155,7 @@ class PriceNewPlanScalableMatrixWithUnitPricingPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1631,6 +2169,22 @@ class PriceNewPlanScalableMatrixWithUnitPricingPrice(TypedDict, total=False): """ +class PriceNewPlanScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanScalableMatrixWithTieredPricingPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1643,7 +2197,7 @@ class PriceNewPlanScalableMatrixWithTieredPricingPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - scalable_matrix_with_tiered_pricing_config: Required[CustomRatingFunctionConfigModel] + scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1657,7 +2211,7 @@ class PriceNewPlanScalableMatrixWithTieredPricingPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanScalableMatrixWithTieredPricingPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1684,7 +2238,7 @@ class PriceNewPlanScalableMatrixWithTieredPricingPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1698,11 +2252,27 @@ class PriceNewPlanScalableMatrixWithTieredPricingPrice(TypedDict, total=False): """ +class PriceNewPlanCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanCumulativeGroupedBulkPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - cumulative_grouped_bulk_config: Required[CustomRatingFunctionConfigModel] + cumulative_grouped_bulk_config: Required[Dict[str, object]] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1724,7 +2294,7 @@ class PriceNewPlanCumulativeGroupedBulkPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[PriceNewPlanCumulativeGroupedBulkPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1751,7 +2321,7 @@ class PriceNewPlanCumulativeGroupedBulkPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[PriceNewPlanCumulativeGroupedBulkPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. diff --git a/src/orb/types/price.py b/src/orb/types/price.py new file mode 100644 index 00000000..f04b2874 --- /dev/null +++ b/src/orb/types/price.py @@ -0,0 +1,3597 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from pydantic import Field as FieldInfo + +from .._utils import PropertyInfo +from .._models import BaseModel +from .shared.discount import Discount + +__all__ = [ + "Price", + "UnitPrice", + "UnitPriceBillableMetric", + "UnitPriceBillingCycleConfiguration", + "UnitPriceCreditAllocation", + "UnitPriceInvoicingCycleConfiguration", + "UnitPriceItem", + "UnitPriceMaximum", + "UnitPriceMinimum", + "UnitPriceUnitConfig", + "UnitPriceDimensionalPriceConfiguration", + "PackagePrice", + "PackagePriceBillableMetric", + "PackagePriceBillingCycleConfiguration", + "PackagePriceCreditAllocation", + "PackagePriceInvoicingCycleConfiguration", + "PackagePriceItem", + "PackagePriceMaximum", + "PackagePriceMinimum", + "PackagePricePackageConfig", + "PackagePriceDimensionalPriceConfiguration", + "MatrixPrice", + "MatrixPriceBillableMetric", + "MatrixPriceBillingCycleConfiguration", + "MatrixPriceCreditAllocation", + "MatrixPriceInvoicingCycleConfiguration", + "MatrixPriceItem", + "MatrixPriceMatrixConfig", + "MatrixPriceMatrixConfigMatrixValue", + "MatrixPriceMaximum", + "MatrixPriceMinimum", + "MatrixPriceDimensionalPriceConfiguration", + "TieredPrice", + "TieredPriceBillableMetric", + "TieredPriceBillingCycleConfiguration", + "TieredPriceCreditAllocation", + "TieredPriceInvoicingCycleConfiguration", + "TieredPriceItem", + "TieredPriceMaximum", + "TieredPriceMinimum", + "TieredPriceTieredConfig", + "TieredPriceTieredConfigTier", + "TieredPriceDimensionalPriceConfiguration", + "TieredBpsPrice", + "TieredBpsPriceBillableMetric", + "TieredBpsPriceBillingCycleConfiguration", + "TieredBpsPriceCreditAllocation", + "TieredBpsPriceInvoicingCycleConfiguration", + "TieredBpsPriceItem", + "TieredBpsPriceMaximum", + "TieredBpsPriceMinimum", + "TieredBpsPriceTieredBpsConfig", + "TieredBpsPriceTieredBpsConfigTier", + "TieredBpsPriceDimensionalPriceConfiguration", + "BpsPrice", + "BpsPriceBillableMetric", + "BpsPriceBillingCycleConfiguration", + "BpsPriceBpsConfig", + "BpsPriceCreditAllocation", + "BpsPriceInvoicingCycleConfiguration", + "BpsPriceItem", + "BpsPriceMaximum", + "BpsPriceMinimum", + "BpsPriceDimensionalPriceConfiguration", + "BulkBpsPrice", + "BulkBpsPriceBillableMetric", + "BulkBpsPriceBillingCycleConfiguration", + "BulkBpsPriceBulkBpsConfig", + "BulkBpsPriceBulkBpsConfigTier", + "BulkBpsPriceCreditAllocation", + "BulkBpsPriceInvoicingCycleConfiguration", + "BulkBpsPriceItem", + "BulkBpsPriceMaximum", + "BulkBpsPriceMinimum", + "BulkBpsPriceDimensionalPriceConfiguration", + "BulkPrice", + "BulkPriceBillableMetric", + "BulkPriceBillingCycleConfiguration", + "BulkPriceBulkConfig", + "BulkPriceBulkConfigTier", + "BulkPriceCreditAllocation", + "BulkPriceInvoicingCycleConfiguration", + "BulkPriceItem", + "BulkPriceMaximum", + "BulkPriceMinimum", + "BulkPriceDimensionalPriceConfiguration", + "ThresholdTotalAmountPrice", + "ThresholdTotalAmountPriceBillableMetric", + "ThresholdTotalAmountPriceBillingCycleConfiguration", + "ThresholdTotalAmountPriceCreditAllocation", + "ThresholdTotalAmountPriceInvoicingCycleConfiguration", + "ThresholdTotalAmountPriceItem", + "ThresholdTotalAmountPriceMaximum", + "ThresholdTotalAmountPriceMinimum", + "ThresholdTotalAmountPriceDimensionalPriceConfiguration", + "TieredPackagePrice", + "TieredPackagePriceBillableMetric", + "TieredPackagePriceBillingCycleConfiguration", + "TieredPackagePriceCreditAllocation", + "TieredPackagePriceInvoicingCycleConfiguration", + "TieredPackagePriceItem", + "TieredPackagePriceMaximum", + "TieredPackagePriceMinimum", + "TieredPackagePriceDimensionalPriceConfiguration", + "GroupedTieredPrice", + "GroupedTieredPriceBillableMetric", + "GroupedTieredPriceBillingCycleConfiguration", + "GroupedTieredPriceCreditAllocation", + "GroupedTieredPriceInvoicingCycleConfiguration", + "GroupedTieredPriceItem", + "GroupedTieredPriceMaximum", + "GroupedTieredPriceMinimum", + "GroupedTieredPriceDimensionalPriceConfiguration", + "TieredWithMinimumPrice", + "TieredWithMinimumPriceBillableMetric", + "TieredWithMinimumPriceBillingCycleConfiguration", + "TieredWithMinimumPriceCreditAllocation", + "TieredWithMinimumPriceInvoicingCycleConfiguration", + "TieredWithMinimumPriceItem", + "TieredWithMinimumPriceMaximum", + "TieredWithMinimumPriceMinimum", + "TieredWithMinimumPriceDimensionalPriceConfiguration", + "TieredPackageWithMinimumPrice", + "TieredPackageWithMinimumPriceBillableMetric", + "TieredPackageWithMinimumPriceBillingCycleConfiguration", + "TieredPackageWithMinimumPriceCreditAllocation", + "TieredPackageWithMinimumPriceInvoicingCycleConfiguration", + "TieredPackageWithMinimumPriceItem", + "TieredPackageWithMinimumPriceMaximum", + "TieredPackageWithMinimumPriceMinimum", + "TieredPackageWithMinimumPriceDimensionalPriceConfiguration", + "PackageWithAllocationPrice", + "PackageWithAllocationPriceBillableMetric", + "PackageWithAllocationPriceBillingCycleConfiguration", + "PackageWithAllocationPriceCreditAllocation", + "PackageWithAllocationPriceInvoicingCycleConfiguration", + "PackageWithAllocationPriceItem", + "PackageWithAllocationPriceMaximum", + "PackageWithAllocationPriceMinimum", + "PackageWithAllocationPriceDimensionalPriceConfiguration", + "UnitWithPercentPrice", + "UnitWithPercentPriceBillableMetric", + "UnitWithPercentPriceBillingCycleConfiguration", + "UnitWithPercentPriceCreditAllocation", + "UnitWithPercentPriceInvoicingCycleConfiguration", + "UnitWithPercentPriceItem", + "UnitWithPercentPriceMaximum", + "UnitWithPercentPriceMinimum", + "UnitWithPercentPriceDimensionalPriceConfiguration", + "MatrixWithAllocationPrice", + "MatrixWithAllocationPriceBillableMetric", + "MatrixWithAllocationPriceBillingCycleConfiguration", + "MatrixWithAllocationPriceCreditAllocation", + "MatrixWithAllocationPriceInvoicingCycleConfiguration", + "MatrixWithAllocationPriceItem", + "MatrixWithAllocationPriceMatrixWithAllocationConfig", + "MatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue", + "MatrixWithAllocationPriceMaximum", + "MatrixWithAllocationPriceMinimum", + "MatrixWithAllocationPriceDimensionalPriceConfiguration", + "TieredWithProrationPrice", + "TieredWithProrationPriceBillableMetric", + "TieredWithProrationPriceBillingCycleConfiguration", + "TieredWithProrationPriceCreditAllocation", + "TieredWithProrationPriceInvoicingCycleConfiguration", + "TieredWithProrationPriceItem", + "TieredWithProrationPriceMaximum", + "TieredWithProrationPriceMinimum", + "TieredWithProrationPriceDimensionalPriceConfiguration", + "UnitWithProrationPrice", + "UnitWithProrationPriceBillableMetric", + "UnitWithProrationPriceBillingCycleConfiguration", + "UnitWithProrationPriceCreditAllocation", + "UnitWithProrationPriceInvoicingCycleConfiguration", + "UnitWithProrationPriceItem", + "UnitWithProrationPriceMaximum", + "UnitWithProrationPriceMinimum", + "UnitWithProrationPriceDimensionalPriceConfiguration", + "GroupedAllocationPrice", + "GroupedAllocationPriceBillableMetric", + "GroupedAllocationPriceBillingCycleConfiguration", + "GroupedAllocationPriceCreditAllocation", + "GroupedAllocationPriceInvoicingCycleConfiguration", + "GroupedAllocationPriceItem", + "GroupedAllocationPriceMaximum", + "GroupedAllocationPriceMinimum", + "GroupedAllocationPriceDimensionalPriceConfiguration", + "GroupedWithProratedMinimumPrice", + "GroupedWithProratedMinimumPriceBillableMetric", + "GroupedWithProratedMinimumPriceBillingCycleConfiguration", + "GroupedWithProratedMinimumPriceCreditAllocation", + "GroupedWithProratedMinimumPriceInvoicingCycleConfiguration", + "GroupedWithProratedMinimumPriceItem", + "GroupedWithProratedMinimumPriceMaximum", + "GroupedWithProratedMinimumPriceMinimum", + "GroupedWithProratedMinimumPriceDimensionalPriceConfiguration", + "GroupedWithMeteredMinimumPrice", + "GroupedWithMeteredMinimumPriceBillableMetric", + "GroupedWithMeteredMinimumPriceBillingCycleConfiguration", + "GroupedWithMeteredMinimumPriceCreditAllocation", + "GroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", + "GroupedWithMeteredMinimumPriceItem", + "GroupedWithMeteredMinimumPriceMaximum", + "GroupedWithMeteredMinimumPriceMinimum", + "GroupedWithMeteredMinimumPriceDimensionalPriceConfiguration", + "MatrixWithDisplayNamePrice", + "MatrixWithDisplayNamePriceBillableMetric", + "MatrixWithDisplayNamePriceBillingCycleConfiguration", + "MatrixWithDisplayNamePriceCreditAllocation", + "MatrixWithDisplayNamePriceInvoicingCycleConfiguration", + "MatrixWithDisplayNamePriceItem", + "MatrixWithDisplayNamePriceMaximum", + "MatrixWithDisplayNamePriceMinimum", + "MatrixWithDisplayNamePriceDimensionalPriceConfiguration", + "BulkWithProrationPrice", + "BulkWithProrationPriceBillableMetric", + "BulkWithProrationPriceBillingCycleConfiguration", + "BulkWithProrationPriceCreditAllocation", + "BulkWithProrationPriceInvoicingCycleConfiguration", + "BulkWithProrationPriceItem", + "BulkWithProrationPriceMaximum", + "BulkWithProrationPriceMinimum", + "BulkWithProrationPriceDimensionalPriceConfiguration", + "GroupedTieredPackagePrice", + "GroupedTieredPackagePriceBillableMetric", + "GroupedTieredPackagePriceBillingCycleConfiguration", + "GroupedTieredPackagePriceCreditAllocation", + "GroupedTieredPackagePriceInvoicingCycleConfiguration", + "GroupedTieredPackagePriceItem", + "GroupedTieredPackagePriceMaximum", + "GroupedTieredPackagePriceMinimum", + "GroupedTieredPackagePriceDimensionalPriceConfiguration", + "MaxGroupTieredPackagePrice", + "MaxGroupTieredPackagePriceBillableMetric", + "MaxGroupTieredPackagePriceBillingCycleConfiguration", + "MaxGroupTieredPackagePriceCreditAllocation", + "MaxGroupTieredPackagePriceInvoicingCycleConfiguration", + "MaxGroupTieredPackagePriceItem", + "MaxGroupTieredPackagePriceMaximum", + "MaxGroupTieredPackagePriceMinimum", + "MaxGroupTieredPackagePriceDimensionalPriceConfiguration", + "ScalableMatrixWithUnitPricingPrice", + "ScalableMatrixWithUnitPricingPriceBillableMetric", + "ScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "ScalableMatrixWithUnitPricingPriceCreditAllocation", + "ScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "ScalableMatrixWithUnitPricingPriceItem", + "ScalableMatrixWithUnitPricingPriceMaximum", + "ScalableMatrixWithUnitPricingPriceMinimum", + "ScalableMatrixWithUnitPricingPriceDimensionalPriceConfiguration", + "ScalableMatrixWithTieredPricingPrice", + "ScalableMatrixWithTieredPricingPriceBillableMetric", + "ScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "ScalableMatrixWithTieredPricingPriceCreditAllocation", + "ScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", + "ScalableMatrixWithTieredPricingPriceItem", + "ScalableMatrixWithTieredPricingPriceMaximum", + "ScalableMatrixWithTieredPricingPriceMinimum", + "ScalableMatrixWithTieredPricingPriceDimensionalPriceConfiguration", + "CumulativeGroupedBulkPrice", + "CumulativeGroupedBulkPriceBillableMetric", + "CumulativeGroupedBulkPriceBillingCycleConfiguration", + "CumulativeGroupedBulkPriceCreditAllocation", + "CumulativeGroupedBulkPriceInvoicingCycleConfiguration", + "CumulativeGroupedBulkPriceItem", + "CumulativeGroupedBulkPriceMaximum", + "CumulativeGroupedBulkPriceMinimum", + "CumulativeGroupedBulkPriceDimensionalPriceConfiguration", +] + + +class UnitPriceBillableMetric(BaseModel): + id: str + + +class UnitPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class UnitPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class UnitPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class UnitPriceItem(BaseModel): + id: str + + name: str + + +class UnitPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class UnitPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class UnitPriceUnitConfig(BaseModel): + unit_amount: str + """Rate per unit of usage""" + + +class UnitPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class UnitPrice(BaseModel): + id: str + + billable_metric: Optional[UnitPriceBillableMetric] = None + + billing_cycle_configuration: UnitPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[UnitPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[UnitPriceInvoicingCycleConfiguration] = None + + item: UnitPriceItem + + maximum: Optional[UnitPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[UnitPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["unit"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + unit_config: UnitPriceUnitConfig + + dimensional_price_configuration: Optional[UnitPriceDimensionalPriceConfiguration] = None + + +class PackagePriceBillableMetric(BaseModel): + id: str + + +class PackagePriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class PackagePriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class PackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class PackagePriceItem(BaseModel): + id: str + + name: str + + +class PackagePriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class PackagePriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class PackagePricePackageConfig(BaseModel): + package_amount: str + """A currency amount to rate usage by""" + + package_size: int + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + +class PackagePriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class PackagePrice(BaseModel): + id: str + + billable_metric: Optional[PackagePriceBillableMetric] = None + + billing_cycle_configuration: PackagePriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[PackagePriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[PackagePriceInvoicingCycleConfiguration] = None + + item: PackagePriceItem + + maximum: Optional[PackagePriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[PackagePriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["package"] = FieldInfo(alias="model_type") + + name: str + + package_config: PackagePricePackageConfig + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[PackagePriceDimensionalPriceConfiguration] = None + + +class MatrixPriceBillableMetric(BaseModel): + id: str + + +class MatrixPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class MatrixPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class MatrixPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class MatrixPriceItem(BaseModel): + id: str + + name: str + + +class MatrixPriceMatrixConfigMatrixValue(BaseModel): + dimension_values: List[Optional[str]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: str + """Unit price for the specified dimension_values""" + + +class MatrixPriceMatrixConfig(BaseModel): + default_unit_amount: str + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: List[Optional[str]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: List[MatrixPriceMatrixConfigMatrixValue] + """Matrix values for specified matrix grouping keys""" + + +class MatrixPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class MatrixPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class MatrixPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class MatrixPrice(BaseModel): + id: str + + billable_metric: Optional[MatrixPriceBillableMetric] = None + + billing_cycle_configuration: MatrixPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[MatrixPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[MatrixPriceInvoicingCycleConfiguration] = None + + item: MatrixPriceItem + + matrix_config: MatrixPriceMatrixConfig + + maximum: Optional[MatrixPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MatrixPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[MatrixPriceDimensionalPriceConfiguration] = None + + +class TieredPriceBillableMetric(BaseModel): + id: str + + +class TieredPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class TieredPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class TieredPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class TieredPriceItem(BaseModel): + id: str + + name: str + + +class TieredPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class TieredPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class TieredPriceTieredConfigTier(BaseModel): + first_unit: float + """Inclusive tier starting value""" + + unit_amount: str + """Amount per unit""" + + last_unit: Optional[float] = None + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class TieredPriceTieredConfig(BaseModel): + tiers: List[TieredPriceTieredConfigTier] + """Tiers for rating based on total usage quantities into the specified tier""" + + +class TieredPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class TieredPrice(BaseModel): + id: str + + billable_metric: Optional[TieredPriceBillableMetric] = None + + billing_cycle_configuration: TieredPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[TieredPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[TieredPriceInvoicingCycleConfiguration] = None + + item: TieredPriceItem + + maximum: Optional[TieredPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[TieredPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + tiered_config: TieredPriceTieredConfig + + dimensional_price_configuration: Optional[TieredPriceDimensionalPriceConfiguration] = None + + +class TieredBpsPriceBillableMetric(BaseModel): + id: str + + +class TieredBpsPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class TieredBpsPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class TieredBpsPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class TieredBpsPriceItem(BaseModel): + id: str + + name: str + + +class TieredBpsPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class TieredBpsPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class TieredBpsPriceTieredBpsConfigTier(BaseModel): + bps: float + """Per-event basis point rate""" + + minimum_amount: str + """Inclusive tier starting value""" + + maximum_amount: Optional[str] = None + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] = None + """Per unit maximum to charge""" + + +class TieredBpsPriceTieredBpsConfig(BaseModel): + tiers: List[TieredBpsPriceTieredBpsConfigTier] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + +class TieredBpsPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class TieredBpsPrice(BaseModel): + id: str + + billable_metric: Optional[TieredBpsPriceBillableMetric] = None + + billing_cycle_configuration: TieredBpsPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[TieredBpsPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[TieredBpsPriceInvoicingCycleConfiguration] = None + + item: TieredBpsPriceItem + + maximum: Optional[TieredBpsPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[TieredBpsPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + tiered_bps_config: TieredBpsPriceTieredBpsConfig + + dimensional_price_configuration: Optional[TieredBpsPriceDimensionalPriceConfiguration] = None + + +class BpsPriceBillableMetric(BaseModel): + id: str + + +class BpsPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class BpsPriceBpsConfig(BaseModel): + bps: float + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] = None + """Optional currency amount maximum to cap spend per event""" + + +class BpsPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class BpsPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class BpsPriceItem(BaseModel): + id: str + + name: str + + +class BpsPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class BpsPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class BpsPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class BpsPrice(BaseModel): + id: str + + billable_metric: Optional[BpsPriceBillableMetric] = None + + billing_cycle_configuration: BpsPriceBillingCycleConfiguration + + bps_config: BpsPriceBpsConfig + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[BpsPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BpsPriceInvoicingCycleConfiguration] = None + + item: BpsPriceItem + + maximum: Optional[BpsPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[BpsPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["bps"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[BpsPriceDimensionalPriceConfiguration] = None + + +class BulkBpsPriceBillableMetric(BaseModel): + id: str + + +class BulkBpsPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class BulkBpsPriceBulkBpsConfigTier(BaseModel): + bps: float + """Basis points to rate on""" + + maximum_amount: Optional[str] = None + """Upper bound for tier""" + + per_unit_maximum: Optional[str] = None + """The maximum amount to charge for any one event""" + + +class BulkBpsPriceBulkBpsConfig(BaseModel): + tiers: List[BulkBpsPriceBulkBpsConfigTier] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ + + +class BulkBpsPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class BulkBpsPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class BulkBpsPriceItem(BaseModel): + id: str + + name: str + + +class BulkBpsPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class BulkBpsPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class BulkBpsPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class BulkBpsPrice(BaseModel): + id: str + + billable_metric: Optional[BulkBpsPriceBillableMetric] = None + + billing_cycle_configuration: BulkBpsPriceBillingCycleConfiguration + + bulk_bps_config: BulkBpsPriceBulkBpsConfig + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[BulkBpsPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BulkBpsPriceInvoicingCycleConfiguration] = None + + item: BulkBpsPriceItem + + maximum: Optional[BulkBpsPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[BulkBpsPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[BulkBpsPriceDimensionalPriceConfiguration] = None + + +class BulkPriceBillableMetric(BaseModel): + id: str + + +class BulkPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class BulkPriceBulkConfigTier(BaseModel): + unit_amount: str + """Amount per unit""" + + maximum_units: Optional[float] = None + """Upper bound for this tier""" + + +class BulkPriceBulkConfig(BaseModel): + tiers: List[BulkPriceBulkConfigTier] + """Bulk tiers for rating based on total usage volume""" + + +class BulkPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class BulkPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class BulkPriceItem(BaseModel): + id: str + + name: str + + +class BulkPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class BulkPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class BulkPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class BulkPrice(BaseModel): + id: str + + billable_metric: Optional[BulkPriceBillableMetric] = None + + billing_cycle_configuration: BulkPriceBillingCycleConfiguration + + bulk_config: BulkPriceBulkConfig + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[BulkPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BulkPriceInvoicingCycleConfiguration] = None + + item: BulkPriceItem + + maximum: Optional[BulkPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[BulkPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[BulkPriceDimensionalPriceConfiguration] = None + + +class ThresholdTotalAmountPriceBillableMetric(BaseModel): + id: str + + +class ThresholdTotalAmountPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class ThresholdTotalAmountPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class ThresholdTotalAmountPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class ThresholdTotalAmountPriceItem(BaseModel): + id: str + + name: str + + +class ThresholdTotalAmountPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class ThresholdTotalAmountPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class ThresholdTotalAmountPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class ThresholdTotalAmountPrice(BaseModel): + id: str + + billable_metric: Optional[ThresholdTotalAmountPriceBillableMetric] = None + + billing_cycle_configuration: ThresholdTotalAmountPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[ThresholdTotalAmountPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[ThresholdTotalAmountPriceInvoicingCycleConfiguration] = None + + item: ThresholdTotalAmountPriceItem + + maximum: Optional[ThresholdTotalAmountPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[ThresholdTotalAmountPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + threshold_total_amount_config: Dict[str, object] + + dimensional_price_configuration: Optional[ThresholdTotalAmountPriceDimensionalPriceConfiguration] = None + + +class TieredPackagePriceBillableMetric(BaseModel): + id: str + + +class TieredPackagePriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class TieredPackagePriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class TieredPackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class TieredPackagePriceItem(BaseModel): + id: str + + name: str + + +class TieredPackagePriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class TieredPackagePriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class TieredPackagePriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class TieredPackagePrice(BaseModel): + id: str + + billable_metric: Optional[TieredPackagePriceBillableMetric] = None + + billing_cycle_configuration: TieredPackagePriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[TieredPackagePriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[TieredPackagePriceInvoicingCycleConfiguration] = None + + item: TieredPackagePriceItem + + maximum: Optional[TieredPackagePriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[TieredPackagePriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + tiered_package_config: Dict[str, object] + + dimensional_price_configuration: Optional[TieredPackagePriceDimensionalPriceConfiguration] = None + + +class GroupedTieredPriceBillableMetric(BaseModel): + id: str + + +class GroupedTieredPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class GroupedTieredPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class GroupedTieredPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class GroupedTieredPriceItem(BaseModel): + id: str + + name: str + + +class GroupedTieredPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class GroupedTieredPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class GroupedTieredPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class GroupedTieredPrice(BaseModel): + id: str + + billable_metric: Optional[GroupedTieredPriceBillableMetric] = None + + billing_cycle_configuration: GroupedTieredPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[GroupedTieredPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + grouped_tiered_config: Dict[str, object] + + invoicing_cycle_configuration: Optional[GroupedTieredPriceInvoicingCycleConfiguration] = None + + item: GroupedTieredPriceItem + + maximum: Optional[GroupedTieredPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[GroupedTieredPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["grouped_tiered"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[GroupedTieredPriceDimensionalPriceConfiguration] = None + + +class TieredWithMinimumPriceBillableMetric(BaseModel): + id: str + + +class TieredWithMinimumPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class TieredWithMinimumPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class TieredWithMinimumPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class TieredWithMinimumPriceItem(BaseModel): + id: str + + name: str + + +class TieredWithMinimumPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class TieredWithMinimumPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class TieredWithMinimumPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class TieredWithMinimumPrice(BaseModel): + id: str + + billable_metric: Optional[TieredWithMinimumPriceBillableMetric] = None + + billing_cycle_configuration: TieredWithMinimumPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[TieredWithMinimumPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[TieredWithMinimumPriceInvoicingCycleConfiguration] = None + + item: TieredWithMinimumPriceItem + + maximum: Optional[TieredWithMinimumPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[TieredWithMinimumPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + tiered_with_minimum_config: Dict[str, object] + + dimensional_price_configuration: Optional[TieredWithMinimumPriceDimensionalPriceConfiguration] = None + + +class TieredPackageWithMinimumPriceBillableMetric(BaseModel): + id: str + + +class TieredPackageWithMinimumPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class TieredPackageWithMinimumPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class TieredPackageWithMinimumPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class TieredPackageWithMinimumPriceItem(BaseModel): + id: str + + name: str + + +class TieredPackageWithMinimumPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class TieredPackageWithMinimumPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class TieredPackageWithMinimumPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class TieredPackageWithMinimumPrice(BaseModel): + id: str + + billable_metric: Optional[TieredPackageWithMinimumPriceBillableMetric] = None + + billing_cycle_configuration: TieredPackageWithMinimumPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[TieredPackageWithMinimumPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[TieredPackageWithMinimumPriceInvoicingCycleConfiguration] = None + + item: TieredPackageWithMinimumPriceItem + + maximum: Optional[TieredPackageWithMinimumPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[TieredPackageWithMinimumPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["tiered_package_with_minimum"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + tiered_package_with_minimum_config: Dict[str, object] + + dimensional_price_configuration: Optional[TieredPackageWithMinimumPriceDimensionalPriceConfiguration] = None + + +class PackageWithAllocationPriceBillableMetric(BaseModel): + id: str + + +class PackageWithAllocationPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class PackageWithAllocationPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class PackageWithAllocationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class PackageWithAllocationPriceItem(BaseModel): + id: str + + name: str + + +class PackageWithAllocationPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class PackageWithAllocationPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class PackageWithAllocationPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class PackageWithAllocationPrice(BaseModel): + id: str + + billable_metric: Optional[PackageWithAllocationPriceBillableMetric] = None + + billing_cycle_configuration: PackageWithAllocationPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[PackageWithAllocationPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[PackageWithAllocationPriceInvoicingCycleConfiguration] = None + + item: PackageWithAllocationPriceItem + + maximum: Optional[PackageWithAllocationPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[PackageWithAllocationPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") + + name: str + + package_with_allocation_config: Dict[str, object] + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[PackageWithAllocationPriceDimensionalPriceConfiguration] = None + + +class UnitWithPercentPriceBillableMetric(BaseModel): + id: str + + +class UnitWithPercentPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class UnitWithPercentPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class UnitWithPercentPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class UnitWithPercentPriceItem(BaseModel): + id: str + + name: str + + +class UnitWithPercentPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class UnitWithPercentPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class UnitWithPercentPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class UnitWithPercentPrice(BaseModel): + id: str + + billable_metric: Optional[UnitWithPercentPriceBillableMetric] = None + + billing_cycle_configuration: UnitWithPercentPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[UnitWithPercentPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[UnitWithPercentPriceInvoicingCycleConfiguration] = None + + item: UnitWithPercentPriceItem + + maximum: Optional[UnitWithPercentPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[UnitWithPercentPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["unit_with_percent"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + unit_with_percent_config: Dict[str, object] + + dimensional_price_configuration: Optional[UnitWithPercentPriceDimensionalPriceConfiguration] = None + + +class MatrixWithAllocationPriceBillableMetric(BaseModel): + id: str + + +class MatrixWithAllocationPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class MatrixWithAllocationPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class MatrixWithAllocationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class MatrixWithAllocationPriceItem(BaseModel): + id: str + + name: str + + +class MatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue(BaseModel): + dimension_values: List[Optional[str]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: str + """Unit price for the specified dimension_values""" + + +class MatrixWithAllocationPriceMatrixWithAllocationConfig(BaseModel): + allocation: float + """Allocation to be used to calculate the price""" + + default_unit_amount: str + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: List[Optional[str]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: List[MatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue] + """Matrix values for specified matrix grouping keys""" + + +class MatrixWithAllocationPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class MatrixWithAllocationPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class MatrixWithAllocationPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class MatrixWithAllocationPrice(BaseModel): + id: str + + billable_metric: Optional[MatrixWithAllocationPriceBillableMetric] = None + + billing_cycle_configuration: MatrixWithAllocationPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[MatrixWithAllocationPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[MatrixWithAllocationPriceInvoicingCycleConfiguration] = None + + item: MatrixWithAllocationPriceItem + + matrix_with_allocation_config: MatrixWithAllocationPriceMatrixWithAllocationConfig + + maximum: Optional[MatrixWithAllocationPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MatrixWithAllocationPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["matrix_with_allocation"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[MatrixWithAllocationPriceDimensionalPriceConfiguration] = None + + +class TieredWithProrationPriceBillableMetric(BaseModel): + id: str + + +class TieredWithProrationPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class TieredWithProrationPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class TieredWithProrationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class TieredWithProrationPriceItem(BaseModel): + id: str + + name: str + + +class TieredWithProrationPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class TieredWithProrationPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class TieredWithProrationPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class TieredWithProrationPrice(BaseModel): + id: str + + billable_metric: Optional[TieredWithProrationPriceBillableMetric] = None + + billing_cycle_configuration: TieredWithProrationPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[TieredWithProrationPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[TieredWithProrationPriceInvoicingCycleConfiguration] = None + + item: TieredWithProrationPriceItem + + maximum: Optional[TieredWithProrationPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[TieredWithProrationPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["tiered_with_proration"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + tiered_with_proration_config: Dict[str, object] + + dimensional_price_configuration: Optional[TieredWithProrationPriceDimensionalPriceConfiguration] = None + + +class UnitWithProrationPriceBillableMetric(BaseModel): + id: str + + +class UnitWithProrationPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class UnitWithProrationPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class UnitWithProrationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class UnitWithProrationPriceItem(BaseModel): + id: str + + name: str + + +class UnitWithProrationPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class UnitWithProrationPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class UnitWithProrationPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class UnitWithProrationPrice(BaseModel): + id: str + + billable_metric: Optional[UnitWithProrationPriceBillableMetric] = None + + billing_cycle_configuration: UnitWithProrationPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[UnitWithProrationPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[UnitWithProrationPriceInvoicingCycleConfiguration] = None + + item: UnitWithProrationPriceItem + + maximum: Optional[UnitWithProrationPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[UnitWithProrationPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["unit_with_proration"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + unit_with_proration_config: Dict[str, object] + + dimensional_price_configuration: Optional[UnitWithProrationPriceDimensionalPriceConfiguration] = None + + +class GroupedAllocationPriceBillableMetric(BaseModel): + id: str + + +class GroupedAllocationPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class GroupedAllocationPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class GroupedAllocationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class GroupedAllocationPriceItem(BaseModel): + id: str + + name: str + + +class GroupedAllocationPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class GroupedAllocationPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class GroupedAllocationPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class GroupedAllocationPrice(BaseModel): + id: str + + billable_metric: Optional[GroupedAllocationPriceBillableMetric] = None + + billing_cycle_configuration: GroupedAllocationPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[GroupedAllocationPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + grouped_allocation_config: Dict[str, object] + + invoicing_cycle_configuration: Optional[GroupedAllocationPriceInvoicingCycleConfiguration] = None + + item: GroupedAllocationPriceItem + + maximum: Optional[GroupedAllocationPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[GroupedAllocationPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[GroupedAllocationPriceDimensionalPriceConfiguration] = None + + +class GroupedWithProratedMinimumPriceBillableMetric(BaseModel): + id: str + + +class GroupedWithProratedMinimumPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class GroupedWithProratedMinimumPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class GroupedWithProratedMinimumPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class GroupedWithProratedMinimumPriceItem(BaseModel): + id: str + + name: str + + +class GroupedWithProratedMinimumPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class GroupedWithProratedMinimumPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class GroupedWithProratedMinimumPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class GroupedWithProratedMinimumPrice(BaseModel): + id: str + + billable_metric: Optional[GroupedWithProratedMinimumPriceBillableMetric] = None + + billing_cycle_configuration: GroupedWithProratedMinimumPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[GroupedWithProratedMinimumPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + grouped_with_prorated_minimum_config: Dict[str, object] + + invoicing_cycle_configuration: Optional[GroupedWithProratedMinimumPriceInvoicingCycleConfiguration] = None + + item: GroupedWithProratedMinimumPriceItem + + maximum: Optional[GroupedWithProratedMinimumPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[GroupedWithProratedMinimumPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["grouped_with_prorated_minimum"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[GroupedWithProratedMinimumPriceDimensionalPriceConfiguration] = None + + +class GroupedWithMeteredMinimumPriceBillableMetric(BaseModel): + id: str + + +class GroupedWithMeteredMinimumPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class GroupedWithMeteredMinimumPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class GroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class GroupedWithMeteredMinimumPriceItem(BaseModel): + id: str + + name: str + + +class GroupedWithMeteredMinimumPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class GroupedWithMeteredMinimumPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class GroupedWithMeteredMinimumPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class GroupedWithMeteredMinimumPrice(BaseModel): + id: str + + billable_metric: Optional[GroupedWithMeteredMinimumPriceBillableMetric] = None + + billing_cycle_configuration: GroupedWithMeteredMinimumPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[GroupedWithMeteredMinimumPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + grouped_with_metered_minimum_config: Dict[str, object] + + invoicing_cycle_configuration: Optional[GroupedWithMeteredMinimumPriceInvoicingCycleConfiguration] = None + + item: GroupedWithMeteredMinimumPriceItem + + maximum: Optional[GroupedWithMeteredMinimumPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[GroupedWithMeteredMinimumPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["grouped_with_metered_minimum"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[GroupedWithMeteredMinimumPriceDimensionalPriceConfiguration] = None + + +class MatrixWithDisplayNamePriceBillableMetric(BaseModel): + id: str + + +class MatrixWithDisplayNamePriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class MatrixWithDisplayNamePriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class MatrixWithDisplayNamePriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class MatrixWithDisplayNamePriceItem(BaseModel): + id: str + + name: str + + +class MatrixWithDisplayNamePriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class MatrixWithDisplayNamePriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class MatrixWithDisplayNamePriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class MatrixWithDisplayNamePrice(BaseModel): + id: str + + billable_metric: Optional[MatrixWithDisplayNamePriceBillableMetric] = None + + billing_cycle_configuration: MatrixWithDisplayNamePriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[MatrixWithDisplayNamePriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[MatrixWithDisplayNamePriceInvoicingCycleConfiguration] = None + + item: MatrixWithDisplayNamePriceItem + + matrix_with_display_name_config: Dict[str, object] + + maximum: Optional[MatrixWithDisplayNamePriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MatrixWithDisplayNamePriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["matrix_with_display_name"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[MatrixWithDisplayNamePriceDimensionalPriceConfiguration] = None + + +class BulkWithProrationPriceBillableMetric(BaseModel): + id: str + + +class BulkWithProrationPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class BulkWithProrationPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class BulkWithProrationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class BulkWithProrationPriceItem(BaseModel): + id: str + + name: str + + +class BulkWithProrationPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class BulkWithProrationPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class BulkWithProrationPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class BulkWithProrationPrice(BaseModel): + id: str + + billable_metric: Optional[BulkWithProrationPriceBillableMetric] = None + + billing_cycle_configuration: BulkWithProrationPriceBillingCycleConfiguration + + bulk_with_proration_config: Dict[str, object] + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[BulkWithProrationPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BulkWithProrationPriceInvoicingCycleConfiguration] = None + + item: BulkWithProrationPriceItem + + maximum: Optional[BulkWithProrationPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[BulkWithProrationPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["bulk_with_proration"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[BulkWithProrationPriceDimensionalPriceConfiguration] = None + + +class GroupedTieredPackagePriceBillableMetric(BaseModel): + id: str + + +class GroupedTieredPackagePriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class GroupedTieredPackagePriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class GroupedTieredPackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class GroupedTieredPackagePriceItem(BaseModel): + id: str + + name: str + + +class GroupedTieredPackagePriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class GroupedTieredPackagePriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class GroupedTieredPackagePriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class GroupedTieredPackagePrice(BaseModel): + id: str + + billable_metric: Optional[GroupedTieredPackagePriceBillableMetric] = None + + billing_cycle_configuration: GroupedTieredPackagePriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[GroupedTieredPackagePriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + grouped_tiered_package_config: Dict[str, object] + + invoicing_cycle_configuration: Optional[GroupedTieredPackagePriceInvoicingCycleConfiguration] = None + + item: GroupedTieredPackagePriceItem + + maximum: Optional[GroupedTieredPackagePriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[GroupedTieredPackagePriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["grouped_tiered_package"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[GroupedTieredPackagePriceDimensionalPriceConfiguration] = None + + +class MaxGroupTieredPackagePriceBillableMetric(BaseModel): + id: str + + +class MaxGroupTieredPackagePriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class MaxGroupTieredPackagePriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class MaxGroupTieredPackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class MaxGroupTieredPackagePriceItem(BaseModel): + id: str + + name: str + + +class MaxGroupTieredPackagePriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class MaxGroupTieredPackagePriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class MaxGroupTieredPackagePriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class MaxGroupTieredPackagePrice(BaseModel): + id: str + + billable_metric: Optional[MaxGroupTieredPackagePriceBillableMetric] = None + + billing_cycle_configuration: MaxGroupTieredPackagePriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[MaxGroupTieredPackagePriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[MaxGroupTieredPackagePriceInvoicingCycleConfiguration] = None + + item: MaxGroupTieredPackagePriceItem + + max_group_tiered_package_config: Dict[str, object] + + maximum: Optional[MaxGroupTieredPackagePriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MaxGroupTieredPackagePriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["max_group_tiered_package"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[MaxGroupTieredPackagePriceDimensionalPriceConfiguration] = None + + +class ScalableMatrixWithUnitPricingPriceBillableMetric(BaseModel): + id: str + + +class ScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class ScalableMatrixWithUnitPricingPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class ScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class ScalableMatrixWithUnitPricingPriceItem(BaseModel): + id: str + + name: str + + +class ScalableMatrixWithUnitPricingPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class ScalableMatrixWithUnitPricingPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class ScalableMatrixWithUnitPricingPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class ScalableMatrixWithUnitPricingPrice(BaseModel): + id: str + + billable_metric: Optional[ScalableMatrixWithUnitPricingPriceBillableMetric] = None + + billing_cycle_configuration: ScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[ScalableMatrixWithUnitPricingPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[ScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration] = None + + item: ScalableMatrixWithUnitPricingPriceItem + + maximum: Optional[ScalableMatrixWithUnitPricingPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[ScalableMatrixWithUnitPricingPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + scalable_matrix_with_unit_pricing_config: Dict[str, object] + + dimensional_price_configuration: Optional[ScalableMatrixWithUnitPricingPriceDimensionalPriceConfiguration] = None + + +class ScalableMatrixWithTieredPricingPriceBillableMetric(BaseModel): + id: str + + +class ScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class ScalableMatrixWithTieredPricingPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class ScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class ScalableMatrixWithTieredPricingPriceItem(BaseModel): + id: str + + name: str + + +class ScalableMatrixWithTieredPricingPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class ScalableMatrixWithTieredPricingPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class ScalableMatrixWithTieredPricingPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class ScalableMatrixWithTieredPricingPrice(BaseModel): + id: str + + billable_metric: Optional[ScalableMatrixWithTieredPricingPriceBillableMetric] = None + + billing_cycle_configuration: ScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[ScalableMatrixWithTieredPricingPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[ScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration] = None + + item: ScalableMatrixWithTieredPricingPriceItem + + maximum: Optional[ScalableMatrixWithTieredPricingPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[ScalableMatrixWithTieredPricingPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + scalable_matrix_with_tiered_pricing_config: Dict[str, object] + + dimensional_price_configuration: Optional[ScalableMatrixWithTieredPricingPriceDimensionalPriceConfiguration] = None + + +class CumulativeGroupedBulkPriceBillableMetric(BaseModel): + id: str + + +class CumulativeGroupedBulkPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class CumulativeGroupedBulkPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class CumulativeGroupedBulkPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class CumulativeGroupedBulkPriceItem(BaseModel): + id: str + + name: str + + +class CumulativeGroupedBulkPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class CumulativeGroupedBulkPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class CumulativeGroupedBulkPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class CumulativeGroupedBulkPrice(BaseModel): + id: str + + billable_metric: Optional[CumulativeGroupedBulkPriceBillableMetric] = None + + billing_cycle_configuration: CumulativeGroupedBulkPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[CumulativeGroupedBulkPriceCreditAllocation] = None + + cumulative_grouped_bulk_config: Dict[str, object] + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[CumulativeGroupedBulkPriceInvoicingCycleConfiguration] = None + + item: CumulativeGroupedBulkPriceItem + + maximum: Optional[CumulativeGroupedBulkPriceMaximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[CumulativeGroupedBulkPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["cumulative_grouped_bulk"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[CumulativeGroupedBulkPriceDimensionalPriceConfiguration] = None + + +Price: TypeAlias = Annotated[ + Union[ + UnitPrice, + PackagePrice, + MatrixPrice, + TieredPrice, + TieredBpsPrice, + BpsPrice, + BulkBpsPrice, + BulkPrice, + ThresholdTotalAmountPrice, + TieredPackagePrice, + GroupedTieredPrice, + TieredWithMinimumPrice, + TieredPackageWithMinimumPrice, + PackageWithAllocationPrice, + UnitWithPercentPrice, + MatrixWithAllocationPrice, + TieredWithProrationPrice, + UnitWithProrationPrice, + GroupedAllocationPrice, + GroupedWithProratedMinimumPrice, + GroupedWithMeteredMinimumPrice, + MatrixWithDisplayNamePrice, + BulkWithProrationPrice, + GroupedTieredPackagePrice, + MaxGroupTieredPackagePrice, + ScalableMatrixWithUnitPricingPrice, + ScalableMatrixWithTieredPricingPrice, + CumulativeGroupedBulkPrice, + ], + PropertyInfo(discriminator="price_model_type"), +] diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index f4998dfb..3c41a7db 100644 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -2,51 +2,110 @@ from __future__ import annotations -from typing import Dict, Union, Optional +from typing import Dict, List, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .shared_params.bps_config_model import BpsConfigModel -from .shared_params.bulk_config_model import BulkConfigModel -from .shared_params.unit_config_model import UnitConfigModel -from .shared_params.matrix_config_model import MatrixConfigModel -from .shared_params.tiered_config_model import TieredConfigModel -from .shared_params.package_config_model import PackageConfigModel -from .shared_params.bulk_bps_config_model import BulkBpsConfigModel -from .shared_params.tiered_bps_config_model import TieredBpsConfigModel -from .shared_params.custom_rating_function_config_model import CustomRatingFunctionConfigModel -from .shared_params.matrix_with_allocation_config_model import MatrixWithAllocationConfigModel -from .shared_params.new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel - __all__ = [ "PriceCreateParams", "NewFloatingUnitPrice", + "NewFloatingUnitPriceUnitConfig", + "NewFloatingUnitPriceBillingCycleConfiguration", + "NewFloatingUnitPriceInvoicingCycleConfiguration", "NewFloatingPackagePrice", + "NewFloatingPackagePricePackageConfig", + "NewFloatingPackagePriceBillingCycleConfiguration", + "NewFloatingPackagePriceInvoicingCycleConfiguration", "NewFloatingMatrixPrice", + "NewFloatingMatrixPriceMatrixConfig", + "NewFloatingMatrixPriceMatrixConfigMatrixValue", + "NewFloatingMatrixPriceBillingCycleConfiguration", + "NewFloatingMatrixPriceInvoicingCycleConfiguration", "NewFloatingMatrixWithAllocationPrice", + "NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig", + "NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue", + "NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration", + "NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration", "NewFloatingTieredPrice", + "NewFloatingTieredPriceTieredConfig", + "NewFloatingTieredPriceTieredConfigTier", + "NewFloatingTieredPriceBillingCycleConfiguration", + "NewFloatingTieredPriceInvoicingCycleConfiguration", "NewFloatingTieredBpsPrice", + "NewFloatingTieredBpsPriceTieredBpsConfig", + "NewFloatingTieredBpsPriceTieredBpsConfigTier", + "NewFloatingTieredBpsPriceBillingCycleConfiguration", + "NewFloatingTieredBpsPriceInvoicingCycleConfiguration", "NewFloatingBpsPrice", + "NewFloatingBpsPriceBpsConfig", + "NewFloatingBpsPriceBillingCycleConfiguration", + "NewFloatingBpsPriceInvoicingCycleConfiguration", "NewFloatingBulkBpsPrice", + "NewFloatingBulkBpsPriceBulkBpsConfig", + "NewFloatingBulkBpsPriceBulkBpsConfigTier", + "NewFloatingBulkBpsPriceBillingCycleConfiguration", + "NewFloatingBulkBpsPriceInvoicingCycleConfiguration", "NewFloatingBulkPrice", + "NewFloatingBulkPriceBulkConfig", + "NewFloatingBulkPriceBulkConfigTier", + "NewFloatingBulkPriceBillingCycleConfiguration", + "NewFloatingBulkPriceInvoicingCycleConfiguration", "NewFloatingThresholdTotalAmountPrice", + "NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration", + "NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration", "NewFloatingTieredPackagePrice", + "NewFloatingTieredPackagePriceBillingCycleConfiguration", + "NewFloatingTieredPackagePriceInvoicingCycleConfiguration", "NewFloatingGroupedTieredPrice", + "NewFloatingGroupedTieredPriceBillingCycleConfiguration", + "NewFloatingGroupedTieredPriceInvoicingCycleConfiguration", "NewFloatingMaxGroupTieredPackagePrice", + "NewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration", + "NewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration", "NewFloatingTieredWithMinimumPrice", + "NewFloatingTieredWithMinimumPriceBillingCycleConfiguration", + "NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration", "NewFloatingPackageWithAllocationPrice", + "NewFloatingPackageWithAllocationPriceBillingCycleConfiguration", + "NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration", "NewFloatingTieredPackageWithMinimumPrice", + "NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration", + "NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration", "NewFloatingUnitWithPercentPrice", + "NewFloatingUnitWithPercentPriceBillingCycleConfiguration", + "NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration", "NewFloatingTieredWithProrationPrice", + "NewFloatingTieredWithProrationPriceBillingCycleConfiguration", + "NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration", "NewFloatingUnitWithProrationPrice", + "NewFloatingUnitWithProrationPriceBillingCycleConfiguration", + "NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration", "NewFloatingGroupedAllocationPrice", + "NewFloatingGroupedAllocationPriceBillingCycleConfiguration", + "NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration", "NewFloatingGroupedWithProratedMinimumPrice", + "NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", "NewFloatingGroupedWithMeteredMinimumPrice", + "NewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration", + "NewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", "NewFloatingMatrixWithDisplayNamePrice", + "NewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration", + "NewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration", "NewFloatingBulkWithProrationPrice", + "NewFloatingBulkWithProrationPriceBillingCycleConfiguration", + "NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration", "NewFloatingGroupedTieredPackagePrice", + "NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration", + "NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration", "NewFloatingScalableMatrixWithUnitPricingPrice", + "NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", "NewFloatingScalableMatrixWithTieredPricingPrice", + "NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", "NewFloatingCumulativeGroupedBulkPrice", + "NewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration", + "NewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration", ] @@ -65,7 +124,7 @@ class NewFloatingUnitPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - unit_config: Required[UnitConfigModel] + unit_config: Required[NewFloatingUnitPriceUnitConfig] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -79,7 +138,7 @@ class NewFloatingUnitPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingUnitPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -100,7 +159,7 @@ class NewFloatingUnitPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingUnitPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -114,6 +173,27 @@ class NewFloatingUnitPrice(TypedDict, total=False): """ +class NewFloatingUnitPriceUnitConfig(TypedDict, total=False): + unit_amount: Required[str] + """Rate per unit of usage""" + + +class NewFloatingUnitPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -129,7 +209,7 @@ class NewFloatingPackagePrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - package_config: Required[PackageConfigModel] + package_config: Required[NewFloatingPackagePricePackageConfig] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -143,7 +223,7 @@ class NewFloatingPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingPackagePriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -164,7 +244,7 @@ class NewFloatingPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingPackagePriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -178,6 +258,34 @@ class NewFloatingPackagePrice(TypedDict, total=False): """ +class NewFloatingPackagePricePackageConfig(TypedDict, total=False): + package_amount: Required[str] + """A currency amount to rate usage by""" + + package_size: Required[int] + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + +class NewFloatingPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingMatrixPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -188,7 +296,7 @@ class NewFloatingMatrixPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - matrix_config: Required[MatrixConfigModel] + matrix_config: Required[NewFloatingMatrixPriceMatrixConfig] model_type: Required[Literal["matrix"]] @@ -207,7 +315,7 @@ class NewFloatingMatrixPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingMatrixPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -228,7 +336,7 @@ class NewFloatingMatrixPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingMatrixPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -242,6 +350,45 @@ class NewFloatingMatrixPrice(TypedDict, total=False): """ +class NewFloatingMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): + dimension_values: Required[List[Optional[str]]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: Required[str] + """Unit price for the specified dimension_values""" + + +class NewFloatingMatrixPriceMatrixConfig(TypedDict, total=False): + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[NewFloatingMatrixPriceMatrixConfigMatrixValue]] + """Matrix values for specified matrix grouping keys""" + + +class NewFloatingMatrixPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -252,7 +399,7 @@ class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - matrix_with_allocation_config: Required[MatrixWithAllocationConfigModel] + matrix_with_allocation_config: Required[NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig] model_type: Required[Literal["matrix_with_allocation"]] @@ -271,7 +418,7 @@ class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -292,7 +439,7 @@ class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -306,6 +453,48 @@ class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): """ +class NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue(TypedDict, total=False): + dimension_values: Required[List[Optional[str]]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: Required[str] + """Unit price for the specified dimension_values""" + + +class NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig(TypedDict, total=False): + allocation: Required[float] + """Allocation to be used to calculate the price""" + + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue]] + """Matrix values for specified matrix grouping keys""" + + +class NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingTieredPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -321,7 +510,7 @@ class NewFloatingTieredPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_config: Required[TieredConfigModel] + tiered_config: Required[NewFloatingTieredPriceTieredConfig] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -335,7 +524,7 @@ class NewFloatingTieredPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingTieredPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -356,7 +545,7 @@ class NewFloatingTieredPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingTieredPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -370,6 +559,38 @@ class NewFloatingTieredPrice(TypedDict, total=False): """ +class NewFloatingTieredPriceTieredConfigTier(TypedDict, total=False): + first_unit: Required[float] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + last_unit: Optional[float] + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class NewFloatingTieredPriceTieredConfig(TypedDict, total=False): + tiers: Required[Iterable[NewFloatingTieredPriceTieredConfigTier]] + """Tiers for rating based on total usage quantities into the specified tier""" + + +class NewFloatingTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingTieredBpsPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -385,7 +606,7 @@ class NewFloatingTieredBpsPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_bps_config: Required[TieredBpsConfigModel] + tiered_bps_config: Required[NewFloatingTieredBpsPriceTieredBpsConfig] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -399,7 +620,7 @@ class NewFloatingTieredBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingTieredBpsPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -420,7 +641,7 @@ class NewFloatingTieredBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingTieredBpsPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -434,8 +655,46 @@ class NewFloatingTieredBpsPrice(TypedDict, total=False): """ +class NewFloatingTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Per-event basis point rate""" + + minimum_amount: Required[str] + """Inclusive tier starting value""" + + maximum_amount: Optional[str] + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] + """Per unit maximum to charge""" + + +class NewFloatingTieredBpsPriceTieredBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[NewFloatingTieredBpsPriceTieredBpsConfigTier]] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + +class NewFloatingTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingBpsPrice(TypedDict, total=False): - bps_config: Required[BpsConfigModel] + bps_config: Required[NewFloatingBpsPriceBpsConfig] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -463,7 +722,7 @@ class NewFloatingBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingBpsPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -484,7 +743,7 @@ class NewFloatingBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingBpsPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -498,8 +757,32 @@ class NewFloatingBpsPrice(TypedDict, total=False): """ +class NewFloatingBpsPriceBpsConfig(TypedDict, total=False): + bps: Required[float] + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] + """Optional currency amount maximum to cap spend per event""" + + +class NewFloatingBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[BulkBpsConfigModel] + bulk_bps_config: Required[NewFloatingBulkBpsPriceBulkBpsConfig] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -527,7 +810,7 @@ class NewFloatingBulkBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingBulkBpsPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -548,7 +831,7 @@ class NewFloatingBulkBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingBulkBpsPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -562,8 +845,43 @@ class NewFloatingBulkBpsPrice(TypedDict, total=False): """ +class NewFloatingBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Basis points to rate on""" + + maximum_amount: Optional[str] + """Upper bound for tier""" + + per_unit_maximum: Optional[str] + """The maximum amount to charge for any one event""" + + +class NewFloatingBulkBpsPriceBulkBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[NewFloatingBulkBpsPriceBulkBpsConfigTier]] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ + + +class NewFloatingBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingBulkPrice(TypedDict, total=False): - bulk_config: Required[BulkConfigModel] + bulk_config: Required[NewFloatingBulkPriceBulkConfig] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -591,7 +909,7 @@ class NewFloatingBulkPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingBulkPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -612,7 +930,7 @@ class NewFloatingBulkPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingBulkPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -626,6 +944,35 @@ class NewFloatingBulkPrice(TypedDict, total=False): """ +class NewFloatingBulkPriceBulkConfigTier(TypedDict, total=False): + unit_amount: Required[str] + """Amount per unit""" + + maximum_units: Optional[float] + """Upper bound for this tier""" + + +class NewFloatingBulkPriceBulkConfig(TypedDict, total=False): + tiers: Required[Iterable[NewFloatingBulkPriceBulkConfigTier]] + """Bulk tiers for rating based on total usage volume""" + + +class NewFloatingBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -641,7 +988,7 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - threshold_total_amount_config: Required[CustomRatingFunctionConfigModel] + threshold_total_amount_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -655,7 +1002,7 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -676,7 +1023,7 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -690,6 +1037,22 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): """ +class NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -705,7 +1068,7 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_package_config: Required[CustomRatingFunctionConfigModel] + tiered_package_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -719,7 +1082,7 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingTieredPackagePriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -740,7 +1103,7 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingTieredPackagePriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -754,6 +1117,22 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): """ +class NewFloatingTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingGroupedTieredPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -761,7 +1140,7 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): currency: Required[str] """An ISO 4217 currency string for which this price is billed in.""" - grouped_tiered_config: Required[CustomRatingFunctionConfigModel] + grouped_tiered_config: Required[Dict[str, object]] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -783,7 +1162,7 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingGroupedTieredPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -804,7 +1183,7 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingGroupedTieredPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -818,6 +1197,22 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): """ +class NewFloatingGroupedTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingGroupedTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -828,7 +1223,7 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - max_group_tiered_package_config: Required[CustomRatingFunctionConfigModel] + max_group_tiered_package_config: Required[Dict[str, object]] model_type: Required[Literal["max_group_tiered_package"]] @@ -847,7 +1242,7 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -868,7 +1263,7 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -882,6 +1277,22 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): """ +class NewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -897,7 +1308,7 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_with_minimum_config: Required[CustomRatingFunctionConfigModel] + tiered_with_minimum_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -911,7 +1322,7 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingTieredWithMinimumPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -932,7 +1343,7 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -946,6 +1357,22 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): """ +class NewFloatingTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -961,7 +1388,7 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - package_with_allocation_config: Required[CustomRatingFunctionConfigModel] + package_with_allocation_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -975,7 +1402,7 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingPackageWithAllocationPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -996,7 +1423,7 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1010,6 +1437,22 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): """ +class NewFloatingPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1025,7 +1468,7 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_package_with_minimum_config: Required[CustomRatingFunctionConfigModel] + tiered_package_with_minimum_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1039,7 +1482,7 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1060,7 +1503,7 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1074,6 +1517,22 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): """ +class NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingUnitWithPercentPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1089,7 +1548,7 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - unit_with_percent_config: Required[CustomRatingFunctionConfigModel] + unit_with_percent_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1103,7 +1562,7 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingUnitWithPercentPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1124,7 +1583,7 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1138,6 +1597,22 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): """ +class NewFloatingUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingTieredWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1153,7 +1628,7 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_with_proration_config: Required[CustomRatingFunctionConfigModel] + tiered_with_proration_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1167,7 +1642,7 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingTieredWithProrationPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1188,7 +1663,7 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1202,6 +1677,22 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): """ +class NewFloatingTieredWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingUnitWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1217,7 +1708,7 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - unit_with_proration_config: Required[CustomRatingFunctionConfigModel] + unit_with_proration_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1231,7 +1722,7 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingUnitWithProrationPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1252,7 +1743,7 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1266,6 +1757,22 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): """ +class NewFloatingUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingGroupedAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1273,7 +1780,7 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): currency: Required[str] """An ISO 4217 currency string for which this price is billed in.""" - grouped_allocation_config: Required[CustomRatingFunctionConfigModel] + grouped_allocation_config: Required[Dict[str, object]] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1295,7 +1802,7 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingGroupedAllocationPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1316,7 +1823,7 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1330,6 +1837,22 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): """ +class NewFloatingGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1337,7 +1860,7 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): currency: Required[str] """An ISO 4217 currency string for which this price is billed in.""" - grouped_with_prorated_minimum_config: Required[CustomRatingFunctionConfigModel] + grouped_with_prorated_minimum_config: Required[Dict[str, object]] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1359,7 +1882,7 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1380,7 +1903,7 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1394,6 +1917,22 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): """ +class NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1401,7 +1940,7 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): currency: Required[str] """An ISO 4217 currency string for which this price is billed in.""" - grouped_with_metered_minimum_config: Required[CustomRatingFunctionConfigModel] + grouped_with_metered_minimum_config: Required[Dict[str, object]] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1423,7 +1962,7 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1444,7 +1983,7 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1458,6 +1997,22 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): """ +class NewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1468,7 +2023,7 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - matrix_with_display_name_config: Required[CustomRatingFunctionConfigModel] + matrix_with_display_name_config: Required[Dict[str, object]] model_type: Required[Literal["matrix_with_display_name"]] @@ -1487,7 +2042,7 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1508,7 +2063,7 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1522,8 +2077,24 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): """ +class NewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[CustomRatingFunctionConfigModel] + bulk_with_proration_config: Required[Dict[str, object]] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1551,7 +2122,7 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingBulkWithProrationPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1572,7 +2143,7 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1586,6 +2157,22 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): """ +class NewFloatingBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1593,7 +2180,7 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): currency: Required[str] """An ISO 4217 currency string for which this price is billed in.""" - grouped_tiered_package_config: Required[CustomRatingFunctionConfigModel] + grouped_tiered_package_config: Required[Dict[str, object]] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1615,7 +2202,7 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1636,7 +2223,7 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1650,6 +2237,22 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): """ +class NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1665,7 +2268,7 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - scalable_matrix_with_unit_pricing_config: Required[CustomRatingFunctionConfigModel] + scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1679,7 +2282,7 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1700,7 +2303,7 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1714,6 +2317,22 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): """ +class NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1729,7 +2348,7 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - scalable_matrix_with_tiered_pricing_config: Required[CustomRatingFunctionConfigModel] + scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1743,7 +2362,7 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1764,7 +2383,7 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1778,11 +2397,27 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): """ +class NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - cumulative_grouped_bulk_config: Required[CustomRatingFunctionConfigModel] + cumulative_grouped_bulk_config: Required[Dict[str, object]] currency: Required[str] """An ISO 4217 currency string for which this price is billed in.""" @@ -1807,7 +2442,7 @@ class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + billing_cycle_configuration: Optional[NewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1828,7 +2463,7 @@ class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + invoicing_cycle_configuration: Optional[NewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1842,6 +2477,22 @@ class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): """ +class NewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + PriceCreateParams: TypeAlias = Union[ NewFloatingUnitPrice, NewFloatingPackagePrice, diff --git a/src/orb/types/shared/__init__.py b/src/orb/types/shared/__init__.py index 46fc1f8e..4f862f83 100644 --- a/src/orb/types/shared/__init__.py +++ b/src/orb/types/shared/__init__.py @@ -1,124 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .discount import Discount as Discount -from .item_model import ItemModel as ItemModel -from .plan_model import PlanModel as PlanModel -from .alert_model import AlertModel as AlertModel -from .price_model import PriceModel as PriceModel -from .usage_model import UsageModel as UsageModel -from .coupon_model import CouponModel as CouponModel -from .top_up_model import TopUpModel as TopUpModel -from .address_model import AddressModel as AddressModel -from .invoice_model import InvoiceModel as InvoiceModel -from .maximum_model import MaximumModel as MaximumModel -from .minimum_model import MinimumModel as MinimumModel -from .top_ups_model import TopUpsModel as TopUpsModel -from .backfill_model import BackfillModel as BackfillModel -from .customer_model import CustomerModel as CustomerModel -from .discount_model import DiscountModel as DiscountModel from .trial_discount import TrialDiscount as TrialDiscount from .amount_discount import AmountDiscount as AmountDiscount -from .edit_plan_model import EditPlanModel as EditPlanModel -from .item_slim_model import ItemSlimModel as ItemSlimModel -from .threshold_model import ThresholdModel as ThresholdModel -from .adjustment_model import AdjustmentModel as AdjustmentModel -from .allocation_model import AllocationModel as AllocationModel -from .bps_config_model import BpsConfigModel as BpsConfigModel -from .tax_amount_model import TaxAmountModel as TaxAmountModel -from .bulk_config_model import BulkConfigModel as BulkConfigModel -from .credit_note_model import CreditNoteModel as CreditNoteModel -from .unit_config_model import UnitConfigModel as UnitConfigModel -from .matrix_value_model import MatrixValueModel as MatrixValueModel -from .subscription_model import SubscriptionModel as SubscriptionModel -from .address_input_model import AddressInputModel as AddressInputModel -from .edit_customer_model import EditCustomerModel as EditCustomerModel -from .matrix_config_model import MatrixConfigModel as MatrixConfigModel from .pagination_metadata import PaginationMetadata as PaginationMetadata from .percentage_discount import PercentageDiscount as PercentageDiscount -from .plan_minified_model import PlanMinifiedModel as PlanMinifiedModel -from .subscriptions_model import SubscriptionsModel as SubscriptionsModel -from .tiered_config_model import TieredConfigModel as TieredConfigModel -from .affected_block_model import AffectedBlockModel as AffectedBlockModel -from .customer_costs_model import CustomerCostsModel as CustomerCostsModel -from .new_adjustment_model import NewAdjustmentModel as NewAdjustmentModel -from .package_config_model import PackageConfigModel as PackageConfigModel -from .price_interval_model import PriceIntervalModel as PriceIntervalModel -from .trial_discount_model import TrialDiscountModel as TrialDiscountModel -from .aggregated_cost_model import AggregatedCostModel as AggregatedCostModel -from .amount_discount_model import AmountDiscountModel as AmountDiscountModel -from .auto_collection_model import AutoCollectionModel as AutoCollectionModel -from .billable_metric_model import BillableMetricModel as BillableMetricModel -from .bulk_bps_config_model import BulkBpsConfigModel as BulkBpsConfigModel -from .customer_tax_id_model import CustomerTaxIDModel as CustomerTaxIDModel -from .payment_attempt_model import PaymentAttemptModel as PaymentAttemptModel from .invoice_level_discount import InvoiceLevelDiscount as InvoiceLevelDiscount -from .maximum_interval_model import MaximumIntervalModel as MaximumIntervalModel -from .minimum_interval_model import MinimumIntervalModel as MinimumIntervalModel -from .coupon_redemption_model import CouponRedemptionModel as CouponRedemptionModel -from .customer_minified_model import CustomerMinifiedModel as CustomerMinifiedModel -from .discount_override_model import DiscountOverrideModel as DiscountOverrideModel -from .invoice_line_item_model import InvoiceLineItemModel as InvoiceLineItemModel -from .tiered_bps_config_model import TieredBpsConfigModel as TieredBpsConfigModel -from .new_floating_price_model import NewFloatingPriceModel as NewFloatingPriceModel from .add_credit_top_up_request import AddCreditTopUpRequest as AddCreditTopUpRequest -from .adjustment_interval_model import AdjustmentIntervalModel as AdjustmentIntervalModel -from .credit_ledger_entry_model import CreditLedgerEntryModel as CreditLedgerEntryModel -from .credit_note_summary_model import CreditNoteSummaryModel as CreditNoteSummaryModel -from .pagination_metadata_model import PaginationMetadataModel as PaginationMetadataModel -from .percentage_discount_model import PercentageDiscountModel as PercentageDiscountModel -from .billable_metric_tiny_model import BillableMetricTinyModel as BillableMetricTinyModel -from .credit_note_discount_model import CreditNoteDiscountModel as CreditNoteDiscountModel -from .mutated_subscription_model import MutatedSubscriptionModel as MutatedSubscriptionModel -from .new_allocation_price_model import NewAllocationPriceModel as NewAllocationPriceModel from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate -from .credit_ledger_entries_model import CreditLedgerEntriesModel as CreditLedgerEntriesModel -from .new_tax_configuration_model import NewTaxConfigurationModel as NewTaxConfigurationModel -from .subscription_minified_model import SubscriptionMinifiedModel as SubscriptionMinifiedModel from .update_price_request_params import UpdatePriceRequestParams as UpdatePriceRequestParams -from .billable_metric_simple_model import BillableMetricSimpleModel as BillableMetricSimpleModel -from .invoice_level_discount_model import InvoiceLevelDiscountModel as InvoiceLevelDiscountModel -from .new_subscription_price_model import NewSubscriptionPriceModel as NewSubscriptionPriceModel -from .sub_line_item_grouping_model import SubLineItemGroupingModel as SubLineItemGroupingModel from .add_subscription_price_params import AddSubscriptionPriceParams as AddSubscriptionPriceParams from .create_customer_alert_request import CreateCustomerAlertRequest as CreateCustomerAlertRequest -from .dimensional_price_group_model import DimensionalPriceGroupModel as DimensionalPriceGroupModel -from .subscription_trial_info_model import SubscriptionTrialInfoModel as SubscriptionTrialInfoModel -from .usage_discount_interval_model import UsageDiscountIntervalModel as UsageDiscountIntervalModel -from .amount_discount_interval_model import AmountDiscountIntervalModel as AmountDiscountIntervalModel -from .customer_credit_balances_model import CustomerCreditBalancesModel as CustomerCreditBalancesModel -from .item_external_connection_model import ItemExternalConnectionModel as ItemExternalConnectionModel from .add_credit_ledger_entry_request import AddCreditLedgerEntryRequest as AddCreditLedgerEntryRequest -from .customer_hierarchy_config_model import CustomerHierarchyConfigModel as CustomerHierarchyConfigModel from .remove_subscription_price_params import RemoveSubscriptionPriceParams as RemoveSubscriptionPriceParams -from .billing_cycle_configuration_model import BillingCycleConfigurationModel as BillingCycleConfigurationModel -from .new_reporting_configuration_model import NewReportingConfigurationModel as NewReportingConfigurationModel from .replace_subscription_price_params import ReplaceSubscriptionPriceParams as ReplaceSubscriptionPriceParams from .add_subscription_adjustment_params import AddSubscriptionAdjustmentParams as AddSubscriptionAdjustmentParams -from .customer_balance_transaction_model import CustomerBalanceTransactionModel as CustomerBalanceTransactionModel -from .percentage_discount_interval_model import PercentageDiscountIntervalModel as PercentageDiscountIntervalModel -from .custom_rating_function_config_model import CustomRatingFunctionConfigModel as CustomRatingFunctionConfigModel -from .matrix_with_allocation_config_model import MatrixWithAllocationConfigModel as MatrixWithAllocationConfigModel -from .dimensional_price_configuration_model import ( - DimensionalPriceConfigurationModel as DimensionalPriceConfigurationModel, -) -from .new_billing_cycle_configuration_model import ( - NewBillingCycleConfigurationModel as NewBillingCycleConfigurationModel, -) from .remove_subscription_adjustment_params import ( RemoveSubscriptionAdjustmentParams as RemoveSubscriptionAdjustmentParams, ) from .replace_subscription_adjustment_params import ( ReplaceSubscriptionAdjustmentParams as ReplaceSubscriptionAdjustmentParams, ) -from .fixed_fee_quantity_schedule_entry_model import ( - FixedFeeQuantityScheduleEntryModel as FixedFeeQuantityScheduleEntryModel, -) -from .new_accounting_sync_configuration_model import ( - NewAccountingSyncConfigurationModel as NewAccountingSyncConfigurationModel, -) -from .billing_cycle_anchor_configuration_model import ( - BillingCycleAnchorConfigurationModel as BillingCycleAnchorConfigurationModel, -) -from .price_interval_fixed_fee_quantity_transition_model import ( - PriceIntervalFixedFeeQuantityTransitionModel as PriceIntervalFixedFeeQuantityTransitionModel, -) diff --git a/src/orb/types/shared/add_subscription_adjustment_params.py b/src/orb/types/shared/add_subscription_adjustment_params.py index 435769c9..5cdadec9 100644 --- a/src/orb/types/shared/add_subscription_adjustment_params.py +++ b/src/orb/types/shared/add_subscription_adjustment_params.py @@ -1,16 +1,115 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias +from ..._utils import PropertyInfo from ..._models import BaseModel -from .new_adjustment_model import NewAdjustmentModel -__all__ = ["AddSubscriptionAdjustmentParams"] +__all__ = [ + "AddSubscriptionAdjustmentParams", + "Adjustment", + "AdjustmentNewPercentageDiscount", + "AdjustmentNewUsageDiscount", + "AdjustmentNewAmountDiscount", + "AdjustmentNewMinimum", + "AdjustmentNewMaximum", +] + + +class AdjustmentNewPercentageDiscount(BaseModel): + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + percentage_discount: float + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewUsageDiscount(BaseModel): + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + usage_discount: float + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewAmountDiscount(BaseModel): + adjustment_type: Literal["amount_discount"] + + amount_discount: str + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewMinimum(BaseModel): + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewMaximum(BaseModel): + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + maximum_amount: str + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +Adjustment: TypeAlias = Annotated[ + Union[ + AdjustmentNewPercentageDiscount, + AdjustmentNewUsageDiscount, + AdjustmentNewAmountDiscount, + AdjustmentNewMinimum, + AdjustmentNewMaximum, + ], + PropertyInfo(discriminator="adjustment_type"), +] class AddSubscriptionAdjustmentParams(BaseModel): - adjustment: NewAdjustmentModel + adjustment: Adjustment """The definition of a new adjustment to create and add to the subscription.""" end_date: Optional[datetime] = None diff --git a/src/orb/types/shared/add_subscription_price_params.py b/src/orb/types/shared/add_subscription_price_params.py index 152a934f..6d7ff840 100644 --- a/src/orb/types/shared/add_subscription_price_params.py +++ b/src/orb/types/shared/add_subscription_price_params.py @@ -1,21 +1,2576 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + +from ..._utils import PropertyInfo from ..._models import BaseModel -from .discount_override_model import DiscountOverrideModel -from .new_allocation_price_model import NewAllocationPriceModel -from .new_subscription_price_model import NewSubscriptionPriceModel -__all__ = ["AddSubscriptionPriceParams"] +__all__ = [ + "AddSubscriptionPriceParams", + "AllocationPrice", + "Discount", + "Price", + "PriceNewSubscriptionUnitPrice", + "PriceNewSubscriptionUnitPriceUnitConfig", + "PriceNewSubscriptionUnitPriceBillingCycleConfiguration", + "PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionPackagePrice", + "PriceNewSubscriptionPackagePricePackageConfig", + "PriceNewSubscriptionPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionMatrixPrice", + "PriceNewSubscriptionMatrixPriceMatrixConfig", + "PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", + "PriceNewSubscriptionMatrixPriceBillingCycleConfiguration", + "PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredPrice", + "PriceNewSubscriptionTieredPriceTieredConfig", + "PriceNewSubscriptionTieredPriceTieredConfigTier", + "PriceNewSubscriptionTieredPriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredBpsPrice", + "PriceNewSubscriptionTieredBpsPriceTieredBpsConfig", + "PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", + "PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBpsPrice", + "PriceNewSubscriptionBpsPriceBpsConfig", + "PriceNewSubscriptionBpsPriceBillingCycleConfiguration", + "PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBulkBpsPrice", + "PriceNewSubscriptionBulkBpsPriceBulkBpsConfig", + "PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", + "PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", + "PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBulkPrice", + "PriceNewSubscriptionBulkPriceBulkConfig", + "PriceNewSubscriptionBulkPriceBulkConfigTier", + "PriceNewSubscriptionBulkPriceBillingCycleConfiguration", + "PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionThresholdTotalAmountPrice", + "PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", + "PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredPackagePrice", + "PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredWithMinimumPrice", + "PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionUnitWithPercentPrice", + "PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", + "PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionPackageWithAllocationPrice", + "PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", + "PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTierWithProrationPrice", + "PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", + "PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionUnitWithProrationPrice", + "PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", + "PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedAllocationPrice", + "PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedWithProratedMinimumPrice", + "PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBulkWithProrationPrice", + "PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", + "PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithUnitPricingPrice", + "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithTieredPricingPrice", + "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionCumulativeGroupedBulkPrice", + "PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration", + "PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionMaxGroupTieredPackagePrice", + "PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedWithMeteredMinimumPrice", + "PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionMatrixWithDisplayNamePrice", + "PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration", + "PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedTieredPackagePrice", + "PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration", +] + + +class AllocationPrice(BaseModel): + amount: str + """An amount of the currency to allocate to the customer at the specified cadence.""" + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + """The cadence at which to allocate the amount to the customer.""" + + currency: str + """ + An ISO 4217 currency string or a custom pricing unit identifier in which to bill + this price. + """ + + expires_at_end_of_cadence: bool + """ + Whether the allocated amount should expire at the end of the cadence or roll + over to the next period. + """ + + +class Discount(BaseModel): + discount_type: Literal["percentage", "usage", "amount"] + + amount_discount: Optional[str] = None + """Only available if discount_type is `amount`.""" + + percentage_discount: Optional[float] = None + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + usage_discount: Optional[float] = None + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class PriceNewSubscriptionUnitPriceUnitConfig(BaseModel): + unit_amount: str + """Rate per unit of usage""" + + +class PriceNewSubscriptionUnitPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["unit"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + unit_config: PriceNewSubscriptionUnitPriceUnitConfig + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionPackagePricePackageConfig(BaseModel): + package_amount: str + """A currency amount to rate usage by""" + + package_size: int + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + +class PriceNewSubscriptionPackagePriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + package_config: PriceNewSubscriptionPackagePricePackageConfig + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(BaseModel): + dimension_values: List[Optional[str]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: str + """Unit price for the specified dimension_values""" + + +class PriceNewSubscriptionMatrixPriceMatrixConfig(BaseModel): + default_unit_amount: str + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: List[Optional[str]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: List[PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue] + """Matrix values for specified matrix grouping keys""" + + +class PriceNewSubscriptionMatrixPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + matrix_config: PriceNewSubscriptionMatrixPriceMatrixConfig + + price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredPriceTieredConfigTier(BaseModel): + first_unit: float + """Inclusive tier starting value""" + + unit_amount: str + """Amount per unit""" + + last_unit: Optional[float] = None + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class PriceNewSubscriptionTieredPriceTieredConfig(BaseModel): + tiers: List[PriceNewSubscriptionTieredPriceTieredConfigTier] + """Tiers for rating based on total usage quantities into the specified tier""" + + +class PriceNewSubscriptionTieredPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_config: PriceNewSubscriptionTieredPriceTieredConfig + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(BaseModel): + bps: float + """Per-event basis point rate""" + + minimum_amount: str + """Inclusive tier starting value""" + + maximum_amount: Optional[str] = None + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] = None + """Per unit maximum to charge""" + + +class PriceNewSubscriptionTieredBpsPriceTieredBpsConfig(BaseModel): + tiers: List[PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + +class PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredBpsPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_bps_config: PriceNewSubscriptionTieredBpsPriceTieredBpsConfig + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBpsPriceBpsConfig(BaseModel): + bps: float + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] = None + """Optional currency amount maximum to cap spend per event""" + + +class PriceNewSubscriptionBpsPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBpsPrice(BaseModel): + bps_config: PriceNewSubscriptionBpsPriceBpsConfig + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bps"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(BaseModel): + bps: float + """Basis points to rate on""" + + maximum_amount: Optional[str] = None + """Upper bound for tier""" + + per_unit_maximum: Optional[str] = None + """The maximum amount to charge for any one event""" + + +class PriceNewSubscriptionBulkBpsPriceBulkBpsConfig(BaseModel): + tiers: List[PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ + + +class PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkBpsPrice(BaseModel): + bulk_bps_config: PriceNewSubscriptionBulkBpsPriceBulkBpsConfig + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBulkPriceBulkConfigTier(BaseModel): + unit_amount: str + """Amount per unit""" + + maximum_units: Optional[float] = None + """Upper bound for this tier""" + + +class PriceNewSubscriptionBulkPriceBulkConfig(BaseModel): + tiers: List[PriceNewSubscriptionBulkPriceBulkConfigTier] + """Bulk tiers for rating based on total usage volume""" + + +class PriceNewSubscriptionBulkPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkPrice(BaseModel): + bulk_config: PriceNewSubscriptionBulkPriceBulkConfig + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionThresholdTotalAmountPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + threshold_total_amount_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_package_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredWithMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_with_minimum_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration] = ( + None + ) + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithPercentPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["unit_with_percent"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + unit_with_percent_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackageWithAllocationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + package_with_allocation_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration] = ( + None + ) + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTierWithProrationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_with_proration"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_with_proration_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration] = ( + None + ) + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithProrationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["unit_with_proration"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + unit_with_proration_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration] = ( + None + ) + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedAllocationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Dict[str, object] + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration] = ( + None + ) + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithProratedMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Dict[str, object] + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_with_prorated_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration + ] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkWithProrationPrice(BaseModel): + bulk_with_proration_config: Dict[str, object] + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bulk_with_proration"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration] = ( + None + ) + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithUnitPricingPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithTieredPricingPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionCumulativeGroupedBulkPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Dict[str, object] + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["cumulative_grouped_bulk"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration] = ( + None + ) + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMaxGroupTieredPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: Dict[str, object] + + price_model_type: Literal["max_group_tiered_package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration] = ( + None + ) + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithMeteredMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Dict[str, object] + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_with_metered_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration + ] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixWithDisplayNamePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + matrix_with_display_name_config: Dict[str, object] + + price_model_type: Literal["matrix_with_display_name"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration] = ( + None + ) + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedTieredPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Dict[str, object] + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_tiered_package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +Price: TypeAlias = Annotated[ + Union[ + PriceNewSubscriptionUnitPrice, + PriceNewSubscriptionPackagePrice, + PriceNewSubscriptionMatrixPrice, + PriceNewSubscriptionTieredPrice, + PriceNewSubscriptionTieredBpsPrice, + PriceNewSubscriptionBpsPrice, + PriceNewSubscriptionBulkBpsPrice, + PriceNewSubscriptionBulkPrice, + PriceNewSubscriptionThresholdTotalAmountPrice, + PriceNewSubscriptionTieredPackagePrice, + PriceNewSubscriptionTieredWithMinimumPrice, + PriceNewSubscriptionUnitWithPercentPrice, + PriceNewSubscriptionPackageWithAllocationPrice, + PriceNewSubscriptionTierWithProrationPrice, + PriceNewSubscriptionUnitWithProrationPrice, + PriceNewSubscriptionGroupedAllocationPrice, + PriceNewSubscriptionGroupedWithProratedMinimumPrice, + PriceNewSubscriptionBulkWithProrationPrice, + PriceNewSubscriptionScalableMatrixWithUnitPricingPrice, + PriceNewSubscriptionScalableMatrixWithTieredPricingPrice, + PriceNewSubscriptionCumulativeGroupedBulkPrice, + PriceNewSubscriptionMaxGroupTieredPackagePrice, + PriceNewSubscriptionGroupedWithMeteredMinimumPrice, + PriceNewSubscriptionMatrixWithDisplayNamePrice, + PriceNewSubscriptionGroupedTieredPackagePrice, + None, + ], + PropertyInfo(discriminator="price_model_type"), +] class AddSubscriptionPriceParams(BaseModel): - allocation_price: Optional[NewAllocationPriceModel] = None + allocation_price: Optional[AllocationPrice] = None """The definition of a new allocation price to create and add to the subscription.""" - discounts: Optional[List[DiscountOverrideModel]] = None + discounts: Optional[List[Discount]] = None """[DEPRECATED] Use add_adjustments instead. The subscription's discounts for this price. @@ -46,7 +2601,7 @@ class AddSubscriptionPriceParams(BaseModel): plan_phase_order: Optional[int] = None """The phase to add this price to.""" - price: Optional[NewSubscriptionPriceModel] = None + price: Optional[Price] = None """The definition of a new price to create and add to the subscription.""" price_id: Optional[str] = None diff --git a/src/orb/types/shared/address_input_model.py b/src/orb/types/shared/address_input_model.py deleted file mode 100644 index 69c45898..00000000 --- a/src/orb/types/shared/address_input_model.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["AddressInputModel"] - - -class AddressInputModel(BaseModel): - city: Optional[str] = None - - country: Optional[str] = None - - line1: Optional[str] = None - - line2: Optional[str] = None - - postal_code: Optional[str] = None - - state: Optional[str] = None diff --git a/src/orb/types/shared/address_model.py b/src/orb/types/shared/address_model.py deleted file mode 100644 index 3d78ef22..00000000 --- a/src/orb/types/shared/address_model.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["AddressModel"] - - -class AddressModel(BaseModel): - city: Optional[str] = None - - country: Optional[str] = None - - line1: Optional[str] = None - - line2: Optional[str] = None - - postal_code: Optional[str] = None - - state: Optional[str] = None diff --git a/src/orb/types/shared/adjustment_interval_model.py b/src/orb/types/shared/adjustment_interval_model.py deleted file mode 100644 index 0a89c4bd..00000000 --- a/src/orb/types/shared/adjustment_interval_model.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime - -from ..._models import BaseModel -from .adjustment_model import AdjustmentModel - -__all__ = ["AdjustmentIntervalModel"] - - -class AdjustmentIntervalModel(BaseModel): - id: str - - adjustment: AdjustmentModel - - applies_to_price_interval_ids: List[str] - """The price interval IDs that this adjustment applies to.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval.""" - - start_date: datetime - """The start date of the adjustment interval.""" diff --git a/src/orb/types/shared/adjustment_model.py b/src/orb/types/shared/adjustment_model.py deleted file mode 100644 index a72f43a6..00000000 --- a/src/orb/types/shared/adjustment_model.py +++ /dev/null @@ -1,166 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias - -from ..._utils import PropertyInfo -from ..._models import BaseModel - -__all__ = [ - "AdjustmentModel", - "PlanPhaseUsageDiscountAdjustment", - "PlanPhaseAmountDiscountAdjustment", - "PlanPhasePercentageDiscountAdjustment", - "PlanPhaseMinimumAdjustment", - "PlanPhaseMaximumAdjustment", -] - - -class PlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - 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 PlanPhaseAmountDiscountAdjustment(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. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - 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.""" - - -class PlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - 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 PlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - 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 PlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - 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.""" - - -AdjustmentModel: TypeAlias = Annotated[ - Union[ - PlanPhaseUsageDiscountAdjustment, - PlanPhaseAmountDiscountAdjustment, - PlanPhasePercentageDiscountAdjustment, - PlanPhaseMinimumAdjustment, - PlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] diff --git a/src/orb/types/shared/allocation_model.py b/src/orb/types/shared/allocation_model.py deleted file mode 100644 index 03d8b6d1..00000000 --- a/src/orb/types/shared/allocation_model.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["AllocationModel"] - - -class AllocationModel(BaseModel): - allows_rollover: bool - - currency: str diff --git a/src/orb/types/shared/amount_discount_interval_model.py b/src/orb/types/shared/amount_discount_interval_model.py deleted file mode 100644 index d5cf34ec..00000000 --- a/src/orb/types/shared/amount_discount_interval_model.py +++ /dev/null @@ -1,28 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["AmountDiscountIntervalModel"] - - -class AmountDiscountIntervalModel(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["amount"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" diff --git a/src/orb/types/shared/amount_discount_model.py b/src/orb/types/shared/amount_discount_model.py deleted file mode 100644 index c26994b6..00000000 --- a/src/orb/types/shared/amount_discount_model.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["AmountDiscountModel"] - - -class AmountDiscountModel(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """List of price_ids that this discount applies to. - - For plan/plan phase discounts, this can be a subset of prices. - """ - - discount_type: Literal["amount"] - - reason: Optional[str] = None diff --git a/src/orb/types/shared/auto_collection_model.py b/src/orb/types/shared/auto_collection_model.py deleted file mode 100644 index dbf043f8..00000000 --- a/src/orb/types/shared/auto_collection_model.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["AutoCollectionModel"] - - -class AutoCollectionModel(BaseModel): - enabled: Optional[bool] = None - """True only if auto-collection is enabled for this invoice.""" - - next_attempt_at: Optional[datetime] = None - """ - If the invoice is scheduled for auto-collection, this field will reflect when - the next attempt will occur. If dunning has been exhausted, or auto-collection - is not enabled for this invoice, this field will be `null`. - """ - - num_attempts: Optional[int] = None - """Number of auto-collection payment attempts.""" - - previously_attempted_at: Optional[datetime] = None - """ - If Orb has ever attempted payment auto-collection for this invoice, this field - will reflect when that attempt occurred. In conjunction with `next_attempt_at`, - this can be used to tell whether the invoice is currently in dunning (that is, - `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or - if dunning has been exhausted (`previously_attempted_at` is non-null, but - `next_attempt_time` is null). - """ diff --git a/src/orb/types/shared/billable_metric_simple_model.py b/src/orb/types/shared/billable_metric_simple_model.py deleted file mode 100644 index 339aa363..00000000 --- a/src/orb/types/shared/billable_metric_simple_model.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BillableMetricSimpleModel"] - - -class BillableMetricSimpleModel(BaseModel): - id: str - - name: str diff --git a/src/orb/types/shared/billable_metric_tiny_model.py b/src/orb/types/shared/billable_metric_tiny_model.py deleted file mode 100644 index 824b35da..00000000 --- a/src/orb/types/shared/billable_metric_tiny_model.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BillableMetricTinyModel"] - - -class BillableMetricTinyModel(BaseModel): - id: str diff --git a/src/orb/types/shared/billing_cycle_anchor_configuration_model.py b/src/orb/types/shared/billing_cycle_anchor_configuration_model.py deleted file mode 100644 index 3b5f1e6b..00000000 --- a/src/orb/types/shared/billing_cycle_anchor_configuration_model.py +++ /dev/null @@ -1,31 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["BillingCycleAnchorConfigurationModel"] - - -class BillingCycleAnchorConfigurationModel(BaseModel): - day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] = None - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] = None - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ diff --git a/src/orb/types/shared/billing_cycle_configuration_model.py b/src/orb/types/shared/billing_cycle_configuration_model.py deleted file mode 100644 index 4bb9ef22..00000000 --- a/src/orb/types/shared/billing_cycle_configuration_model.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["BillingCycleConfigurationModel"] - - -class BillingCycleConfigurationModel(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] diff --git a/src/orb/types/shared/bps_config_model.py b/src/orb/types/shared/bps_config_model.py deleted file mode 100644 index 3ee042c9..00000000 --- a/src/orb/types/shared/bps_config_model.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["BpsConfigModel"] - - -class BpsConfigModel(BaseModel): - bps: float - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] = None - """Optional currency amount maximum to cap spend per event""" diff --git a/src/orb/types/shared/bulk_bps_config_model.py b/src/orb/types/shared/bulk_bps_config_model.py deleted file mode 100644 index e7143f8b..00000000 --- a/src/orb/types/shared/bulk_bps_config_model.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BulkBpsConfigModel", "Tier"] - - -class Tier(BaseModel): - bps: float - """Basis points to rate on""" - - maximum_amount: Optional[str] = None - """Upper bound for tier""" - - per_unit_maximum: Optional[str] = None - """The maximum amount to charge for any one event""" - - -class BulkBpsConfigModel(BaseModel): - tiers: List[Tier] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ diff --git a/src/orb/types/shared/bulk_config_model.py b/src/orb/types/shared/bulk_config_model.py deleted file mode 100644 index be0dd7f7..00000000 --- a/src/orb/types/shared/bulk_config_model.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BulkConfigModel", "Tier"] - - -class Tier(BaseModel): - unit_amount: str - """Amount per unit""" - - maximum_units: Optional[float] = None - """Upper bound for this tier""" - - -class BulkConfigModel(BaseModel): - tiers: List[Tier] - """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb/types/shared/coupon_redemption_model.py b/src/orb/types/shared/coupon_redemption_model.py deleted file mode 100644 index b4d087be..00000000 --- a/src/orb/types/shared/coupon_redemption_model.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["CouponRedemptionModel"] - - -class CouponRedemptionModel(BaseModel): - coupon_id: str - - end_date: Optional[datetime] = None - - start_date: datetime diff --git a/src/orb/types/shared/create_customer_alert_request.py b/src/orb/types/shared/create_customer_alert_request.py index ebc3b142..02123e38 100644 --- a/src/orb/types/shared/create_customer_alert_request.py +++ b/src/orb/types/shared/create_customer_alert_request.py @@ -4,9 +4,17 @@ from typing_extensions import Literal from ..._models import BaseModel -from .threshold_model import ThresholdModel -__all__ = ["CreateCustomerAlertRequest"] +__all__ = ["CreateCustomerAlertRequest", "Threshold"] + + +class Threshold(BaseModel): + value: float + """The value at which an alert will fire. + + For credit balance alerts, the alert will fire at or below this value. For usage + and cost alerts, the alert will fire at or above this value. + """ class CreateCustomerAlertRequest(BaseModel): @@ -22,5 +30,5 @@ class CreateCustomerAlertRequest(BaseModel): ] """The type of alert to create. This must be a valid alert type.""" - thresholds: Optional[List[ThresholdModel]] = None + thresholds: Optional[List[Threshold]] = None """The thresholds that define the values at which the alert will be triggered.""" diff --git a/src/orb/types/shared/credit_ledger_entries_model.py b/src/orb/types/shared/credit_ledger_entries_model.py deleted file mode 100644 index 350fb7f7..00000000 --- a/src/orb/types/shared/credit_ledger_entries_model.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .pagination_metadata import PaginationMetadata -from .credit_ledger_entry_model import CreditLedgerEntryModel - -__all__ = ["CreditLedgerEntriesModel"] - - -class CreditLedgerEntriesModel(BaseModel): - data: List[CreditLedgerEntryModel] - - pagination_metadata: PaginationMetadata diff --git a/src/orb/types/shared/credit_note_discount_model.py b/src/orb/types/shared/credit_note_discount_model.py deleted file mode 100644 index 536b18d4..00000000 --- a/src/orb/types/shared/credit_note_discount_model.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["CreditNoteDiscountModel", "AppliesToPrice"] - - -class AppliesToPrice(BaseModel): - id: str - - name: str - - -class CreditNoteDiscountModel(BaseModel): - amount_applied: str - - discount_type: Literal["percentage"] - - percentage_discount: float - - applies_to_prices: Optional[List[AppliesToPrice]] = None - - reason: Optional[str] = None diff --git a/src/orb/types/shared/credit_note_summary_model.py b/src/orb/types/shared/credit_note_summary_model.py deleted file mode 100644 index fa4ccc3d..00000000 --- a/src/orb/types/shared/credit_note_summary_model.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["CreditNoteSummaryModel"] - - -class CreditNoteSummaryModel(BaseModel): - id: str - - credit_note_number: str - - memo: Optional[str] = None - """An optional memo supplied on the credit note.""" - - reason: str - - total: str - - type: str - - voided_at: Optional[datetime] = None - """ - If the credit note has a status of `void`, this gives a timestamp when the - credit note was voided. - """ diff --git a/src/orb/types/shared/custom_rating_function_config_model.py b/src/orb/types/shared/custom_rating_function_config_model.py deleted file mode 100644 index 3d9bd7b1..00000000 --- a/src/orb/types/shared/custom_rating_function_config_model.py +++ /dev/null @@ -1,8 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict -from typing_extensions import TypeAlias - -__all__ = ["CustomRatingFunctionConfigModel"] - -CustomRatingFunctionConfigModel: TypeAlias = Dict[str, object] diff --git a/src/orb/types/shared/customer_costs_model.py b/src/orb/types/shared/customer_costs_model.py deleted file mode 100644 index f91a983a..00000000 --- a/src/orb/types/shared/customer_costs_model.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .aggregated_cost_model import AggregatedCostModel - -__all__ = ["CustomerCostsModel"] - - -class CustomerCostsModel(BaseModel): - data: List[AggregatedCostModel] diff --git a/src/orb/types/shared/customer_hierarchy_config_model.py b/src/orb/types/shared/customer_hierarchy_config_model.py deleted file mode 100644 index 20a07530..00000000 --- a/src/orb/types/shared/customer_hierarchy_config_model.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["CustomerHierarchyConfigModel"] - - -class CustomerHierarchyConfigModel(BaseModel): - child_customer_ids: Optional[List[str]] = None - """A list of child customer IDs to add to the hierarchy. - - The desired child customers must not already be part of another hierarchy. - """ - - parent_customer_id: Optional[str] = None - """The ID of the parent customer in the hierarchy. - - The desired parent customer must not be a child of another customer. - """ diff --git a/src/orb/types/shared/customer_minified_model.py b/src/orb/types/shared/customer_minified_model.py deleted file mode 100644 index 8d17edd5..00000000 --- a/src/orb/types/shared/customer_minified_model.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["CustomerMinifiedModel"] - - -class CustomerMinifiedModel(BaseModel): - id: str - - external_customer_id: Optional[str] = None diff --git a/src/orb/types/shared/customer_tax_id_model.py b/src/orb/types/shared/customer_tax_id_model.py deleted file mode 100644 index 3f42c2f4..00000000 --- a/src/orb/types/shared/customer_tax_id_model.py +++ /dev/null @@ -1,166 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["CustomerTaxIDModel"] - - -class CustomerTaxIDModel(BaseModel): - country: Literal[ - "AD", - "AE", - "AR", - "AT", - "AU", - "BE", - "BG", - "BH", - "BO", - "BR", - "CA", - "CH", - "CL", - "CN", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "EE", - "DO", - "EC", - "EG", - "ES", - "EU", - "FI", - "FR", - "GB", - "GE", - "GR", - "HK", - "HR", - "HU", - "ID", - "IE", - "IL", - "IN", - "IS", - "IT", - "JP", - "KE", - "KR", - "KZ", - "LI", - "LT", - "LU", - "LV", - "MT", - "MX", - "MY", - "NG", - "NL", - "NO", - "NZ", - "OM", - "PE", - "PH", - "PL", - "PT", - "RO", - "RS", - "RU", - "SA", - "SE", - "SG", - "SI", - "SK", - "SV", - "TH", - "TR", - "TW", - "UA", - "US", - "UY", - "VE", - "VN", - "ZA", - ] - - type: Literal[ - "ad_nrt", - "ae_trn", - "ar_cuit", - "eu_vat", - "au_abn", - "au_arn", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "gb_vat", - "ge_vat", - "hk_br", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kr_brn", - "kz_bin", - "li_uid", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sv_nit", - "th_vat", - "tr_tin", - "tw_vat", - "ua_vat", - "us_ein", - "uy_ruc", - "ve_rif", - "vn_tin", - "za_vat", - ] - - value: str diff --git a/src/orb/types/shared/dimensional_price_configuration_model.py b/src/orb/types/shared/dimensional_price_configuration_model.py deleted file mode 100644 index a59ca8e5..00000000 --- a/src/orb/types/shared/dimensional_price_configuration_model.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel - -__all__ = ["DimensionalPriceConfigurationModel"] - - -class DimensionalPriceConfigurationModel(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str diff --git a/src/orb/types/shared/discount_model.py b/src/orb/types/shared/discount_model.py deleted file mode 100644 index 8f7c825b..00000000 --- a/src/orb/types/shared/discount_model.py +++ /dev/null @@ -1,35 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias - -from ..._utils import PropertyInfo -from ..._models import BaseModel -from .trial_discount import TrialDiscount -from .amount_discount import AmountDiscount -from .percentage_discount import PercentageDiscount - -__all__ = ["DiscountModel", "UsageDiscount"] - - -class UsageDiscount(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this discount applies to. - - For plan/plan phase discounts, this can be a subset of prices. - """ - - discount_type: Literal["usage"] - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - reason: Optional[str] = None - - -DiscountModel: TypeAlias = Annotated[ - Union[PercentageDiscount, TrialDiscount, UsageDiscount, AmountDiscount], PropertyInfo(discriminator="discount_type") -] diff --git a/src/orb/types/shared/discount_override_model.py b/src/orb/types/shared/discount_override_model.py deleted file mode 100644 index 39134976..00000000 --- a/src/orb/types/shared/discount_override_model.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["DiscountOverrideModel"] - - -class DiscountOverrideModel(BaseModel): - discount_type: Literal["percentage", "usage", "amount"] - - amount_discount: Optional[str] = None - """Only available if discount_type is `amount`.""" - - percentage_discount: Optional[float] = None - """Only available if discount_type is `percentage`. - - This is a number between 0 and 1. - """ - - usage_discount: Optional[float] = None - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ diff --git a/src/orb/types/shared/edit_customer_model.py b/src/orb/types/shared/edit_customer_model.py deleted file mode 100644 index 82943be8..00000000 --- a/src/orb/types/shared/edit_customer_model.py +++ /dev/null @@ -1,196 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Optional -from typing_extensions import Literal - -from ..._models import BaseModel -from .address_input_model import AddressInputModel -from .customer_tax_id_model import CustomerTaxIDModel -from .new_tax_configuration_model import NewTaxConfigurationModel -from .customer_hierarchy_config_model import CustomerHierarchyConfigModel -from .new_reporting_configuration_model import NewReportingConfigurationModel -from .new_accounting_sync_configuration_model import NewAccountingSyncConfigurationModel - -__all__ = ["EditCustomerModel"] - - -class EditCustomerModel(BaseModel): - accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] = None - - additional_emails: Optional[List[str]] = None - """Additional email addresses for this customer. - - If populated, these email addresses will be CC'd for customer communications. - """ - - auto_collection: Optional[bool] = None - """ - Used to determine if invoices for this customer will automatically attempt to - charge a saved payment method, if available. This parameter defaults to `True` - when a payment provider is provided on customer creation. - """ - - billing_address: Optional[AddressInputModel] = None - - currency: Optional[str] = None - """An ISO 4217 currency string used for the customer's invoices and balance. - - If not set at creation time, will be set at subscription creation time. - """ - - email: Optional[str] = None - """A valid customer email, to be used for invoicing and notifications.""" - - email_delivery: Optional[bool] = None - - external_customer_id: Optional[str] = None - """The external customer ID. - - This can only be set if empty and the customer has no past or current - subscriptions. - """ - - hierarchy: Optional[CustomerHierarchyConfigModel] = None - """The hierarchical relationships for this customer.""" - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - name: Optional[str] = None - """The full name of the customer""" - - payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] = None - """This is used for creating charges or invoices in an external system via Orb. - - When not in test mode: - - - the connection must first be configured in the Orb webapp. - - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, - `bill.com`, `netsuite`), any product mappings must first be configured with - the Orb team. - """ - - payment_provider_id: Optional[str] = None - """The ID of this customer in an external payments solution, such as Stripe. - - This is used for creating charges or invoices in the external system via Orb. - """ - - reporting_configuration: Optional[NewReportingConfigurationModel] = None - - shipping_address: Optional[AddressInputModel] = None - - tax_configuration: Optional[NewTaxConfigurationModel] = None - - tax_id: Optional[CustomerTaxIDModel] = None - """ - Tax IDs are commonly required to be displayed on customer invoices, which are - added to the headers of invoices. - - ### Supported Tax ID Countries and Types - - | Country | Type | Description | - | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | - | Andorra | `ad_nrt` | Andorran NRT Number | - | Argentina | `ar_cuit` | Argentinian Tax ID Number | - | Australia | `au_abn` | Australian Business Number (AU ABN) | - | Australia | `au_arn` | Australian Taxation Office Reference Number | - | Austria | `eu_vat` | European VAT Number | - | Bahrain | `bh_vat` | Bahraini VAT Number | - | Belgium | `eu_vat` | European VAT Number | - | Bolivia | `bo_tin` | Bolivian Tax ID | - | Brazil | `br_cnpj` | Brazilian CNPJ Number | - | Brazil | `br_cpf` | Brazilian CPF Number | - | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | - | Bulgaria | `eu_vat` | European VAT Number | - | Canada | `ca_bn` | Canadian BN | - | Canada | `ca_gst_hst` | Canadian GST/HST Number | - | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | - | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | - | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | - | Canada | `ca_qst` | Canadian QST Number (Québec) | - | Chile | `cl_tin` | Chilean TIN | - | China | `cn_tin` | Chinese Tax ID | - | Colombia | `co_nit` | Colombian NIT Number | - | Costa Rica | `cr_tin` | Costa Rican Tax ID | - | Croatia | `eu_vat` | European VAT Number | - | Cyprus | `eu_vat` | European VAT Number | - | Czech Republic | `eu_vat` | European VAT Number | - | Denmark | `eu_vat` | European VAT Number | - | Dominican Republic | `do_rcn` | Dominican RCN Number | - | Ecuador | `ec_ruc` | Ecuadorian RUC Number | - | Egypt | `eg_tin` | Egyptian Tax Identification Number | - | El Salvador | `sv_nit` | El Salvadorian NIT Number | - | Estonia | `eu_vat` | European VAT Number | - | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | - | Finland | `eu_vat` | European VAT Number | - | France | `eu_vat` | European VAT Number | - | Georgia | `ge_vat` | Georgian VAT | - | Germany | `eu_vat` | European VAT Number | - | Greece | `eu_vat` | European VAT Number | - | Hong Kong | `hk_br` | Hong Kong BR Number | - | Hungary | `eu_vat` | European VAT Number | - | Hungary | `hu_tin` | Hungary Tax Number (adószám) | - | Iceland | `is_vat` | Icelandic VAT | - | India | `in_gst` | Indian GST Number | - | Indonesia | `id_npwp` | Indonesian NPWP Number | - | Ireland | `eu_vat` | European VAT Number | - | Israel | `il_vat` | Israel VAT | - | Italy | `eu_vat` | European VAT Number | - | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | - | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | - | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | - | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | - | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | - | Latvia | `eu_vat` | European VAT Number | - | Liechtenstein | `li_uid` | Liechtensteinian UID Number | - | Lithuania | `eu_vat` | European VAT Number | - | Luxembourg | `eu_vat` | European VAT Number | - | Malaysia | `my_frp` | Malaysian FRP Number | - | Malaysia | `my_itn` | Malaysian ITN | - | Malaysia | `my_sst` | Malaysian SST Number | - | Malta | `eu_vat ` | European VAT Number | - | Mexico | `mx_rfc` | Mexican RFC Number | - | Netherlands | `eu_vat` | European VAT Number | - | New Zealand | `nz_gst` | New Zealand GST Number | - | Nigeria | `ng_tin` | Nigerian Tax Identification Number | - | Norway | `no_vat` | Norwegian VAT Number | - | Norway | `no_voec` | Norwegian VAT on e-commerce Number | - | Oman | `om_vat` | Omani VAT Number | - | Peru | `pe_ruc` | Peruvian RUC Number | - | Philippines | `ph_tin ` | Philippines Tax Identification Number | - | Poland | `eu_vat` | European VAT Number | - | Portugal | `eu_vat` | European VAT Number | - | Romania | `eu_vat` | European VAT Number | - | Romania | `ro_tin` | Romanian Tax ID Number | - | Russia | `ru_inn` | Russian INN | - | Russia | `ru_kpp` | Russian KPP | - | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | - | Serbia | `rs_pib` | Serbian PIB Number | - | Singapore | `sg_gst` | Singaporean GST | - | Singapore | `sg_uen` | Singaporean UEN | - | Slovakia | `eu_vat` | European VAT Number | - | Slovenia | `eu_vat` | European VAT Number | - | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | - | South Africa | `za_vat` | South African VAT Number | - | South Korea | `kr_brn` | Korean BRN | - | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | - | Spain | `eu_vat` | European VAT Number | - | Sweden | `eu_vat` | European VAT Number | - | Switzerland | `ch_vat` | Switzerland VAT Number | - | Taiwan | `tw_vat` | Taiwanese VAT | - | Thailand | `th_vat` | Thai VAT | - | Turkey | `tr_tin` | Turkish Tax Identification Number | - | Ukraine | `ua_vat` | Ukrainian VAT | - | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | - | United Kingdom | `eu_vat` | Northern Ireland VAT Number | - | United Kingdom | `gb_vat` | United Kingdom VAT Number | - | United States | `us_ein` | United States EIN | - | Uruguay | `uy_ruc` | Uruguayan RUC Number | - | Venezuela | `ve_rif` | Venezuelan RIF Number | - | Vietnam | `vn_tin` | Vietnamese Tax ID Number | - """ diff --git a/src/orb/types/shared/edit_plan_model.py b/src/orb/types/shared/edit_plan_model.py deleted file mode 100644 index 427050f9..00000000 --- a/src/orb/types/shared/edit_plan_model.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Optional - -from ..._models import BaseModel - -__all__ = ["EditPlanModel"] - - -class EditPlanModel(BaseModel): - external_plan_id: Optional[str] = None - """ - An optional user-defined ID for this plan resource, used throughout the system - as an alias for this Plan. Use this field to identify a plan by an existing - identifier in your system. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ diff --git a/src/orb/types/shared/fixed_fee_quantity_schedule_entry_model.py b/src/orb/types/shared/fixed_fee_quantity_schedule_entry_model.py deleted file mode 100644 index 5e428650..00000000 --- a/src/orb/types/shared/fixed_fee_quantity_schedule_entry_model.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["FixedFeeQuantityScheduleEntryModel"] - - -class FixedFeeQuantityScheduleEntryModel(BaseModel): - end_date: Optional[datetime] = None - - price_id: str - - quantity: float - - start_date: datetime diff --git a/src/orb/types/shared/invoice_level_discount_model.py b/src/orb/types/shared/invoice_level_discount_model.py deleted file mode 100644 index c8b3dc02..00000000 --- a/src/orb/types/shared/invoice_level_discount_model.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union -from typing_extensions import Annotated, TypeAlias - -from ..._utils import PropertyInfo -from .trial_discount import TrialDiscount -from .amount_discount import AmountDiscount -from .percentage_discount import PercentageDiscount - -__all__ = ["InvoiceLevelDiscountModel"] - -InvoiceLevelDiscountModel: TypeAlias = Annotated[ - Union[PercentageDiscount, AmountDiscount, TrialDiscount], PropertyInfo(discriminator="discount_type") -] diff --git a/src/orb/types/shared/item_external_connection_model.py b/src/orb/types/shared/item_external_connection_model.py deleted file mode 100644 index 4442e728..00000000 --- a/src/orb/types/shared/item_external_connection_model.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["ItemExternalConnectionModel"] - - -class ItemExternalConnectionModel(BaseModel): - external_connection_name: Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok"] - - external_entity_id: str diff --git a/src/orb/types/shared/item_model.py b/src/orb/types/shared/item_model.py deleted file mode 100644 index 0217bdc5..00000000 --- a/src/orb/types/shared/item_model.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from datetime import datetime - -from ..._models import BaseModel -from .item_external_connection_model import ItemExternalConnectionModel - -__all__ = ["ItemModel"] - - -class ItemModel(BaseModel): - id: str - - created_at: datetime - - external_connections: List[ItemExternalConnectionModel] - - name: str diff --git a/src/orb/types/shared/item_slim_model.py b/src/orb/types/shared/item_slim_model.py deleted file mode 100644 index d90a820a..00000000 --- a/src/orb/types/shared/item_slim_model.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["ItemSlimModel"] - - -class ItemSlimModel(BaseModel): - id: str - - name: str diff --git a/src/orb/types/shared/matrix_config_model.py b/src/orb/types/shared/matrix_config_model.py deleted file mode 100644 index a6427b7d..00000000 --- a/src/orb/types/shared/matrix_config_model.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel -from .matrix_value_model import MatrixValueModel - -__all__ = ["MatrixConfigModel"] - - -class MatrixConfigModel(BaseModel): - default_unit_amount: str - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: List[Optional[str]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: List[MatrixValueModel] - """Matrix values for specified matrix grouping keys""" diff --git a/src/orb/types/shared/matrix_value_model.py b/src/orb/types/shared/matrix_value_model.py deleted file mode 100644 index a078eff2..00000000 --- a/src/orb/types/shared/matrix_value_model.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["MatrixValueModel"] - - -class MatrixValueModel(BaseModel): - dimension_values: List[Optional[str]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: str - """Unit price for the specified dimension_values""" diff --git a/src/orb/types/shared/matrix_with_allocation_config_model.py b/src/orb/types/shared/matrix_with_allocation_config_model.py deleted file mode 100644 index c0bf222c..00000000 --- a/src/orb/types/shared/matrix_with_allocation_config_model.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel -from .matrix_value_model import MatrixValueModel - -__all__ = ["MatrixWithAllocationConfigModel"] - - -class MatrixWithAllocationConfigModel(BaseModel): - allocation: float - """Allocation to be used to calculate the price""" - - default_unit_amount: str - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: List[Optional[str]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: List[MatrixValueModel] - """Matrix values for specified matrix grouping keys""" diff --git a/src/orb/types/shared/maximum_interval_model.py b/src/orb/types/shared/maximum_interval_model.py deleted file mode 100644 index 4150b560..00000000 --- a/src/orb/types/shared/maximum_interval_model.py +++ /dev/null @@ -1,28 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["MaximumIntervalModel"] - - -class MaximumIntervalModel(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this maximum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this maximum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the maximum interval.""" - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the price intervals - this transform applies to. - """ - - start_date: datetime - """The start date of the maximum interval.""" diff --git a/src/orb/types/shared/maximum_model.py b/src/orb/types/shared/maximum_model.py deleted file mode 100644 index 069469a7..00000000 --- a/src/orb/types/shared/maximum_model.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel - -__all__ = ["MaximumModel"] - - -class MaximumModel(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" diff --git a/src/orb/types/shared/minimum_interval_model.py b/src/orb/types/shared/minimum_interval_model.py deleted file mode 100644 index e4a028f3..00000000 --- a/src/orb/types/shared/minimum_interval_model.py +++ /dev/null @@ -1,28 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["MinimumIntervalModel"] - - -class MinimumIntervalModel(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this minimum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this minimum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the minimum interval.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the price intervals - this minimum applies to. - """ - - start_date: datetime - """The start date of the minimum interval.""" diff --git a/src/orb/types/shared/minimum_model.py b/src/orb/types/shared/minimum_model.py deleted file mode 100644 index f7da0277..00000000 --- a/src/orb/types/shared/minimum_model.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel - -__all__ = ["MinimumModel"] - - -class MinimumModel(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" diff --git a/src/orb/types/shared/mutated_subscription_model.py b/src/orb/types/shared/mutated_subscription_model.py deleted file mode 100644 index 116202fb..00000000 --- a/src/orb/types/shared/mutated_subscription_model.py +++ /dev/null @@ -1,154 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from ..._utils import PropertyInfo -from ..._models import BaseModel -from .plan_model import PlanModel -from .customer_model import CustomerModel -from .price_interval_model import PriceIntervalModel -from .maximum_interval_model import MaximumIntervalModel -from .minimum_interval_model import MinimumIntervalModel -from .coupon_redemption_model import CouponRedemptionModel -from .adjustment_interval_model import AdjustmentIntervalModel -from .subscription_trial_info_model import SubscriptionTrialInfoModel -from .usage_discount_interval_model import UsageDiscountIntervalModel -from .amount_discount_interval_model import AmountDiscountIntervalModel -from .percentage_discount_interval_model import PercentageDiscountIntervalModel -from .fixed_fee_quantity_schedule_entry_model import FixedFeeQuantityScheduleEntryModel -from .billing_cycle_anchor_configuration_model import BillingCycleAnchorConfigurationModel - -__all__ = ["MutatedSubscriptionModel", "DiscountInterval"] - -DiscountInterval: TypeAlias = Annotated[ - Union[AmountDiscountIntervalModel, PercentageDiscountIntervalModel, UsageDiscountIntervalModel], - PropertyInfo(discriminator="discount_type"), -] - - -class MutatedSubscriptionModel(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentIntervalModel] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfigurationModel - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: CustomerModel - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantityScheduleEntryModel] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumIntervalModel] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumIntervalModel] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: PlanModel - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceIntervalModel] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[CouponRedemptionModel] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: SubscriptionTrialInfoModel diff --git a/src/orb/types/shared/new_accounting_sync_configuration_model.py b/src/orb/types/shared/new_accounting_sync_configuration_model.py deleted file mode 100644 index 88ff8064..00000000 --- a/src/orb/types/shared/new_accounting_sync_configuration_model.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["NewAccountingSyncConfigurationModel", "AccountingProvider"] - - -class AccountingProvider(BaseModel): - external_provider_id: str - - provider_type: str - - -class NewAccountingSyncConfigurationModel(BaseModel): - accounting_providers: Optional[List[AccountingProvider]] = None - - excluded: Optional[bool] = None diff --git a/src/orb/types/shared/new_adjustment_model.py b/src/orb/types/shared/new_adjustment_model.py deleted file mode 100644 index f4ccba00..00000000 --- a/src/orb/types/shared/new_adjustment_model.py +++ /dev/null @@ -1,100 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias - -from ..._utils import PropertyInfo -from ..._models import BaseModel - -__all__ = [ - "NewAdjustmentModel", - "NewPercentageDiscount", - "NewUsageDiscount", - "NewAmountDiscount", - "NewMinimum", - "NewMaximum", -] - - -class NewPercentageDiscount(BaseModel): - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - percentage_discount: float - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class NewUsageDiscount(BaseModel): - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - usage_discount: float - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class NewAmountDiscount(BaseModel): - adjustment_type: Literal["amount_discount"] - - amount_discount: str - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class NewMinimum(BaseModel): - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class NewMaximum(BaseModel): - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - maximum_amount: str - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -NewAdjustmentModel: TypeAlias = Annotated[ - Union[NewPercentageDiscount, NewUsageDiscount, NewAmountDiscount, NewMinimum, NewMaximum], - PropertyInfo(discriminator="adjustment_type"), -] diff --git a/src/orb/types/shared/new_allocation_price_model.py b/src/orb/types/shared/new_allocation_price_model.py deleted file mode 100644 index af592c7d..00000000 --- a/src/orb/types/shared/new_allocation_price_model.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["NewAllocationPriceModel"] - - -class NewAllocationPriceModel(BaseModel): - amount: str - """An amount of the currency to allocate to the customer at the specified cadence.""" - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - """The cadence at which to allocate the amount to the customer.""" - - currency: str - """ - An ISO 4217 currency string or a custom pricing unit identifier in which to bill - this price. - """ - - expires_at_end_of_cadence: bool - """ - Whether the allocated amount should expire at the end of the cadence or roll - over to the next period. - """ diff --git a/src/orb/types/shared/new_billing_cycle_configuration_model.py b/src/orb/types/shared/new_billing_cycle_configuration_model.py deleted file mode 100644 index 89a72754..00000000 --- a/src/orb/types/shared/new_billing_cycle_configuration_model.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["NewBillingCycleConfigurationModel"] - - -class NewBillingCycleConfigurationModel(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" diff --git a/src/orb/types/shared/new_floating_price_model.py b/src/orb/types/shared/new_floating_price_model.py deleted file mode 100644 index c45cbc40..00000000 --- a/src/orb/types/shared/new_floating_price_model.py +++ /dev/null @@ -1,1879 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias - -from pydantic import Field as FieldInfo - -from ..._utils import PropertyInfo -from ..._models import BaseModel -from .bps_config_model import BpsConfigModel -from .bulk_config_model import BulkConfigModel -from .unit_config_model import UnitConfigModel -from .matrix_config_model import MatrixConfigModel -from .tiered_config_model import TieredConfigModel -from .package_config_model import PackageConfigModel -from .bulk_bps_config_model import BulkBpsConfigModel -from .tiered_bps_config_model import TieredBpsConfigModel -from .custom_rating_function_config_model import CustomRatingFunctionConfigModel -from .matrix_with_allocation_config_model import MatrixWithAllocationConfigModel -from .new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel - -__all__ = [ - "NewFloatingPriceModel", - "NewFloatingUnitPrice", - "NewFloatingPackagePrice", - "NewFloatingMatrixPrice", - "NewFloatingMatrixWithAllocationPrice", - "NewFloatingTieredPrice", - "NewFloatingTieredBpsPrice", - "NewFloatingBpsPrice", - "NewFloatingBulkBpsPrice", - "NewFloatingBulkPrice", - "NewFloatingThresholdTotalAmountPrice", - "NewFloatingTieredPackagePrice", - "NewFloatingGroupedTieredPrice", - "NewFloatingMaxGroupTieredPackagePrice", - "NewFloatingTieredWithMinimumPrice", - "NewFloatingPackageWithAllocationPrice", - "NewFloatingTieredPackageWithMinimumPrice", - "NewFloatingUnitWithPercentPrice", - "NewFloatingTieredWithProrationPrice", - "NewFloatingUnitWithProrationPrice", - "NewFloatingGroupedAllocationPrice", - "NewFloatingGroupedWithProratedMinimumPrice", - "NewFloatingGroupedWithMeteredMinimumPrice", - "NewFloatingMatrixWithDisplayNamePrice", - "NewFloatingBulkWithProrationPrice", - "NewFloatingGroupedTieredPackagePrice", - "NewFloatingScalableMatrixWithUnitPricingPrice", - "NewFloatingScalableMatrixWithTieredPricingPrice", - "NewFloatingCumulativeGroupedBulkPrice", -] - - -class NewFloatingUnitPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["unit"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - unit_config: UnitConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - package_config: PackageConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingMatrixPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - matrix_config: MatrixConfigModel - - price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingMatrixWithAllocationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - matrix_with_allocation_config: MatrixWithAllocationConfigModel - - price_model_type: Literal["matrix_with_allocation"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingTieredPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_config: TieredConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingTieredBpsPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_bps_config: TieredBpsConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingBpsPrice(BaseModel): - bps_config: BpsConfigModel - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bps"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingBulkBpsPrice(BaseModel): - bulk_bps_config: BulkBpsConfigModel - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingBulkPrice(BaseModel): - bulk_config: BulkConfigModel - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingThresholdTotalAmountPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - threshold_total_amount_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingTieredPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_package_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingGroupedTieredPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_tiered_config: CustomRatingFunctionConfigModel - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_tiered"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingMaxGroupTieredPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - max_group_tiered_package_config: CustomRatingFunctionConfigModel - - price_model_type: Literal["max_group_tiered_package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingTieredWithMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_with_minimum_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingPackageWithAllocationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - package_with_allocation_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingTieredPackageWithMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_package_with_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_package_with_minimum_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingUnitWithPercentPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["unit_with_percent"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - unit_with_percent_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingTieredWithProrationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_with_proration"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_with_proration_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingUnitWithProrationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["unit_with_proration"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - unit_with_proration_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingGroupedAllocationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_allocation_config: CustomRatingFunctionConfigModel - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingGroupedWithProratedMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_with_prorated_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingGroupedWithMeteredMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_with_metered_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingMatrixWithDisplayNamePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - matrix_with_display_name_config: CustomRatingFunctionConfigModel - - price_model_type: Literal["matrix_with_display_name"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingBulkWithProrationPrice(BaseModel): - bulk_with_proration_config: CustomRatingFunctionConfigModel - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bulk_with_proration"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingGroupedTieredPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_tiered_package_config: CustomRatingFunctionConfigModel - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_tiered_package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingScalableMatrixWithUnitPricingPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingScalableMatrixWithTieredPricingPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingCumulativeGroupedBulkPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel - - currency: str - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["cumulative_grouped_bulk"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -NewFloatingPriceModel: TypeAlias = Annotated[ - Union[ - NewFloatingUnitPrice, - NewFloatingPackagePrice, - NewFloatingMatrixPrice, - NewFloatingMatrixWithAllocationPrice, - NewFloatingTieredPrice, - NewFloatingTieredBpsPrice, - NewFloatingBpsPrice, - NewFloatingBulkBpsPrice, - NewFloatingBulkPrice, - NewFloatingThresholdTotalAmountPrice, - NewFloatingTieredPackagePrice, - NewFloatingGroupedTieredPrice, - NewFloatingMaxGroupTieredPackagePrice, - NewFloatingTieredWithMinimumPrice, - NewFloatingPackageWithAllocationPrice, - NewFloatingTieredPackageWithMinimumPrice, - NewFloatingUnitWithPercentPrice, - NewFloatingTieredWithProrationPrice, - NewFloatingUnitWithProrationPrice, - NewFloatingGroupedAllocationPrice, - NewFloatingGroupedWithProratedMinimumPrice, - NewFloatingGroupedWithMeteredMinimumPrice, - NewFloatingMatrixWithDisplayNamePrice, - NewFloatingBulkWithProrationPrice, - NewFloatingGroupedTieredPackagePrice, - NewFloatingScalableMatrixWithUnitPricingPrice, - NewFloatingScalableMatrixWithTieredPricingPrice, - NewFloatingCumulativeGroupedBulkPrice, - ], - PropertyInfo(discriminator="price_model_type"), -] diff --git a/src/orb/types/shared/new_reporting_configuration_model.py b/src/orb/types/shared/new_reporting_configuration_model.py deleted file mode 100644 index b634ce6d..00000000 --- a/src/orb/types/shared/new_reporting_configuration_model.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["NewReportingConfigurationModel"] - - -class NewReportingConfigurationModel(BaseModel): - exempt: bool diff --git a/src/orb/types/shared/new_subscription_price_model.py b/src/orb/types/shared/new_subscription_price_model.py deleted file mode 100644 index 00937099..00000000 --- a/src/orb/types/shared/new_subscription_price_model.py +++ /dev/null @@ -1,1905 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias - -from pydantic import Field as FieldInfo - -from ..._utils import PropertyInfo -from ..._models import BaseModel -from .bps_config_model import BpsConfigModel -from .bulk_config_model import BulkConfigModel -from .unit_config_model import UnitConfigModel -from .matrix_config_model import MatrixConfigModel -from .tiered_config_model import TieredConfigModel -from .package_config_model import PackageConfigModel -from .bulk_bps_config_model import BulkBpsConfigModel -from .tiered_bps_config_model import TieredBpsConfigModel -from .custom_rating_function_config_model import CustomRatingFunctionConfigModel -from .new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel - -__all__ = [ - "NewSubscriptionPriceModel", - "NewSubscriptionUnitPrice", - "NewSubscriptionPackagePrice", - "NewSubscriptionMatrixPrice", - "NewSubscriptionTieredPrice", - "NewSubscriptionTieredBpsPrice", - "NewSubscriptionBpsPrice", - "NewSubscriptionBulkBpsPrice", - "NewSubscriptionBulkPrice", - "NewSubscriptionThresholdTotalAmountPrice", - "NewSubscriptionTieredPackagePrice", - "NewSubscriptionTieredWithMinimumPrice", - "NewSubscriptionUnitWithPercentPrice", - "NewSubscriptionPackageWithAllocationPrice", - "NewSubscriptionTierWithProrationPrice", - "NewSubscriptionUnitWithProrationPrice", - "NewSubscriptionGroupedAllocationPrice", - "NewSubscriptionGroupedWithProratedMinimumPrice", - "NewSubscriptionBulkWithProrationPrice", - "NewSubscriptionScalableMatrixWithUnitPricingPrice", - "NewSubscriptionScalableMatrixWithTieredPricingPrice", - "NewSubscriptionCumulativeGroupedBulkPrice", - "NewSubscriptionMaxGroupTieredPackagePrice", - "NewSubscriptionGroupedWithMeteredMinimumPrice", - "NewSubscriptionMatrixWithDisplayNamePrice", - "NewSubscriptionGroupedTieredPackagePrice", -] - - -class NewSubscriptionUnitPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["unit"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - unit_config: UnitConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - package_config: PackageConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionMatrixPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - matrix_config: MatrixConfigModel - - price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionTieredPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_config: TieredConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionTieredBpsPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_bps_config: TieredBpsConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionBpsPrice(BaseModel): - bps_config: BpsConfigModel - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bps"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionBulkBpsPrice(BaseModel): - bulk_bps_config: BulkBpsConfigModel - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionBulkPrice(BaseModel): - bulk_config: BulkConfigModel - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionThresholdTotalAmountPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - threshold_total_amount_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionTieredPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_package_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionTieredWithMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_with_minimum_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionUnitWithPercentPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["unit_with_percent"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - unit_with_percent_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionPackageWithAllocationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - package_with_allocation_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionTierWithProrationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_with_proration"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_with_proration_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionUnitWithProrationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["unit_with_proration"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - unit_with_proration_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionGroupedAllocationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - grouped_allocation_config: CustomRatingFunctionConfigModel - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionGroupedWithProratedMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_with_prorated_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionBulkWithProrationPrice(BaseModel): - bulk_with_proration_config: CustomRatingFunctionConfigModel - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bulk_with_proration"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionScalableMatrixWithUnitPricingPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionScalableMatrixWithTieredPricingPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionCumulativeGroupedBulkPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["cumulative_grouped_bulk"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionMaxGroupTieredPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - max_group_tiered_package_config: CustomRatingFunctionConfigModel - - price_model_type: Literal["max_group_tiered_package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionGroupedWithMeteredMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_with_metered_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionMatrixWithDisplayNamePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - matrix_with_display_name_config: CustomRatingFunctionConfigModel - - price_model_type: Literal["matrix_with_display_name"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionGroupedTieredPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - grouped_tiered_package_config: CustomRatingFunctionConfigModel - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_tiered_package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -NewSubscriptionPriceModel: TypeAlias = Annotated[ - Union[ - NewSubscriptionUnitPrice, - NewSubscriptionPackagePrice, - NewSubscriptionMatrixPrice, - NewSubscriptionTieredPrice, - NewSubscriptionTieredBpsPrice, - NewSubscriptionBpsPrice, - NewSubscriptionBulkBpsPrice, - NewSubscriptionBulkPrice, - NewSubscriptionThresholdTotalAmountPrice, - NewSubscriptionTieredPackagePrice, - NewSubscriptionTieredWithMinimumPrice, - NewSubscriptionUnitWithPercentPrice, - NewSubscriptionPackageWithAllocationPrice, - NewSubscriptionTierWithProrationPrice, - NewSubscriptionUnitWithProrationPrice, - NewSubscriptionGroupedAllocationPrice, - NewSubscriptionGroupedWithProratedMinimumPrice, - NewSubscriptionBulkWithProrationPrice, - NewSubscriptionScalableMatrixWithUnitPricingPrice, - NewSubscriptionScalableMatrixWithTieredPricingPrice, - NewSubscriptionCumulativeGroupedBulkPrice, - NewSubscriptionMaxGroupTieredPackagePrice, - NewSubscriptionGroupedWithMeteredMinimumPrice, - NewSubscriptionMatrixWithDisplayNamePrice, - NewSubscriptionGroupedTieredPackagePrice, - ], - PropertyInfo(discriminator="price_model_type"), -] diff --git a/src/orb/types/shared/new_tax_configuration_model.py b/src/orb/types/shared/new_tax_configuration_model.py deleted file mode 100644 index 9f78d007..00000000 --- a/src/orb/types/shared/new_tax_configuration_model.py +++ /dev/null @@ -1,28 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias - -from ..._utils import PropertyInfo -from ..._models import BaseModel - -__all__ = ["NewTaxConfigurationModel", "NewAvalaraTaxConfiguration", "NewTaxJarConfiguration"] - - -class NewAvalaraTaxConfiguration(BaseModel): - tax_exempt: bool - - tax_provider: Literal["avalara"] - - tax_exemption_code: Optional[str] = None - - -class NewTaxJarConfiguration(BaseModel): - tax_exempt: bool - - tax_provider: Literal["taxjar"] - - -NewTaxConfigurationModel: TypeAlias = Annotated[ - Union[NewAvalaraTaxConfiguration, NewTaxJarConfiguration], PropertyInfo(discriminator="tax_provider") -] diff --git a/src/orb/types/shared/package_config_model.py b/src/orb/types/shared/package_config_model.py deleted file mode 100644 index 1c9458a9..00000000 --- a/src/orb/types/shared/package_config_model.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["PackageConfigModel"] - - -class PackageConfigModel(BaseModel): - package_amount: str - """A currency amount to rate usage by""" - - package_size: int - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ diff --git a/src/orb/types/shared/pagination_metadata_model.py b/src/orb/types/shared/pagination_metadata_model.py deleted file mode 100644 index 9926cab6..00000000 --- a/src/orb/types/shared/pagination_metadata_model.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["PaginationMetadataModel"] - - -class PaginationMetadataModel(BaseModel): - has_more: bool - - next_cursor: Optional[str] = None diff --git a/src/orb/types/shared/payment_attempt_model.py b/src/orb/types/shared/payment_attempt_model.py deleted file mode 100644 index a0780fa6..00000000 --- a/src/orb/types/shared/payment_attempt_model.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["PaymentAttemptModel"] - - -class PaymentAttemptModel(BaseModel): - id: str - """The ID of the payment attempt.""" - - amount: str - """The amount of the payment attempt.""" - - created_at: datetime - """The time at which the payment attempt was created.""" - - payment_provider: Optional[Literal["stripe"]] = None - """The payment provider that attempted to collect the payment.""" - - payment_provider_id: Optional[str] = None - """The ID of the payment attempt in the payment provider.""" - - succeeded: bool - """Whether the payment attempt succeeded.""" diff --git a/src/orb/types/shared/percentage_discount_interval_model.py b/src/orb/types/shared/percentage_discount_interval_model.py deleted file mode 100644 index 09fd4432..00000000 --- a/src/orb/types/shared/percentage_discount_interval_model.py +++ /dev/null @@ -1,31 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["PercentageDiscountIntervalModel"] - - -class PercentageDiscountIntervalModel(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["percentage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - percentage_discount: float - """ - Only available if discount_type is `percentage`.This is a number between 0 - and 1. - """ - - start_date: datetime - """The start date of the discount interval.""" diff --git a/src/orb/types/shared/percentage_discount_model.py b/src/orb/types/shared/percentage_discount_model.py deleted file mode 100644 index 447dad69..00000000 --- a/src/orb/types/shared/percentage_discount_model.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["PercentageDiscountModel"] - - -class PercentageDiscountModel(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this discount applies to. - - For plan/plan phase discounts, this can be a subset of prices. - """ - - discount_type: Literal["percentage"] - - percentage_discount: float - """Only available if discount_type is `percentage`. - - This is a number between 0 and 1. - """ - - reason: Optional[str] = None diff --git a/src/orb/types/shared/plan_minified_model.py b/src/orb/types/shared/plan_minified_model.py deleted file mode 100644 index 1171d4dc..00000000 --- a/src/orb/types/shared/plan_minified_model.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["PlanMinifiedModel"] - - -class PlanMinifiedModel(BaseModel): - id: Optional[str] = None - - external_plan_id: Optional[str] = None - """ - An optional user-defined ID for this plan resource, used throughout the system - as an alias for this Plan. Use this field to identify a plan by an existing - identifier in your system. - """ - - name: Optional[str] = None diff --git a/src/orb/types/shared/plan_model.py b/src/orb/types/shared/plan_model.py deleted file mode 100644 index 0f5ac971..00000000 --- a/src/orb/types/shared/plan_model.py +++ /dev/null @@ -1,150 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Optional -from datetime import datetime -from typing_extensions import Literal - -from .discount import Discount -from ..._models import BaseModel -from .price_model import PriceModel -from .maximum_model import MaximumModel -from .minimum_model import MinimumModel -from .adjustment_model import AdjustmentModel -from .plan_minified_model import PlanMinifiedModel - -__all__ = ["PlanModel", "PlanPhase", "Product", "TrialConfig"] - - -class PlanPhase(BaseModel): - id: str - - description: Optional[str] = None - - discount: Optional[Discount] = None - - duration: Optional[int] = None - """How many terms of length `duration_unit` this phase is active for. - - If null, this phase is evergreen and active indefinitely - """ - - duration_unit: Optional[Literal["daily", "monthly", "quarterly", "semi_annual", "annual"]] = None - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - name: str - - order: int - """Determines the ordering of the phase in a plan's lifecycle. 1 = first phase.""" - - -class Product(BaseModel): - id: str - - created_at: datetime - - name: str - - -class TrialConfig(BaseModel): - trial_period: Optional[int] = None - - trial_period_unit: Literal["days"] - - -class PlanModel(BaseModel): - id: str - - adjustments: List[AdjustmentModel] - """Adjustments for this plan. - - If the plan has phases, this includes adjustments across all phases of the plan. - """ - - base_plan: Optional[PlanMinifiedModel] = None - - base_plan_id: Optional[str] = None - """ - The parent plan id if the given plan was created by overriding one or more of - the parent's prices - """ - - created_at: datetime - - currency: str - """ - An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's - prices. - """ - - default_invoice_memo: Optional[str] = None - """ - The default memo text on the invoices corresponding to subscriptions on this - plan. Note that each subscription may configure its own memo. - """ - - description: str - - discount: Optional[Discount] = None - - external_plan_id: Optional[str] = None - """ - An optional user-defined ID for this plan resource, used throughout the system - as an alias for this Plan. Use this field to identify a plan by an existing - identifier in your system. - """ - - invoicing_currency: str - """An ISO 4217 currency string for which this plan is billed in. - - Matches `currency` unless `currency` is a custom pricing unit. - """ - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - name: str - - net_terms: Optional[int] = None - """Determines the difference between the invoice issue date and the due date. - - A value of "0" here signifies that invoices are due on issue, whereas a value of - "30" means that the customer has a month to pay the invoice before its overdue. - Note that individual subscriptions or invoices may set a different net terms - configuration. - """ - - plan_phases: Optional[List[PlanPhase]] = None - - prices: List[PriceModel] - """Prices for this plan. - - If the plan has phases, this includes prices across all phases of the plan. - """ - - product: Product - - status: Literal["active", "archived", "draft"] - - trial_config: TrialConfig - - version: int diff --git a/src/orb/types/shared/price_interval_fixed_fee_quantity_transition_model.py b/src/orb/types/shared/price_interval_fixed_fee_quantity_transition_model.py deleted file mode 100644 index 89bf7799..00000000 --- a/src/orb/types/shared/price_interval_fixed_fee_quantity_transition_model.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["PriceIntervalFixedFeeQuantityTransitionModel"] - - -class PriceIntervalFixedFeeQuantityTransitionModel(BaseModel): - effective_date: datetime - """The date that the fixed fee quantity transition should take effect.""" - - quantity: int - """The quantity of the fixed fee quantity transition.""" diff --git a/src/orb/types/shared/price_interval_model.py b/src/orb/types/shared/price_interval_model.py deleted file mode 100644 index 33be7053..00000000 --- a/src/orb/types/shared/price_interval_model.py +++ /dev/null @@ -1,80 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime - -from ..._models import BaseModel -from .price_model import PriceModel - -__all__ = ["PriceIntervalModel", "FixedFeeQuantityTransition"] - - -class FixedFeeQuantityTransition(BaseModel): - effective_date: datetime - - price_id: str - - quantity: int - - -class PriceIntervalModel(BaseModel): - id: str - - billing_cycle_day: int - """The day of the month that Orb bills for this price""" - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is exactly the - end of the billing period. Set to null if this price interval is not currently - active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if this price interval is not currently active. - """ - - end_date: Optional[datetime] = None - """The end date of the price interval. - - This is the date that Orb stops billing for this price. - """ - - filter: Optional[str] = None - """An additional filter to apply to usage queries.""" - - fixed_fee_quantity_transitions: Optional[List[FixedFeeQuantityTransition]] = None - """The fixed fee quantity transitions for this price interval. - - This is only relevant for fixed fees. - """ - - price: PriceModel - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - start_date: datetime - """The start date of the price interval. - - This is the date that Orb starts billing for this price. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer IDs whose usage events will be aggregated and billed under - this price interval. - """ diff --git a/src/orb/types/shared/price_model.py b/src/orb/types/shared/price_model.py deleted file mode 100644 index 53ae0f15..00000000 --- a/src/orb/types/shared/price_model.py +++ /dev/null @@ -1,1663 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from pydantic import Field as FieldInfo - -from ..._utils import PropertyInfo -from .discount import Discount -from ..._models import BaseModel -from .maximum_model import MaximumModel -from .minimum_model import MinimumModel -from .item_slim_model import ItemSlimModel -from .allocation_model import AllocationModel -from .bps_config_model import BpsConfigModel -from .bulk_config_model import BulkConfigModel -from .unit_config_model import UnitConfigModel -from .matrix_config_model import MatrixConfigModel -from .tiered_config_model import TieredConfigModel -from .package_config_model import PackageConfigModel -from .bulk_bps_config_model import BulkBpsConfigModel -from .tiered_bps_config_model import TieredBpsConfigModel -from .billable_metric_tiny_model import BillableMetricTinyModel -from .billing_cycle_configuration_model import BillingCycleConfigurationModel -from .custom_rating_function_config_model import CustomRatingFunctionConfigModel -from .matrix_with_allocation_config_model import MatrixWithAllocationConfigModel -from .dimensional_price_configuration_model import DimensionalPriceConfigurationModel - -__all__ = [ - "PriceModel", - "UnitPrice", - "PackagePrice", - "MatrixPrice", - "TieredPrice", - "TieredBpsPrice", - "BpsPrice", - "BulkBpsPrice", - "BulkPrice", - "ThresholdTotalAmountPrice", - "TieredPackagePrice", - "GroupedTieredPrice", - "TieredWithMinimumPrice", - "TieredPackageWithMinimumPrice", - "PackageWithAllocationPrice", - "UnitWithPercentPrice", - "MatrixWithAllocationPrice", - "TieredWithProrationPrice", - "UnitWithProrationPrice", - "GroupedAllocationPrice", - "GroupedWithProratedMinimumPrice", - "GroupedWithMeteredMinimumPrice", - "MatrixWithDisplayNamePrice", - "BulkWithProrationPrice", - "GroupedTieredPackagePrice", - "MaxGroupTieredPackagePrice", - "ScalableMatrixWithUnitPricingPrice", - "ScalableMatrixWithTieredPricingPrice", - "CumulativeGroupedBulkPrice", -] - - -class UnitPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["unit"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - unit_config: UnitConfigModel - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class PackagePrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["package"] = FieldInfo(alias="model_type") - - name: str - - package_config: PackageConfigModel - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class MatrixPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - matrix_config: MatrixConfigModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class TieredPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - tiered_config: TieredConfigModel - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class TieredBpsPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - tiered_bps_config: TieredBpsConfigModel - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class BpsPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - bps_config: BpsConfigModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["bps"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class BulkBpsPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - bulk_bps_config: BulkBpsConfigModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class BulkPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - bulk_config: BulkConfigModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class ThresholdTotalAmountPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - threshold_total_amount_config: CustomRatingFunctionConfigModel - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class TieredPackagePrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - tiered_package_config: CustomRatingFunctionConfigModel - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class GroupedTieredPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - grouped_tiered_config: CustomRatingFunctionConfigModel - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["grouped_tiered"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class TieredWithMinimumPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - tiered_with_minimum_config: CustomRatingFunctionConfigModel - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class TieredPackageWithMinimumPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["tiered_package_with_minimum"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - tiered_package_with_minimum_config: CustomRatingFunctionConfigModel - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class PackageWithAllocationPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") - - name: str - - package_with_allocation_config: CustomRatingFunctionConfigModel - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class UnitWithPercentPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["unit_with_percent"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - unit_with_percent_config: CustomRatingFunctionConfigModel - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class MatrixWithAllocationPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - matrix_with_allocation_config: MatrixWithAllocationConfigModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["matrix_with_allocation"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class TieredWithProrationPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["tiered_with_proration"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - tiered_with_proration_config: CustomRatingFunctionConfigModel - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class UnitWithProrationPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["unit_with_proration"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - unit_with_proration_config: CustomRatingFunctionConfigModel - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class GroupedAllocationPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - grouped_allocation_config: CustomRatingFunctionConfigModel - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class GroupedWithProratedMinimumPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["grouped_with_prorated_minimum"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class GroupedWithMeteredMinimumPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["grouped_with_metered_minimum"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class MatrixWithDisplayNamePrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - matrix_with_display_name_config: CustomRatingFunctionConfigModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["matrix_with_display_name"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class BulkWithProrationPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - bulk_with_proration_config: CustomRatingFunctionConfigModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["bulk_with_proration"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class GroupedTieredPackagePrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - grouped_tiered_package_config: CustomRatingFunctionConfigModel - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["grouped_tiered_package"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class MaxGroupTieredPackagePrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - max_group_tiered_package_config: CustomRatingFunctionConfigModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["max_group_tiered_package"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class ScalableMatrixWithUnitPricingPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class ScalableMatrixWithTieredPricingPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -class CumulativeGroupedBulkPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTinyModel] = None - - billing_cycle_configuration: BillingCycleConfigurationModel - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[AllocationModel] = None - - cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None - - item: ItemSlimModel - - maximum: Optional[MaximumModel] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MinimumModel] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["cumulative_grouped_bulk"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None - - -PriceModel: TypeAlias = Annotated[ - Union[ - UnitPrice, - PackagePrice, - MatrixPrice, - TieredPrice, - TieredBpsPrice, - BpsPrice, - BulkBpsPrice, - BulkPrice, - ThresholdTotalAmountPrice, - TieredPackagePrice, - GroupedTieredPrice, - TieredWithMinimumPrice, - TieredPackageWithMinimumPrice, - PackageWithAllocationPrice, - UnitWithPercentPrice, - MatrixWithAllocationPrice, - TieredWithProrationPrice, - UnitWithProrationPrice, - GroupedAllocationPrice, - GroupedWithProratedMinimumPrice, - GroupedWithMeteredMinimumPrice, - MatrixWithDisplayNamePrice, - BulkWithProrationPrice, - GroupedTieredPackagePrice, - MaxGroupTieredPackagePrice, - ScalableMatrixWithUnitPricingPrice, - ScalableMatrixWithTieredPricingPrice, - CumulativeGroupedBulkPrice, - ], - PropertyInfo(discriminator="price_model_type"), -] diff --git a/src/orb/types/shared/replace_subscription_adjustment_params.py b/src/orb/types/shared/replace_subscription_adjustment_params.py index a6bfad76..2d861159 100644 --- a/src/orb/types/shared/replace_subscription_adjustment_params.py +++ b/src/orb/types/shared/replace_subscription_adjustment_params.py @@ -1,14 +1,114 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias +from ..._utils import PropertyInfo from ..._models import BaseModel -from .new_adjustment_model import NewAdjustmentModel -__all__ = ["ReplaceSubscriptionAdjustmentParams"] +__all__ = [ + "ReplaceSubscriptionAdjustmentParams", + "Adjustment", + "AdjustmentNewPercentageDiscount", + "AdjustmentNewUsageDiscount", + "AdjustmentNewAmountDiscount", + "AdjustmentNewMinimum", + "AdjustmentNewMaximum", +] + + +class AdjustmentNewPercentageDiscount(BaseModel): + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + percentage_discount: float + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewUsageDiscount(BaseModel): + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + usage_discount: float + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewAmountDiscount(BaseModel): + adjustment_type: Literal["amount_discount"] + + amount_discount: str + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewMinimum(BaseModel): + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewMaximum(BaseModel): + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + maximum_amount: str + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +Adjustment: TypeAlias = Annotated[ + Union[ + AdjustmentNewPercentageDiscount, + AdjustmentNewUsageDiscount, + AdjustmentNewAmountDiscount, + AdjustmentNewMinimum, + AdjustmentNewMaximum, + ], + PropertyInfo(discriminator="adjustment_type"), +] class ReplaceSubscriptionAdjustmentParams(BaseModel): - adjustment: NewAdjustmentModel + adjustment: Adjustment """The definition of a new adjustment to create and add to the subscription.""" replaces_adjustment_id: str diff --git a/src/orb/types/shared/replace_subscription_price_params.py b/src/orb/types/shared/replace_subscription_price_params.py index 3485c672..8bb18226 100644 --- a/src/orb/types/shared/replace_subscription_price_params.py +++ b/src/orb/types/shared/replace_subscription_price_params.py @@ -1,23 +1,2578 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + +from ..._utils import PropertyInfo from ..._models import BaseModel -from .discount_override_model import DiscountOverrideModel -from .new_allocation_price_model import NewAllocationPriceModel -from .new_subscription_price_model import NewSubscriptionPriceModel -__all__ = ["ReplaceSubscriptionPriceParams"] +__all__ = [ + "ReplaceSubscriptionPriceParams", + "AllocationPrice", + "Discount", + "Price", + "PriceNewSubscriptionUnitPrice", + "PriceNewSubscriptionUnitPriceUnitConfig", + "PriceNewSubscriptionUnitPriceBillingCycleConfiguration", + "PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionPackagePrice", + "PriceNewSubscriptionPackagePricePackageConfig", + "PriceNewSubscriptionPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionMatrixPrice", + "PriceNewSubscriptionMatrixPriceMatrixConfig", + "PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", + "PriceNewSubscriptionMatrixPriceBillingCycleConfiguration", + "PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredPrice", + "PriceNewSubscriptionTieredPriceTieredConfig", + "PriceNewSubscriptionTieredPriceTieredConfigTier", + "PriceNewSubscriptionTieredPriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredBpsPrice", + "PriceNewSubscriptionTieredBpsPriceTieredBpsConfig", + "PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", + "PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBpsPrice", + "PriceNewSubscriptionBpsPriceBpsConfig", + "PriceNewSubscriptionBpsPriceBillingCycleConfiguration", + "PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBulkBpsPrice", + "PriceNewSubscriptionBulkBpsPriceBulkBpsConfig", + "PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", + "PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", + "PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBulkPrice", + "PriceNewSubscriptionBulkPriceBulkConfig", + "PriceNewSubscriptionBulkPriceBulkConfigTier", + "PriceNewSubscriptionBulkPriceBillingCycleConfiguration", + "PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionThresholdTotalAmountPrice", + "PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", + "PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredPackagePrice", + "PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredWithMinimumPrice", + "PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionUnitWithPercentPrice", + "PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", + "PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionPackageWithAllocationPrice", + "PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", + "PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTierWithProrationPrice", + "PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", + "PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionUnitWithProrationPrice", + "PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", + "PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedAllocationPrice", + "PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedWithProratedMinimumPrice", + "PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBulkWithProrationPrice", + "PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", + "PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithUnitPricingPrice", + "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithTieredPricingPrice", + "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionCumulativeGroupedBulkPrice", + "PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration", + "PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionMaxGroupTieredPackagePrice", + "PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedWithMeteredMinimumPrice", + "PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionMatrixWithDisplayNamePrice", + "PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration", + "PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedTieredPackagePrice", + "PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration", +] + + +class AllocationPrice(BaseModel): + amount: str + """An amount of the currency to allocate to the customer at the specified cadence.""" + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + """The cadence at which to allocate the amount to the customer.""" + + currency: str + """ + An ISO 4217 currency string or a custom pricing unit identifier in which to bill + this price. + """ + + expires_at_end_of_cadence: bool + """ + Whether the allocated amount should expire at the end of the cadence or roll + over to the next period. + """ + + +class Discount(BaseModel): + discount_type: Literal["percentage", "usage", "amount"] + + amount_discount: Optional[str] = None + """Only available if discount_type is `amount`.""" + + percentage_discount: Optional[float] = None + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + usage_discount: Optional[float] = None + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class PriceNewSubscriptionUnitPriceUnitConfig(BaseModel): + unit_amount: str + """Rate per unit of usage""" + + +class PriceNewSubscriptionUnitPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["unit"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + unit_config: PriceNewSubscriptionUnitPriceUnitConfig + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionPackagePricePackageConfig(BaseModel): + package_amount: str + """A currency amount to rate usage by""" + + package_size: int + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + +class PriceNewSubscriptionPackagePriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + package_config: PriceNewSubscriptionPackagePricePackageConfig + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(BaseModel): + dimension_values: List[Optional[str]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: str + """Unit price for the specified dimension_values""" + + +class PriceNewSubscriptionMatrixPriceMatrixConfig(BaseModel): + default_unit_amount: str + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: List[Optional[str]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: List[PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue] + """Matrix values for specified matrix grouping keys""" + + +class PriceNewSubscriptionMatrixPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + matrix_config: PriceNewSubscriptionMatrixPriceMatrixConfig + + price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredPriceTieredConfigTier(BaseModel): + first_unit: float + """Inclusive tier starting value""" + + unit_amount: str + """Amount per unit""" + + last_unit: Optional[float] = None + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class PriceNewSubscriptionTieredPriceTieredConfig(BaseModel): + tiers: List[PriceNewSubscriptionTieredPriceTieredConfigTier] + """Tiers for rating based on total usage quantities into the specified tier""" + + +class PriceNewSubscriptionTieredPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_config: PriceNewSubscriptionTieredPriceTieredConfig + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(BaseModel): + bps: float + """Per-event basis point rate""" + + minimum_amount: str + """Inclusive tier starting value""" + + maximum_amount: Optional[str] = None + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] = None + """Per unit maximum to charge""" + + +class PriceNewSubscriptionTieredBpsPriceTieredBpsConfig(BaseModel): + tiers: List[PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + +class PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredBpsPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_bps_config: PriceNewSubscriptionTieredBpsPriceTieredBpsConfig + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBpsPriceBpsConfig(BaseModel): + bps: float + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] = None + """Optional currency amount maximum to cap spend per event""" + + +class PriceNewSubscriptionBpsPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBpsPrice(BaseModel): + bps_config: PriceNewSubscriptionBpsPriceBpsConfig + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bps"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(BaseModel): + bps: float + """Basis points to rate on""" + + maximum_amount: Optional[str] = None + """Upper bound for tier""" + + per_unit_maximum: Optional[str] = None + """The maximum amount to charge for any one event""" + + +class PriceNewSubscriptionBulkBpsPriceBulkBpsConfig(BaseModel): + tiers: List[PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ + + +class PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkBpsPrice(BaseModel): + bulk_bps_config: PriceNewSubscriptionBulkBpsPriceBulkBpsConfig + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBulkPriceBulkConfigTier(BaseModel): + unit_amount: str + """Amount per unit""" + + maximum_units: Optional[float] = None + """Upper bound for this tier""" + + +class PriceNewSubscriptionBulkPriceBulkConfig(BaseModel): + tiers: List[PriceNewSubscriptionBulkPriceBulkConfigTier] + """Bulk tiers for rating based on total usage volume""" + + +class PriceNewSubscriptionBulkPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkPrice(BaseModel): + bulk_config: PriceNewSubscriptionBulkPriceBulkConfig + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionThresholdTotalAmountPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + threshold_total_amount_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_package_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredWithMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_with_minimum_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration] = ( + None + ) + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithPercentPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["unit_with_percent"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + unit_with_percent_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackageWithAllocationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + package_with_allocation_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration] = ( + None + ) + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTierWithProrationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_with_proration"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_with_proration_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration] = ( + None + ) + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithProrationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["unit_with_proration"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + unit_with_proration_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration] = ( + None + ) + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedAllocationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Dict[str, object] + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration] = ( + None + ) + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithProratedMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Dict[str, object] + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_with_prorated_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration + ] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkWithProrationPrice(BaseModel): + bulk_with_proration_config: Dict[str, object] + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bulk_with_proration"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration] = ( + None + ) + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithUnitPricingPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithTieredPricingPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Dict[str, object] + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionCumulativeGroupedBulkPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Dict[str, object] + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["cumulative_grouped_bulk"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration] = ( + None + ) + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMaxGroupTieredPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: Dict[str, object] + + price_model_type: Literal["max_group_tiered_package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration] = ( + None + ) + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithMeteredMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Dict[str, object] + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_with_metered_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration + ] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixWithDisplayNamePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + matrix_with_display_name_config: Dict[str, object] + + price_model_type: Literal["matrix_with_display_name"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration] = ( + None + ) + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedTieredPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Dict[str, object] + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_tiered_package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration + ] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +Price: TypeAlias = Annotated[ + Union[ + PriceNewSubscriptionUnitPrice, + PriceNewSubscriptionPackagePrice, + PriceNewSubscriptionMatrixPrice, + PriceNewSubscriptionTieredPrice, + PriceNewSubscriptionTieredBpsPrice, + PriceNewSubscriptionBpsPrice, + PriceNewSubscriptionBulkBpsPrice, + PriceNewSubscriptionBulkPrice, + PriceNewSubscriptionThresholdTotalAmountPrice, + PriceNewSubscriptionTieredPackagePrice, + PriceNewSubscriptionTieredWithMinimumPrice, + PriceNewSubscriptionUnitWithPercentPrice, + PriceNewSubscriptionPackageWithAllocationPrice, + PriceNewSubscriptionTierWithProrationPrice, + PriceNewSubscriptionUnitWithProrationPrice, + PriceNewSubscriptionGroupedAllocationPrice, + PriceNewSubscriptionGroupedWithProratedMinimumPrice, + PriceNewSubscriptionBulkWithProrationPrice, + PriceNewSubscriptionScalableMatrixWithUnitPricingPrice, + PriceNewSubscriptionScalableMatrixWithTieredPricingPrice, + PriceNewSubscriptionCumulativeGroupedBulkPrice, + PriceNewSubscriptionMaxGroupTieredPackagePrice, + PriceNewSubscriptionGroupedWithMeteredMinimumPrice, + PriceNewSubscriptionMatrixWithDisplayNamePrice, + PriceNewSubscriptionGroupedTieredPackagePrice, + None, + ], + PropertyInfo(discriminator="price_model_type"), +] class ReplaceSubscriptionPriceParams(BaseModel): replaces_price_id: str """The id of the price on the plan to replace in the subscription.""" - allocation_price: Optional[NewAllocationPriceModel] = None + allocation_price: Optional[AllocationPrice] = None """The definition of a new allocation price to create and add to the subscription.""" - discounts: Optional[List[DiscountOverrideModel]] = None + discounts: Optional[List[Discount]] = None """[DEPRECATED] Use add_adjustments instead. The subscription's discounts for the replacement price. @@ -41,7 +2596,7 @@ class ReplaceSubscriptionPriceParams(BaseModel): The subscription's minimum amount for the replacement price. """ - price: Optional[NewSubscriptionPriceModel] = None + price: Optional[Price] = None """The definition of a new price to create and add to the subscription.""" price_id: Optional[str] = None diff --git a/src/orb/types/shared/sub_line_item_grouping_model.py b/src/orb/types/shared/sub_line_item_grouping_model.py deleted file mode 100644 index e521b20d..00000000 --- a/src/orb/types/shared/sub_line_item_grouping_model.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["SubLineItemGroupingModel"] - - -class SubLineItemGroupingModel(BaseModel): - key: str - - value: Optional[str] = None - """No value indicates the default group""" diff --git a/src/orb/types/shared/subscription_minified_model.py b/src/orb/types/shared/subscription_minified_model.py deleted file mode 100644 index ea4b1894..00000000 --- a/src/orb/types/shared/subscription_minified_model.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["SubscriptionMinifiedModel"] - - -class SubscriptionMinifiedModel(BaseModel): - id: str diff --git a/src/orb/types/shared/subscription_model.py b/src/orb/types/shared/subscription_model.py deleted file mode 100644 index eccbf040..00000000 --- a/src/orb/types/shared/subscription_model.py +++ /dev/null @@ -1,154 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from ..._utils import PropertyInfo -from ..._models import BaseModel -from .plan_model import PlanModel -from .customer_model import CustomerModel -from .price_interval_model import PriceIntervalModel -from .maximum_interval_model import MaximumIntervalModel -from .minimum_interval_model import MinimumIntervalModel -from .coupon_redemption_model import CouponRedemptionModel -from .adjustment_interval_model import AdjustmentIntervalModel -from .subscription_trial_info_model import SubscriptionTrialInfoModel -from .usage_discount_interval_model import UsageDiscountIntervalModel -from .amount_discount_interval_model import AmountDiscountIntervalModel -from .percentage_discount_interval_model import PercentageDiscountIntervalModel -from .fixed_fee_quantity_schedule_entry_model import FixedFeeQuantityScheduleEntryModel -from .billing_cycle_anchor_configuration_model import BillingCycleAnchorConfigurationModel - -__all__ = ["SubscriptionModel", "DiscountInterval"] - -DiscountInterval: TypeAlias = Annotated[ - Union[AmountDiscountIntervalModel, PercentageDiscountIntervalModel, UsageDiscountIntervalModel], - PropertyInfo(discriminator="discount_type"), -] - - -class SubscriptionModel(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentIntervalModel] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfigurationModel - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: CustomerModel - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantityScheduleEntryModel] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumIntervalModel] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumIntervalModel] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: PlanModel - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceIntervalModel] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[CouponRedemptionModel] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: SubscriptionTrialInfoModel diff --git a/src/orb/types/shared/subscription_trial_info_model.py b/src/orb/types/shared/subscription_trial_info_model.py deleted file mode 100644 index 0a829f14..00000000 --- a/src/orb/types/shared/subscription_trial_info_model.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["SubscriptionTrialInfoModel"] - - -class SubscriptionTrialInfoModel(BaseModel): - end_date: Optional[datetime] = None diff --git a/src/orb/types/shared/subscriptions_model.py b/src/orb/types/shared/subscriptions_model.py deleted file mode 100644 index dd001701..00000000 --- a/src/orb/types/shared/subscriptions_model.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .subscription_model import SubscriptionModel -from .pagination_metadata import PaginationMetadata - -__all__ = ["SubscriptionsModel"] - - -class SubscriptionsModel(BaseModel): - data: List[SubscriptionModel] - - pagination_metadata: PaginationMetadata diff --git a/src/orb/types/shared/tax_amount_model.py b/src/orb/types/shared/tax_amount_model.py deleted file mode 100644 index d7530881..00000000 --- a/src/orb/types/shared/tax_amount_model.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["TaxAmountModel"] - - -class TaxAmountModel(BaseModel): - amount: str - """The amount of additional tax incurred by this tax rate.""" - - tax_rate_description: str - """The human-readable description of the applied tax rate.""" - - tax_rate_percentage: Optional[str] = None - """The tax rate percentage, out of 100.""" diff --git a/src/orb/types/shared/threshold_model.py b/src/orb/types/shared/threshold_model.py deleted file mode 100644 index e0df8511..00000000 --- a/src/orb/types/shared/threshold_model.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["ThresholdModel"] - - -class ThresholdModel(BaseModel): - value: float - """The value at which an alert will fire. - - For credit balance alerts, the alert will fire at or below this value. For usage - and cost alerts, the alert will fire at or above this value. - """ diff --git a/src/orb/types/shared/tiered_bps_config_model.py b/src/orb/types/shared/tiered_bps_config_model.py deleted file mode 100644 index 8e86a9de..00000000 --- a/src/orb/types/shared/tiered_bps_config_model.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["TieredBpsConfigModel", "Tier"] - - -class Tier(BaseModel): - bps: float - """Per-event basis point rate""" - - minimum_amount: str - """Inclusive tier starting value""" - - maximum_amount: Optional[str] = None - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] = None - """Per unit maximum to charge""" - - -class TieredBpsConfigModel(BaseModel): - tiers: List[Tier] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ diff --git a/src/orb/types/shared/tiered_config_model.py b/src/orb/types/shared/tiered_config_model.py deleted file mode 100644 index 76ac4342..00000000 --- a/src/orb/types/shared/tiered_config_model.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["TieredConfigModel", "Tier"] - - -class Tier(BaseModel): - first_unit: float - """Inclusive tier starting value""" - - unit_amount: str - """Amount per unit""" - - last_unit: Optional[float] = None - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class TieredConfigModel(BaseModel): - tiers: List[Tier] - """Tiers for rating based on total usage quantities into the specified tier""" diff --git a/src/orb/types/shared/top_ups_model.py b/src/orb/types/shared/top_ups_model.py deleted file mode 100644 index fcf83665..00000000 --- a/src/orb/types/shared/top_ups_model.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .top_up_model import TopUpModel -from .pagination_metadata import PaginationMetadata - -__all__ = ["TopUpsModel"] - - -class TopUpsModel(BaseModel): - data: List[TopUpModel] - - pagination_metadata: PaginationMetadata diff --git a/src/orb/types/shared/trial_discount_model.py b/src/orb/types/shared/trial_discount_model.py deleted file mode 100644 index d300cb1f..00000000 --- a/src/orb/types/shared/trial_discount_model.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["TrialDiscountModel"] - - -class TrialDiscountModel(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this discount applies to. - - For plan/plan phase discounts, this can be a subset of prices. - """ - - discount_type: Literal["trial"] - - reason: Optional[str] = None - - trial_amount_discount: Optional[str] = None - """Only available if discount_type is `trial`""" - - trial_percentage_discount: Optional[float] = None - """Only available if discount_type is `trial`""" diff --git a/src/orb/types/shared/unit_config_model.py b/src/orb/types/shared/unit_config_model.py deleted file mode 100644 index 9a974dbc..00000000 --- a/src/orb/types/shared/unit_config_model.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["UnitConfigModel"] - - -class UnitConfigModel(BaseModel): - unit_amount: str - """Rate per unit of usage""" diff --git a/src/orb/types/shared/usage_discount_interval_model.py b/src/orb/types/shared/usage_discount_interval_model.py deleted file mode 100644 index 9dde8973..00000000 --- a/src/orb/types/shared/usage_discount_interval_model.py +++ /dev/null @@ -1,31 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["UsageDiscountIntervalModel"] - - -class UsageDiscountIntervalModel(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["usage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ diff --git a/src/orb/types/shared/usage_model.py b/src/orb/types/shared/usage_model.py deleted file mode 100644 index b3e611ea..00000000 --- a/src/orb/types/shared/usage_model.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["UsageModel"] - - -class UsageModel(BaseModel): - quantity: float - - timeframe_end: datetime - - timeframe_start: datetime diff --git a/src/orb/types/shared_params/__init__.py b/src/orb/types/shared_params/__init__.py index 852a124d..ca6e4bc4 100644 --- a/src/orb/types/shared_params/__init__.py +++ b/src/orb/types/shared_params/__init__.py @@ -3,51 +3,16 @@ from .discount import Discount as Discount from .trial_discount import TrialDiscount as TrialDiscount from .amount_discount import AmountDiscount as AmountDiscount -from .threshold_model import ThresholdModel as ThresholdModel -from .bps_config_model import BpsConfigModel as BpsConfigModel -from .bulk_config_model import BulkConfigModel as BulkConfigModel -from .unit_config_model import UnitConfigModel as UnitConfigModel -from .matrix_value_model import MatrixValueModel as MatrixValueModel -from .address_input_model import AddressInputModel as AddressInputModel -from .matrix_config_model import MatrixConfigModel as MatrixConfigModel from .percentage_discount import PercentageDiscount as PercentageDiscount -from .tiered_config_model import TieredConfigModel as TieredConfigModel -from .new_adjustment_model import NewAdjustmentModel as NewAdjustmentModel -from .package_config_model import PackageConfigModel as PackageConfigModel -from .bulk_bps_config_model import BulkBpsConfigModel as BulkBpsConfigModel -from .customer_tax_id_model import CustomerTaxIDModel as CustomerTaxIDModel -from .discount_override_model import DiscountOverrideModel as DiscountOverrideModel -from .tiered_bps_config_model import TieredBpsConfigModel as TieredBpsConfigModel -from .new_floating_price_model import NewFloatingPriceModel as NewFloatingPriceModel -from .new_allocation_price_model import NewAllocationPriceModel as NewAllocationPriceModel from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate -from .new_tax_configuration_model import NewTaxConfigurationModel as NewTaxConfigurationModel -from .new_subscription_price_model import NewSubscriptionPriceModel as NewSubscriptionPriceModel from .add_subscription_price_params import AddSubscriptionPriceParams as AddSubscriptionPriceParams -from .item_external_connection_model import ItemExternalConnectionModel as ItemExternalConnectionModel from .add_credit_ledger_entry_request import AddCreditLedgerEntryRequest as AddCreditLedgerEntryRequest -from .customer_hierarchy_config_model import CustomerHierarchyConfigModel as CustomerHierarchyConfigModel from .remove_subscription_price_params import RemoveSubscriptionPriceParams as RemoveSubscriptionPriceParams -from .new_reporting_configuration_model import NewReportingConfigurationModel as NewReportingConfigurationModel from .replace_subscription_price_params import ReplaceSubscriptionPriceParams as ReplaceSubscriptionPriceParams from .add_subscription_adjustment_params import AddSubscriptionAdjustmentParams as AddSubscriptionAdjustmentParams -from .custom_rating_function_config_model import CustomRatingFunctionConfigModel as CustomRatingFunctionConfigModel -from .matrix_with_allocation_config_model import MatrixWithAllocationConfigModel as MatrixWithAllocationConfigModel -from .new_billing_cycle_configuration_model import ( - NewBillingCycleConfigurationModel as NewBillingCycleConfigurationModel, -) from .remove_subscription_adjustment_params import ( RemoveSubscriptionAdjustmentParams as RemoveSubscriptionAdjustmentParams, ) from .replace_subscription_adjustment_params import ( ReplaceSubscriptionAdjustmentParams as ReplaceSubscriptionAdjustmentParams, ) -from .new_accounting_sync_configuration_model import ( - NewAccountingSyncConfigurationModel as NewAccountingSyncConfigurationModel, -) -from .billing_cycle_anchor_configuration_model import ( - BillingCycleAnchorConfigurationModel as BillingCycleAnchorConfigurationModel, -) -from .price_interval_fixed_fee_quantity_transition_model import ( - PriceIntervalFixedFeeQuantityTransitionModel as PriceIntervalFixedFeeQuantityTransitionModel, -) diff --git a/src/orb/types/shared_params/add_subscription_adjustment_params.py b/src/orb/types/shared_params/add_subscription_adjustment_params.py index d396c086..5946cf33 100644 --- a/src/orb/types/shared_params/add_subscription_adjustment_params.py +++ b/src/orb/types/shared_params/add_subscription_adjustment_params.py @@ -2,18 +2,112 @@ from __future__ import annotations -from typing import Union, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo -from .new_adjustment_model import NewAdjustmentModel -__all__ = ["AddSubscriptionAdjustmentParams"] +__all__ = [ + "AddSubscriptionAdjustmentParams", + "Adjustment", + "AdjustmentNewPercentageDiscount", + "AdjustmentNewUsageDiscount", + "AdjustmentNewAmountDiscount", + "AdjustmentNewMinimum", + "AdjustmentNewMaximum", +] + + +class AdjustmentNewPercentageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["percentage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + percentage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewUsageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["usage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + usage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewAmountDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["amount_discount"]] + + amount_discount: Required[str] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewMinimum(TypedDict, total=False): + adjustment_type: Required[Literal["minimum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + item_id: Required[str] + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewMaximum(TypedDict, total=False): + adjustment_type: Required[Literal["maximum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + maximum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +Adjustment: TypeAlias = Union[ + AdjustmentNewPercentageDiscount, + AdjustmentNewUsageDiscount, + AdjustmentNewAmountDiscount, + AdjustmentNewMinimum, + AdjustmentNewMaximum, +] class AddSubscriptionAdjustmentParams(TypedDict, total=False): - adjustment: Required[NewAdjustmentModel] + adjustment: Required[Adjustment] """The definition of a new adjustment to create and add to the subscription.""" end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] diff --git a/src/orb/types/shared_params/add_subscription_price_params.py b/src/orb/types/shared_params/add_subscription_price_params.py index 3e850da3..23c65730 100644 --- a/src/orb/types/shared_params/add_subscription_price_params.py +++ b/src/orb/types/shared_params/add_subscription_price_params.py @@ -2,23 +2,2536 @@ from __future__ import annotations -from typing import Union, Iterable, Optional +from typing import Dict, List, Union, Iterable, Optional from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo -from .discount_override_model import DiscountOverrideModel -from .new_allocation_price_model import NewAllocationPriceModel -from .new_subscription_price_model import NewSubscriptionPriceModel -__all__ = ["AddSubscriptionPriceParams"] +__all__ = [ + "AddSubscriptionPriceParams", + "AllocationPrice", + "Discount", + "Price", + "PriceNewSubscriptionUnitPrice", + "PriceNewSubscriptionUnitPriceUnitConfig", + "PriceNewSubscriptionUnitPriceBillingCycleConfiguration", + "PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionPackagePrice", + "PriceNewSubscriptionPackagePricePackageConfig", + "PriceNewSubscriptionPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionMatrixPrice", + "PriceNewSubscriptionMatrixPriceMatrixConfig", + "PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", + "PriceNewSubscriptionMatrixPriceBillingCycleConfiguration", + "PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredPrice", + "PriceNewSubscriptionTieredPriceTieredConfig", + "PriceNewSubscriptionTieredPriceTieredConfigTier", + "PriceNewSubscriptionTieredPriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredBpsPrice", + "PriceNewSubscriptionTieredBpsPriceTieredBpsConfig", + "PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", + "PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBpsPrice", + "PriceNewSubscriptionBpsPriceBpsConfig", + "PriceNewSubscriptionBpsPriceBillingCycleConfiguration", + "PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBulkBpsPrice", + "PriceNewSubscriptionBulkBpsPriceBulkBpsConfig", + "PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", + "PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", + "PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBulkPrice", + "PriceNewSubscriptionBulkPriceBulkConfig", + "PriceNewSubscriptionBulkPriceBulkConfigTier", + "PriceNewSubscriptionBulkPriceBillingCycleConfiguration", + "PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionThresholdTotalAmountPrice", + "PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", + "PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredPackagePrice", + "PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredWithMinimumPrice", + "PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionUnitWithPercentPrice", + "PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", + "PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionPackageWithAllocationPrice", + "PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", + "PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTierWithProrationPrice", + "PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", + "PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionUnitWithProrationPrice", + "PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", + "PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedAllocationPrice", + "PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedWithProratedMinimumPrice", + "PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBulkWithProrationPrice", + "PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", + "PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithUnitPricingPrice", + "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithTieredPricingPrice", + "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionCumulativeGroupedBulkPrice", + "PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration", + "PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionMaxGroupTieredPackagePrice", + "PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedWithMeteredMinimumPrice", + "PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionMatrixWithDisplayNamePrice", + "PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration", + "PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedTieredPackagePrice", + "PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration", +] + + +class AllocationPrice(TypedDict, total=False): + amount: Required[str] + """An amount of the currency to allocate to the customer at the specified cadence.""" + + cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] + """The cadence at which to allocate the amount to the customer.""" + + currency: Required[str] + """ + An ISO 4217 currency string or a custom pricing unit identifier in which to bill + this price. + """ + + expires_at_end_of_cadence: Required[bool] + """ + Whether the allocated amount should expire at the end of the cadence or roll + over to the next period. + """ + + +class Discount(TypedDict, total=False): + discount_type: Required[Literal["percentage", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class PriceNewSubscriptionUnitPriceUnitConfig(TypedDict, total=False): + unit_amount: Required[str] + """Rate per unit of usage""" + + +class PriceNewSubscriptionUnitPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit"]] + + name: Required[str] + """The name of the price.""" + + unit_config: Required[PriceNewSubscriptionUnitPriceUnitConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionPackagePricePackageConfig(TypedDict, total=False): + package_amount: Required[str] + """A currency amount to rate usage by""" + + package_size: Required[int] + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + +class PriceNewSubscriptionPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package"]] + + name: Required[str] + """The name of the price.""" + + package_config: Required[PriceNewSubscriptionPackagePricePackageConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): + dimension_values: Required[List[Optional[str]]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: Required[str] + """Unit price for the specified dimension_values""" + + +class PriceNewSubscriptionMatrixPriceMatrixConfig(TypedDict, total=False): + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue]] + """Matrix values for specified matrix grouping keys""" + + +class PriceNewSubscriptionMatrixPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_config: Required[PriceNewSubscriptionMatrixPriceMatrixConfig] + + model_type: Required[Literal["matrix"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredPriceTieredConfigTier(TypedDict, total=False): + first_unit: Required[float] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + last_unit: Optional[float] + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class PriceNewSubscriptionTieredPriceTieredConfig(TypedDict, total=False): + tiers: Required[Iterable[PriceNewSubscriptionTieredPriceTieredConfigTier]] + """Tiers for rating based on total usage quantities into the specified tier""" + + +class PriceNewSubscriptionTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered"]] + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[PriceNewSubscriptionTieredPriceTieredConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Per-event basis point rate""" + + minimum_amount: Required[str] + """Inclusive tier starting value""" + + maximum_amount: Optional[str] + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] + """Per unit maximum to charge""" + + +class PriceNewSubscriptionTieredBpsPriceTieredBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier]] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + +class PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredBpsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_bps"]] + + name: Required[str] + """The name of the price.""" + + tiered_bps_config: Required[PriceNewSubscriptionTieredBpsPriceTieredBpsConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBpsPriceBpsConfig(TypedDict, total=False): + bps: Required[float] + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] + """Optional currency amount maximum to cap spend per event""" + + +class PriceNewSubscriptionBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBpsPrice(TypedDict, total=False): + bps_config: Required[PriceNewSubscriptionBpsPriceBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Basis points to rate on""" + + maximum_amount: Optional[str] + """Upper bound for tier""" + + per_unit_maximum: Optional[str] + """The maximum amount to charge for any one event""" + + +class PriceNewSubscriptionBulkBpsPriceBulkBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier]] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ + + +class PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkBpsPrice(TypedDict, total=False): + bulk_bps_config: Required[PriceNewSubscriptionBulkBpsPriceBulkBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBulkPriceBulkConfigTier(TypedDict, total=False): + unit_amount: Required[str] + """Amount per unit""" + + maximum_units: Optional[float] + """Upper bound for this tier""" + + +class PriceNewSubscriptionBulkPriceBulkConfig(TypedDict, total=False): + tiers: Required[Iterable[PriceNewSubscriptionBulkPriceBulkConfigTier]] + """Bulk tiers for rating based on total usage volume""" + + +class PriceNewSubscriptionBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkPrice(TypedDict, total=False): + bulk_config: Required[PriceNewSubscriptionBulkPriceBulkConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["threshold_total_amount"]] + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_package"]] + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_minimum"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_percent"]] + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package_with_allocation"]] + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTierWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_proration"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_proration"]] + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_allocation"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[Dict[str, object]] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_with_proration"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithTieredPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionCumulativeGroupedBulkPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["cumulative_grouped_bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: Required[Dict[str, object]] + + model_type: Required[Literal["max_group_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_metered_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_with_display_name_config: Required[Dict[str, object]] + + model_type: Required[Literal["matrix_with_display_name"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +Price: TypeAlias = Union[ + PriceNewSubscriptionUnitPrice, + PriceNewSubscriptionPackagePrice, + PriceNewSubscriptionMatrixPrice, + PriceNewSubscriptionTieredPrice, + PriceNewSubscriptionTieredBpsPrice, + PriceNewSubscriptionBpsPrice, + PriceNewSubscriptionBulkBpsPrice, + PriceNewSubscriptionBulkPrice, + PriceNewSubscriptionThresholdTotalAmountPrice, + PriceNewSubscriptionTieredPackagePrice, + PriceNewSubscriptionTieredWithMinimumPrice, + PriceNewSubscriptionUnitWithPercentPrice, + PriceNewSubscriptionPackageWithAllocationPrice, + PriceNewSubscriptionTierWithProrationPrice, + PriceNewSubscriptionUnitWithProrationPrice, + PriceNewSubscriptionGroupedAllocationPrice, + PriceNewSubscriptionGroupedWithProratedMinimumPrice, + PriceNewSubscriptionBulkWithProrationPrice, + PriceNewSubscriptionScalableMatrixWithUnitPricingPrice, + PriceNewSubscriptionScalableMatrixWithTieredPricingPrice, + PriceNewSubscriptionCumulativeGroupedBulkPrice, + PriceNewSubscriptionMaxGroupTieredPackagePrice, + PriceNewSubscriptionGroupedWithMeteredMinimumPrice, + PriceNewSubscriptionMatrixWithDisplayNamePrice, + PriceNewSubscriptionGroupedTieredPackagePrice, +] class AddSubscriptionPriceParams(TypedDict, total=False): - allocation_price: Optional[NewAllocationPriceModel] + allocation_price: Optional[AllocationPrice] """The definition of a new allocation price to create and add to the subscription.""" - discounts: Optional[Iterable[DiscountOverrideModel]] + discounts: Optional[Iterable[Discount]] """[DEPRECATED] Use add_adjustments instead. The subscription's discounts for this price. @@ -49,7 +2562,7 @@ class AddSubscriptionPriceParams(TypedDict, total=False): plan_phase_order: Optional[int] """The phase to add this price to.""" - price: Optional[NewSubscriptionPriceModel] + price: Optional[Price] """The definition of a new price to create and add to the subscription.""" price_id: Optional[str] diff --git a/src/orb/types/shared_params/address_input_model.py b/src/orb/types/shared_params/address_input_model.py deleted file mode 100644 index e1c398e8..00000000 --- a/src/orb/types/shared_params/address_input_model.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import TypedDict - -__all__ = ["AddressInputModel"] - - -class AddressInputModel(TypedDict, total=False): - city: Optional[str] - - country: Optional[str] - - line1: Optional[str] - - line2: Optional[str] - - postal_code: Optional[str] - - state: Optional[str] diff --git a/src/orb/types/shared_params/billing_cycle_anchor_configuration_model.py b/src/orb/types/shared_params/billing_cycle_anchor_configuration_model.py deleted file mode 100644 index 6365dde8..00000000 --- a/src/orb/types/shared_params/billing_cycle_anchor_configuration_model.py +++ /dev/null @@ -1,32 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import Required, TypedDict - -__all__ = ["BillingCycleAnchorConfigurationModel"] - - -class BillingCycleAnchorConfigurationModel(TypedDict, total=False): - day: Required[int] - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ diff --git a/src/orb/types/shared_params/bps_config_model.py b/src/orb/types/shared_params/bps_config_model.py deleted file mode 100644 index bedb28d9..00000000 --- a/src/orb/types/shared_params/bps_config_model.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import Required, TypedDict - -__all__ = ["BpsConfigModel"] - - -class BpsConfigModel(TypedDict, total=False): - bps: Required[float] - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] - """Optional currency amount maximum to cap spend per event""" diff --git a/src/orb/types/shared_params/bulk_bps_config_model.py b/src/orb/types/shared_params/bulk_bps_config_model.py deleted file mode 100644 index a34ff8f6..00000000 --- a/src/orb/types/shared_params/bulk_bps_config_model.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable, Optional -from typing_extensions import Required, TypedDict - -__all__ = ["BulkBpsConfigModel", "Tier"] - - -class Tier(TypedDict, total=False): - bps: Required[float] - """Basis points to rate on""" - - maximum_amount: Optional[str] - """Upper bound for tier""" - - per_unit_maximum: Optional[str] - """The maximum amount to charge for any one event""" - - -class BulkBpsConfigModel(TypedDict, total=False): - tiers: Required[Iterable[Tier]] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ diff --git a/src/orb/types/shared_params/bulk_config_model.py b/src/orb/types/shared_params/bulk_config_model.py deleted file mode 100644 index 386b8d87..00000000 --- a/src/orb/types/shared_params/bulk_config_model.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable, Optional -from typing_extensions import Required, TypedDict - -__all__ = ["BulkConfigModel", "Tier"] - - -class Tier(TypedDict, total=False): - unit_amount: Required[str] - """Amount per unit""" - - maximum_units: Optional[float] - """Upper bound for this tier""" - - -class BulkConfigModel(TypedDict, total=False): - tiers: Required[Iterable[Tier]] - """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb/types/shared_params/custom_rating_function_config_model.py b/src/orb/types/shared_params/custom_rating_function_config_model.py deleted file mode 100644 index 4f8aab29..00000000 --- a/src/orb/types/shared_params/custom_rating_function_config_model.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict -from typing_extensions import TypeAlias - -__all__ = ["CustomRatingFunctionConfigModel"] - -CustomRatingFunctionConfigModel: TypeAlias = Dict[str, object] diff --git a/src/orb/types/shared_params/customer_hierarchy_config_model.py b/src/orb/types/shared_params/customer_hierarchy_config_model.py deleted file mode 100644 index 5f6004c2..00000000 --- a/src/orb/types/shared_params/customer_hierarchy_config_model.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional -from typing_extensions import TypedDict - -__all__ = ["CustomerHierarchyConfigModel"] - - -class CustomerHierarchyConfigModel(TypedDict, total=False): - child_customer_ids: List[str] - """A list of child customer IDs to add to the hierarchy. - - The desired child customers must not already be part of another hierarchy. - """ - - parent_customer_id: Optional[str] - """The ID of the parent customer in the hierarchy. - - The desired parent customer must not be a child of another customer. - """ diff --git a/src/orb/types/shared_params/customer_tax_id_model.py b/src/orb/types/shared_params/customer_tax_id_model.py deleted file mode 100644 index 9bcfd7b1..00000000 --- a/src/orb/types/shared_params/customer_tax_id_model.py +++ /dev/null @@ -1,170 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["CustomerTaxIDModel"] - - -class CustomerTaxIDModel(TypedDict, total=False): - country: Required[ - Literal[ - "AD", - "AE", - "AR", - "AT", - "AU", - "BE", - "BG", - "BH", - "BO", - "BR", - "CA", - "CH", - "CL", - "CN", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "EE", - "DO", - "EC", - "EG", - "ES", - "EU", - "FI", - "FR", - "GB", - "GE", - "GR", - "HK", - "HR", - "HU", - "ID", - "IE", - "IL", - "IN", - "IS", - "IT", - "JP", - "KE", - "KR", - "KZ", - "LI", - "LT", - "LU", - "LV", - "MT", - "MX", - "MY", - "NG", - "NL", - "NO", - "NZ", - "OM", - "PE", - "PH", - "PL", - "PT", - "RO", - "RS", - "RU", - "SA", - "SE", - "SG", - "SI", - "SK", - "SV", - "TH", - "TR", - "TW", - "UA", - "US", - "UY", - "VE", - "VN", - "ZA", - ] - ] - - type: Required[ - Literal[ - "ad_nrt", - "ae_trn", - "ar_cuit", - "eu_vat", - "au_abn", - "au_arn", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "gb_vat", - "ge_vat", - "hk_br", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kr_brn", - "kz_bin", - "li_uid", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sv_nit", - "th_vat", - "tr_tin", - "tw_vat", - "ua_vat", - "us_ein", - "uy_ruc", - "ve_rif", - "vn_tin", - "za_vat", - ] - ] - - value: Required[str] diff --git a/src/orb/types/shared_params/discount_override_model.py b/src/orb/types/shared_params/discount_override_model.py deleted file mode 100644 index 1cc857e9..00000000 --- a/src/orb/types/shared_params/discount_override_model.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["DiscountOverrideModel"] - - -class DiscountOverrideModel(TypedDict, total=False): - discount_type: Required[Literal["percentage", "usage", "amount"]] - - amount_discount: Optional[str] - """Only available if discount_type is `amount`.""" - - percentage_discount: Optional[float] - """Only available if discount_type is `percentage`. - - This is a number between 0 and 1. - """ - - usage_discount: Optional[float] - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ diff --git a/src/orb/types/shared_params/item_external_connection_model.py b/src/orb/types/shared_params/item_external_connection_model.py deleted file mode 100644 index a73e9bc5..00000000 --- a/src/orb/types/shared_params/item_external_connection_model.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["ItemExternalConnectionModel"] - - -class ItemExternalConnectionModel(TypedDict, total=False): - external_connection_name: Required[ - Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok"] - ] - - external_entity_id: Required[str] diff --git a/src/orb/types/shared_params/matrix_config_model.py b/src/orb/types/shared_params/matrix_config_model.py deleted file mode 100644 index 9f889f10..00000000 --- a/src/orb/types/shared_params/matrix_config_model.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable, Optional -from typing_extensions import Required, TypedDict - -from .matrix_value_model import MatrixValueModel - -__all__ = ["MatrixConfigModel"] - - -class MatrixConfigModel(TypedDict, total=False): - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[MatrixValueModel]] - """Matrix values for specified matrix grouping keys""" diff --git a/src/orb/types/shared_params/matrix_value_model.py b/src/orb/types/shared_params/matrix_value_model.py deleted file mode 100644 index e4d12f47..00000000 --- a/src/orb/types/shared_params/matrix_value_model.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional -from typing_extensions import Required, TypedDict - -__all__ = ["MatrixValueModel"] - - -class MatrixValueModel(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: Required[str] - """Unit price for the specified dimension_values""" diff --git a/src/orb/types/shared_params/matrix_with_allocation_config_model.py b/src/orb/types/shared_params/matrix_with_allocation_config_model.py deleted file mode 100644 index 972e5b0d..00000000 --- a/src/orb/types/shared_params/matrix_with_allocation_config_model.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable, Optional -from typing_extensions import Required, TypedDict - -from .matrix_value_model import MatrixValueModel - -__all__ = ["MatrixWithAllocationConfigModel"] - - -class MatrixWithAllocationConfigModel(TypedDict, total=False): - allocation: Required[float] - """Allocation to be used to calculate the price""" - - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[MatrixValueModel]] - """Matrix values for specified matrix grouping keys""" diff --git a/src/orb/types/shared_params/new_accounting_sync_configuration_model.py b/src/orb/types/shared_params/new_accounting_sync_configuration_model.py deleted file mode 100644 index cc449918..00000000 --- a/src/orb/types/shared_params/new_accounting_sync_configuration_model.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable, Optional -from typing_extensions import Required, TypedDict - -__all__ = ["NewAccountingSyncConfigurationModel", "AccountingProvider"] - - -class AccountingProvider(TypedDict, total=False): - external_provider_id: Required[str] - - provider_type: Required[str] - - -class NewAccountingSyncConfigurationModel(TypedDict, total=False): - accounting_providers: Optional[Iterable[AccountingProvider]] - - excluded: Optional[bool] diff --git a/src/orb/types/shared_params/new_adjustment_model.py b/src/orb/types/shared_params/new_adjustment_model.py deleted file mode 100644 index ae21cea8..00000000 --- a/src/orb/types/shared_params/new_adjustment_model.py +++ /dev/null @@ -1,98 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union -from typing_extensions import Literal, Required, TypeAlias, TypedDict - -__all__ = [ - "NewAdjustmentModel", - "NewPercentageDiscount", - "NewUsageDiscount", - "NewAmountDiscount", - "NewMinimum", - "NewMaximum", -] - - -class NewPercentageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["percentage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - percentage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class NewUsageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["usage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - usage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class NewAmountDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["amount_discount"]] - - amount_discount: Required[str] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class NewMinimum(TypedDict, total=False): - adjustment_type: Required[Literal["minimum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - item_id: Required[str] - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class NewMaximum(TypedDict, total=False): - adjustment_type: Required[Literal["maximum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - maximum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -NewAdjustmentModel: TypeAlias = Union[ - NewPercentageDiscount, NewUsageDiscount, NewAmountDiscount, NewMinimum, NewMaximum -] diff --git a/src/orb/types/shared_params/new_allocation_price_model.py b/src/orb/types/shared_params/new_allocation_price_model.py deleted file mode 100644 index b63d61e7..00000000 --- a/src/orb/types/shared_params/new_allocation_price_model.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["NewAllocationPriceModel"] - - -class NewAllocationPriceModel(TypedDict, total=False): - amount: Required[str] - """An amount of the currency to allocate to the customer at the specified cadence.""" - - cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] - """The cadence at which to allocate the amount to the customer.""" - - currency: Required[str] - """ - An ISO 4217 currency string or a custom pricing unit identifier in which to bill - this price. - """ - - expires_at_end_of_cadence: Required[bool] - """ - Whether the allocated amount should expire at the end of the cadence or roll - over to the next period. - """ diff --git a/src/orb/types/shared_params/new_billing_cycle_configuration_model.py b/src/orb/types/shared_params/new_billing_cycle_configuration_model.py deleted file mode 100644 index d9bb5947..00000000 --- a/src/orb/types/shared_params/new_billing_cycle_configuration_model.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["NewBillingCycleConfigurationModel"] - - -class NewBillingCycleConfigurationModel(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" diff --git a/src/orb/types/shared_params/new_floating_price_model.py b/src/orb/types/shared_params/new_floating_price_model.py deleted file mode 100644 index e60593e2..00000000 --- a/src/orb/types/shared_params/new_floating_price_model.py +++ /dev/null @@ -1,1874 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Union, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict - -from .bps_config_model import BpsConfigModel -from .bulk_config_model import BulkConfigModel -from .unit_config_model import UnitConfigModel -from .matrix_config_model import MatrixConfigModel -from .tiered_config_model import TieredConfigModel -from .package_config_model import PackageConfigModel -from .bulk_bps_config_model import BulkBpsConfigModel -from .tiered_bps_config_model import TieredBpsConfigModel -from .custom_rating_function_config_model import CustomRatingFunctionConfigModel -from .matrix_with_allocation_config_model import MatrixWithAllocationConfigModel -from .new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel - -__all__ = [ - "NewFloatingPriceModel", - "NewFloatingUnitPrice", - "NewFloatingPackagePrice", - "NewFloatingMatrixPrice", - "NewFloatingMatrixWithAllocationPrice", - "NewFloatingTieredPrice", - "NewFloatingTieredBpsPrice", - "NewFloatingBpsPrice", - "NewFloatingBulkBpsPrice", - "NewFloatingBulkPrice", - "NewFloatingThresholdTotalAmountPrice", - "NewFloatingTieredPackagePrice", - "NewFloatingGroupedTieredPrice", - "NewFloatingMaxGroupTieredPackagePrice", - "NewFloatingTieredWithMinimumPrice", - "NewFloatingPackageWithAllocationPrice", - "NewFloatingTieredPackageWithMinimumPrice", - "NewFloatingUnitWithPercentPrice", - "NewFloatingTieredWithProrationPrice", - "NewFloatingUnitWithProrationPrice", - "NewFloatingGroupedAllocationPrice", - "NewFloatingGroupedWithProratedMinimumPrice", - "NewFloatingGroupedWithMeteredMinimumPrice", - "NewFloatingMatrixWithDisplayNamePrice", - "NewFloatingBulkWithProrationPrice", - "NewFloatingGroupedTieredPackagePrice", - "NewFloatingScalableMatrixWithUnitPricingPrice", - "NewFloatingScalableMatrixWithTieredPricingPrice", - "NewFloatingCumulativeGroupedBulkPrice", -] - - -class NewFloatingUnitPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit"]] - - name: Required[str] - """The name of the price.""" - - unit_config: Required[UnitConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package"]] - - name: Required[str] - """The name of the price.""" - - package_config: Required[PackageConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingMatrixPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_config: Required[MatrixConfigModel] - - model_type: Required[Literal["matrix"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_with_allocation_config: Required[MatrixWithAllocationConfigModel] - - model_type: Required[Literal["matrix_with_allocation"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingTieredPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered"]] - - name: Required[str] - """The name of the price.""" - - tiered_config: Required[TieredConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingTieredBpsPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_bps"]] - - name: Required[str] - """The name of the price.""" - - tiered_bps_config: Required[TieredBpsConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingBpsPrice(TypedDict, total=False): - bps_config: Required[BpsConfigModel] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[BulkBpsConfigModel] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingBulkPrice(TypedDict, total=False): - bulk_config: Required[BulkConfigModel] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["threshold_total_amount"]] - - name: Required[str] - """The name of the price.""" - - threshold_total_amount_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_package"]] - - name: Required[str] - """The name of the price.""" - - tiered_package_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingGroupedTieredPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_tiered_config: Required[CustomRatingFunctionConfigModel] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_tiered"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - max_group_tiered_package_config: Required[CustomRatingFunctionConfigModel] - - model_type: Required[Literal["max_group_tiered_package"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_minimum"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_minimum_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package_with_allocation"]] - - name: Required[str] - """The name of the price.""" - - package_with_allocation_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_package_with_minimum"]] - - name: Required[str] - """The name of the price.""" - - tiered_package_with_minimum_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingUnitWithPercentPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_percent"]] - - name: Required[str] - """The name of the price.""" - - unit_with_percent_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingTieredWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_proration"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_proration_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingUnitWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_proration"]] - - name: Required[str] - """The name of the price.""" - - unit_with_proration_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingGroupedAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_allocation_config: Required[CustomRatingFunctionConfigModel] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_allocation"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_with_prorated_minimum_config: Required[CustomRatingFunctionConfigModel] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_prorated_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_with_metered_minimum_config: Required[CustomRatingFunctionConfigModel] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_metered_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_with_display_name_config: Required[CustomRatingFunctionConfigModel] - - model_type: Required[Literal["matrix_with_display_name"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[CustomRatingFunctionConfigModel] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_with_proration"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_tiered_package_config: Required[CustomRatingFunctionConfigModel] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_tiered_package"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] - - name: Required[str] - """The name of the price.""" - - scalable_matrix_with_unit_pricing_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] - - name: Required[str] - """The name of the price.""" - - scalable_matrix_with_tiered_pricing_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - cumulative_grouped_bulk_config: Required[CustomRatingFunctionConfigModel] - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["cumulative_grouped_bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -NewFloatingPriceModel: TypeAlias = Union[ - NewFloatingUnitPrice, - NewFloatingPackagePrice, - NewFloatingMatrixPrice, - NewFloatingMatrixWithAllocationPrice, - NewFloatingTieredPrice, - NewFloatingTieredBpsPrice, - NewFloatingBpsPrice, - NewFloatingBulkBpsPrice, - NewFloatingBulkPrice, - NewFloatingThresholdTotalAmountPrice, - NewFloatingTieredPackagePrice, - NewFloatingGroupedTieredPrice, - NewFloatingMaxGroupTieredPackagePrice, - NewFloatingTieredWithMinimumPrice, - NewFloatingPackageWithAllocationPrice, - NewFloatingTieredPackageWithMinimumPrice, - NewFloatingUnitWithPercentPrice, - NewFloatingTieredWithProrationPrice, - NewFloatingUnitWithProrationPrice, - NewFloatingGroupedAllocationPrice, - NewFloatingGroupedWithProratedMinimumPrice, - NewFloatingGroupedWithMeteredMinimumPrice, - NewFloatingMatrixWithDisplayNamePrice, - NewFloatingBulkWithProrationPrice, - NewFloatingGroupedTieredPackagePrice, - NewFloatingScalableMatrixWithUnitPricingPrice, - NewFloatingScalableMatrixWithTieredPricingPrice, - NewFloatingCumulativeGroupedBulkPrice, -] diff --git a/src/orb/types/shared_params/new_reporting_configuration_model.py b/src/orb/types/shared_params/new_reporting_configuration_model.py deleted file mode 100644 index 748042d1..00000000 --- a/src/orb/types/shared_params/new_reporting_configuration_model.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["NewReportingConfigurationModel"] - - -class NewReportingConfigurationModel(TypedDict, total=False): - exempt: Required[bool] diff --git a/src/orb/types/shared_params/new_subscription_price_model.py b/src/orb/types/shared_params/new_subscription_price_model.py deleted file mode 100644 index eb39147a..00000000 --- a/src/orb/types/shared_params/new_subscription_price_model.py +++ /dev/null @@ -1,1900 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Union, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict - -from .bps_config_model import BpsConfigModel -from .bulk_config_model import BulkConfigModel -from .unit_config_model import UnitConfigModel -from .matrix_config_model import MatrixConfigModel -from .tiered_config_model import TieredConfigModel -from .package_config_model import PackageConfigModel -from .bulk_bps_config_model import BulkBpsConfigModel -from .tiered_bps_config_model import TieredBpsConfigModel -from .custom_rating_function_config_model import CustomRatingFunctionConfigModel -from .new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel - -__all__ = [ - "NewSubscriptionPriceModel", - "NewSubscriptionUnitPrice", - "NewSubscriptionPackagePrice", - "NewSubscriptionMatrixPrice", - "NewSubscriptionTieredPrice", - "NewSubscriptionTieredBpsPrice", - "NewSubscriptionBpsPrice", - "NewSubscriptionBulkBpsPrice", - "NewSubscriptionBulkPrice", - "NewSubscriptionThresholdTotalAmountPrice", - "NewSubscriptionTieredPackagePrice", - "NewSubscriptionTieredWithMinimumPrice", - "NewSubscriptionUnitWithPercentPrice", - "NewSubscriptionPackageWithAllocationPrice", - "NewSubscriptionTierWithProrationPrice", - "NewSubscriptionUnitWithProrationPrice", - "NewSubscriptionGroupedAllocationPrice", - "NewSubscriptionGroupedWithProratedMinimumPrice", - "NewSubscriptionBulkWithProrationPrice", - "NewSubscriptionScalableMatrixWithUnitPricingPrice", - "NewSubscriptionScalableMatrixWithTieredPricingPrice", - "NewSubscriptionCumulativeGroupedBulkPrice", - "NewSubscriptionMaxGroupTieredPackagePrice", - "NewSubscriptionGroupedWithMeteredMinimumPrice", - "NewSubscriptionMatrixWithDisplayNamePrice", - "NewSubscriptionGroupedTieredPackagePrice", -] - - -class NewSubscriptionUnitPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit"]] - - name: Required[str] - """The name of the price.""" - - unit_config: Required[UnitConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package"]] - - name: Required[str] - """The name of the price.""" - - package_config: Required[PackageConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionMatrixPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_config: Required[MatrixConfigModel] - - model_type: Required[Literal["matrix"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionTieredPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered"]] - - name: Required[str] - """The name of the price.""" - - tiered_config: Required[TieredConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionTieredBpsPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_bps"]] - - name: Required[str] - """The name of the price.""" - - tiered_bps_config: Required[TieredBpsConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionBpsPrice(TypedDict, total=False): - bps_config: Required[BpsConfigModel] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[BulkBpsConfigModel] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionBulkPrice(TypedDict, total=False): - bulk_config: Required[BulkConfigModel] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["threshold_total_amount"]] - - name: Required[str] - """The name of the price.""" - - threshold_total_amount_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_package"]] - - name: Required[str] - """The name of the price.""" - - tiered_package_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_minimum"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_minimum_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionUnitWithPercentPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_percent"]] - - name: Required[str] - """The name of the price.""" - - unit_with_percent_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package_with_allocation"]] - - name: Required[str] - """The name of the price.""" - - package_with_allocation_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionTierWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_proration"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_proration_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionUnitWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_proration"]] - - name: Required[str] - """The name of the price.""" - - unit_with_proration_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionGroupedAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_allocation_config: Required[CustomRatingFunctionConfigModel] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_allocation"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_with_prorated_minimum_config: Required[CustomRatingFunctionConfigModel] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_prorated_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[CustomRatingFunctionConfigModel] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_with_proration"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionScalableMatrixWithUnitPricingPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] - - name: Required[str] - """The name of the price.""" - - scalable_matrix_with_unit_pricing_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionScalableMatrixWithTieredPricingPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] - - name: Required[str] - """The name of the price.""" - - scalable_matrix_with_tiered_pricing_config: Required[CustomRatingFunctionConfigModel] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionCumulativeGroupedBulkPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - cumulative_grouped_bulk_config: Required[CustomRatingFunctionConfigModel] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["cumulative_grouped_bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionMaxGroupTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - max_group_tiered_package_config: Required[CustomRatingFunctionConfigModel] - - model_type: Required[Literal["max_group_tiered_package"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionGroupedWithMeteredMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_with_metered_minimum_config: Required[CustomRatingFunctionConfigModel] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_metered_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionMatrixWithDisplayNamePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_with_display_name_config: Required[CustomRatingFunctionConfigModel] - - model_type: Required[Literal["matrix_with_display_name"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class NewSubscriptionGroupedTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_tiered_package_config: Required[CustomRatingFunctionConfigModel] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_tiered_package"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -NewSubscriptionPriceModel: TypeAlias = Union[ - NewSubscriptionUnitPrice, - NewSubscriptionPackagePrice, - NewSubscriptionMatrixPrice, - NewSubscriptionTieredPrice, - NewSubscriptionTieredBpsPrice, - NewSubscriptionBpsPrice, - NewSubscriptionBulkBpsPrice, - NewSubscriptionBulkPrice, - NewSubscriptionThresholdTotalAmountPrice, - NewSubscriptionTieredPackagePrice, - NewSubscriptionTieredWithMinimumPrice, - NewSubscriptionUnitWithPercentPrice, - NewSubscriptionPackageWithAllocationPrice, - NewSubscriptionTierWithProrationPrice, - NewSubscriptionUnitWithProrationPrice, - NewSubscriptionGroupedAllocationPrice, - NewSubscriptionGroupedWithProratedMinimumPrice, - NewSubscriptionBulkWithProrationPrice, - NewSubscriptionScalableMatrixWithUnitPricingPrice, - NewSubscriptionScalableMatrixWithTieredPricingPrice, - NewSubscriptionCumulativeGroupedBulkPrice, - NewSubscriptionMaxGroupTieredPackagePrice, - NewSubscriptionGroupedWithMeteredMinimumPrice, - NewSubscriptionMatrixWithDisplayNamePrice, - NewSubscriptionGroupedTieredPackagePrice, -] diff --git a/src/orb/types/shared_params/new_tax_configuration_model.py b/src/orb/types/shared_params/new_tax_configuration_model.py deleted file mode 100644 index c0d0f650..00000000 --- a/src/orb/types/shared_params/new_tax_configuration_model.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict - -__all__ = ["NewTaxConfigurationModel", "NewAvalaraTaxConfiguration", "NewTaxJarConfiguration"] - - -class NewAvalaraTaxConfiguration(TypedDict, total=False): - tax_exempt: Required[bool] - - tax_provider: Required[Literal["avalara"]] - - tax_exemption_code: Optional[str] - - -class NewTaxJarConfiguration(TypedDict, total=False): - tax_exempt: Required[bool] - - tax_provider: Required[Literal["taxjar"]] - - -NewTaxConfigurationModel: TypeAlias = Union[NewAvalaraTaxConfiguration, NewTaxJarConfiguration] diff --git a/src/orb/types/shared_params/package_config_model.py b/src/orb/types/shared_params/package_config_model.py deleted file mode 100644 index 5cc856ae..00000000 --- a/src/orb/types/shared_params/package_config_model.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["PackageConfigModel"] - - -class PackageConfigModel(TypedDict, total=False): - package_amount: Required[str] - """A currency amount to rate usage by""" - - package_size: Required[int] - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ diff --git a/src/orb/types/shared_params/price_interval_fixed_fee_quantity_transition_model.py b/src/orb/types/shared_params/price_interval_fixed_fee_quantity_transition_model.py deleted file mode 100644 index e6b4ac63..00000000 --- a/src/orb/types/shared_params/price_interval_fixed_fee_quantity_transition_model.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from datetime import datetime -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["PriceIntervalFixedFeeQuantityTransitionModel"] - - -class PriceIntervalFixedFeeQuantityTransitionModel(TypedDict, total=False): - effective_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] - """The date that the fixed fee quantity transition should take effect.""" - - quantity: Required[int] - """The quantity of the fixed fee quantity transition.""" diff --git a/src/orb/types/shared_params/replace_subscription_adjustment_params.py b/src/orb/types/shared_params/replace_subscription_adjustment_params.py index 01442cc5..c024bfad 100644 --- a/src/orb/types/shared_params/replace_subscription_adjustment_params.py +++ b/src/orb/types/shared_params/replace_subscription_adjustment_params.py @@ -2,15 +2,109 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import List, Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .new_adjustment_model import NewAdjustmentModel +__all__ = [ + "ReplaceSubscriptionAdjustmentParams", + "Adjustment", + "AdjustmentNewPercentageDiscount", + "AdjustmentNewUsageDiscount", + "AdjustmentNewAmountDiscount", + "AdjustmentNewMinimum", + "AdjustmentNewMaximum", +] -__all__ = ["ReplaceSubscriptionAdjustmentParams"] + +class AdjustmentNewPercentageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["percentage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + percentage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewUsageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["usage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + usage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewAmountDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["amount_discount"]] + + amount_discount: Required[str] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewMinimum(TypedDict, total=False): + adjustment_type: Required[Literal["minimum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + item_id: Required[str] + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AdjustmentNewMaximum(TypedDict, total=False): + adjustment_type: Required[Literal["maximum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + maximum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +Adjustment: TypeAlias = Union[ + AdjustmentNewPercentageDiscount, + AdjustmentNewUsageDiscount, + AdjustmentNewAmountDiscount, + AdjustmentNewMinimum, + AdjustmentNewMaximum, +] class ReplaceSubscriptionAdjustmentParams(TypedDict, total=False): - adjustment: Required[NewAdjustmentModel] + adjustment: Required[Adjustment] """The definition of a new adjustment to create and add to the subscription.""" replaces_adjustment_id: Required[str] diff --git a/src/orb/types/shared_params/replace_subscription_price_params.py b/src/orb/types/shared_params/replace_subscription_price_params.py index 5b426259..321efcca 100644 --- a/src/orb/types/shared_params/replace_subscription_price_params.py +++ b/src/orb/types/shared_params/replace_subscription_price_params.py @@ -2,24 +2,2536 @@ from __future__ import annotations -from typing import Iterable, Optional -from typing_extensions import Required, TypedDict +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .discount_override_model import DiscountOverrideModel -from .new_allocation_price_model import NewAllocationPriceModel -from .new_subscription_price_model import NewSubscriptionPriceModel +__all__ = [ + "ReplaceSubscriptionPriceParams", + "AllocationPrice", + "Discount", + "Price", + "PriceNewSubscriptionUnitPrice", + "PriceNewSubscriptionUnitPriceUnitConfig", + "PriceNewSubscriptionUnitPriceBillingCycleConfiguration", + "PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionPackagePrice", + "PriceNewSubscriptionPackagePricePackageConfig", + "PriceNewSubscriptionPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionMatrixPrice", + "PriceNewSubscriptionMatrixPriceMatrixConfig", + "PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", + "PriceNewSubscriptionMatrixPriceBillingCycleConfiguration", + "PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredPrice", + "PriceNewSubscriptionTieredPriceTieredConfig", + "PriceNewSubscriptionTieredPriceTieredConfigTier", + "PriceNewSubscriptionTieredPriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredBpsPrice", + "PriceNewSubscriptionTieredBpsPriceTieredBpsConfig", + "PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", + "PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBpsPrice", + "PriceNewSubscriptionBpsPriceBpsConfig", + "PriceNewSubscriptionBpsPriceBillingCycleConfiguration", + "PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBulkBpsPrice", + "PriceNewSubscriptionBulkBpsPriceBulkBpsConfig", + "PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", + "PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", + "PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBulkPrice", + "PriceNewSubscriptionBulkPriceBulkConfig", + "PriceNewSubscriptionBulkPriceBulkConfigTier", + "PriceNewSubscriptionBulkPriceBillingCycleConfiguration", + "PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionThresholdTotalAmountPrice", + "PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", + "PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredPackagePrice", + "PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTieredWithMinimumPrice", + "PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", + "PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionUnitWithPercentPrice", + "PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", + "PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionPackageWithAllocationPrice", + "PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", + "PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionTierWithProrationPrice", + "PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", + "PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionUnitWithProrationPrice", + "PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", + "PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedAllocationPrice", + "PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedWithProratedMinimumPrice", + "PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionBulkWithProrationPrice", + "PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", + "PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithUnitPricingPrice", + "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithTieredPricingPrice", + "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionCumulativeGroupedBulkPrice", + "PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration", + "PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionMaxGroupTieredPackagePrice", + "PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedWithMeteredMinimumPrice", + "PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", + "PriceNewSubscriptionMatrixWithDisplayNamePrice", + "PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration", + "PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration", + "PriceNewSubscriptionGroupedTieredPackagePrice", + "PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration", + "PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration", +] -__all__ = ["ReplaceSubscriptionPriceParams"] + +class AllocationPrice(TypedDict, total=False): + amount: Required[str] + """An amount of the currency to allocate to the customer at the specified cadence.""" + + cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] + """The cadence at which to allocate the amount to the customer.""" + + currency: Required[str] + """ + An ISO 4217 currency string or a custom pricing unit identifier in which to bill + this price. + """ + + expires_at_end_of_cadence: Required[bool] + """ + Whether the allocated amount should expire at the end of the cadence or roll + over to the next period. + """ + + +class Discount(TypedDict, total=False): + discount_type: Required[Literal["percentage", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class PriceNewSubscriptionUnitPriceUnitConfig(TypedDict, total=False): + unit_amount: Required[str] + """Rate per unit of usage""" + + +class PriceNewSubscriptionUnitPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit"]] + + name: Required[str] + """The name of the price.""" + + unit_config: Required[PriceNewSubscriptionUnitPriceUnitConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionPackagePricePackageConfig(TypedDict, total=False): + package_amount: Required[str] + """A currency amount to rate usage by""" + + package_size: Required[int] + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + +class PriceNewSubscriptionPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package"]] + + name: Required[str] + """The name of the price.""" + + package_config: Required[PriceNewSubscriptionPackagePricePackageConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): + dimension_values: Required[List[Optional[str]]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: Required[str] + """Unit price for the specified dimension_values""" + + +class PriceNewSubscriptionMatrixPriceMatrixConfig(TypedDict, total=False): + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue]] + """Matrix values for specified matrix grouping keys""" + + +class PriceNewSubscriptionMatrixPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_config: Required[PriceNewSubscriptionMatrixPriceMatrixConfig] + + model_type: Required[Literal["matrix"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredPriceTieredConfigTier(TypedDict, total=False): + first_unit: Required[float] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + last_unit: Optional[float] + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class PriceNewSubscriptionTieredPriceTieredConfig(TypedDict, total=False): + tiers: Required[Iterable[PriceNewSubscriptionTieredPriceTieredConfigTier]] + """Tiers for rating based on total usage quantities into the specified tier""" + + +class PriceNewSubscriptionTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered"]] + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[PriceNewSubscriptionTieredPriceTieredConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Per-event basis point rate""" + + minimum_amount: Required[str] + """Inclusive tier starting value""" + + maximum_amount: Optional[str] + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] + """Per unit maximum to charge""" + + +class PriceNewSubscriptionTieredBpsPriceTieredBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier]] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + +class PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredBpsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_bps"]] + + name: Required[str] + """The name of the price.""" + + tiered_bps_config: Required[PriceNewSubscriptionTieredBpsPriceTieredBpsConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBpsPriceBpsConfig(TypedDict, total=False): + bps: Required[float] + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] + """Optional currency amount maximum to cap spend per event""" + + +class PriceNewSubscriptionBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBpsPrice(TypedDict, total=False): + bps_config: Required[PriceNewSubscriptionBpsPriceBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Basis points to rate on""" + + maximum_amount: Optional[str] + """Upper bound for tier""" + + per_unit_maximum: Optional[str] + """The maximum amount to charge for any one event""" + + +class PriceNewSubscriptionBulkBpsPriceBulkBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier]] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ + + +class PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkBpsPrice(TypedDict, total=False): + bulk_bps_config: Required[PriceNewSubscriptionBulkBpsPriceBulkBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBulkPriceBulkConfigTier(TypedDict, total=False): + unit_amount: Required[str] + """Amount per unit""" + + maximum_units: Optional[float] + """Upper bound for this tier""" + + +class PriceNewSubscriptionBulkPriceBulkConfig(TypedDict, total=False): + tiers: Required[Iterable[PriceNewSubscriptionBulkPriceBulkConfigTier]] + """Bulk tiers for rating based on total usage volume""" + + +class PriceNewSubscriptionBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkPrice(TypedDict, total=False): + bulk_config: Required[PriceNewSubscriptionBulkPriceBulkConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["threshold_total_amount"]] + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_package"]] + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_minimum"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_percent"]] + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package_with_allocation"]] + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionTierWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_proration"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_proration"]] + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_allocation"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[Dict[str, object]] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_with_proration"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionScalableMatrixWithTieredPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionCumulativeGroupedBulkPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["cumulative_grouped_bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: Required[Dict[str, object]] + + model_type: Required[Literal["max_group_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_metered_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_with_display_name_config: Required[Dict[str, object]] + + model_type: Required[Literal["matrix_with_display_name"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewSubscriptionGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +Price: TypeAlias = Union[ + PriceNewSubscriptionUnitPrice, + PriceNewSubscriptionPackagePrice, + PriceNewSubscriptionMatrixPrice, + PriceNewSubscriptionTieredPrice, + PriceNewSubscriptionTieredBpsPrice, + PriceNewSubscriptionBpsPrice, + PriceNewSubscriptionBulkBpsPrice, + PriceNewSubscriptionBulkPrice, + PriceNewSubscriptionThresholdTotalAmountPrice, + PriceNewSubscriptionTieredPackagePrice, + PriceNewSubscriptionTieredWithMinimumPrice, + PriceNewSubscriptionUnitWithPercentPrice, + PriceNewSubscriptionPackageWithAllocationPrice, + PriceNewSubscriptionTierWithProrationPrice, + PriceNewSubscriptionUnitWithProrationPrice, + PriceNewSubscriptionGroupedAllocationPrice, + PriceNewSubscriptionGroupedWithProratedMinimumPrice, + PriceNewSubscriptionBulkWithProrationPrice, + PriceNewSubscriptionScalableMatrixWithUnitPricingPrice, + PriceNewSubscriptionScalableMatrixWithTieredPricingPrice, + PriceNewSubscriptionCumulativeGroupedBulkPrice, + PriceNewSubscriptionMaxGroupTieredPackagePrice, + PriceNewSubscriptionGroupedWithMeteredMinimumPrice, + PriceNewSubscriptionMatrixWithDisplayNamePrice, + PriceNewSubscriptionGroupedTieredPackagePrice, +] class ReplaceSubscriptionPriceParams(TypedDict, total=False): replaces_price_id: Required[str] """The id of the price on the plan to replace in the subscription.""" - allocation_price: Optional[NewAllocationPriceModel] + allocation_price: Optional[AllocationPrice] """The definition of a new allocation price to create and add to the subscription.""" - discounts: Optional[Iterable[DiscountOverrideModel]] + discounts: Optional[Iterable[Discount]] """[DEPRECATED] Use add_adjustments instead. The subscription's discounts for the replacement price. @@ -43,7 +2555,7 @@ class ReplaceSubscriptionPriceParams(TypedDict, total=False): The subscription's minimum amount for the replacement price. """ - price: Optional[NewSubscriptionPriceModel] + price: Optional[Price] """The definition of a new price to create and add to the subscription.""" price_id: Optional[str] diff --git a/src/orb/types/shared_params/threshold_model.py b/src/orb/types/shared_params/threshold_model.py deleted file mode 100644 index 85667b79..00000000 --- a/src/orb/types/shared_params/threshold_model.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["ThresholdModel"] - - -class ThresholdModel(TypedDict, total=False): - value: Required[float] - """The value at which an alert will fire. - - For credit balance alerts, the alert will fire at or below this value. For usage - and cost alerts, the alert will fire at or above this value. - """ diff --git a/src/orb/types/shared_params/tiered_bps_config_model.py b/src/orb/types/shared_params/tiered_bps_config_model.py deleted file mode 100644 index 992429d8..00000000 --- a/src/orb/types/shared_params/tiered_bps_config_model.py +++ /dev/null @@ -1,30 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable, Optional -from typing_extensions import Required, TypedDict - -__all__ = ["TieredBpsConfigModel", "Tier"] - - -class Tier(TypedDict, total=False): - bps: Required[float] - """Per-event basis point rate""" - - minimum_amount: Required[str] - """Inclusive tier starting value""" - - maximum_amount: Optional[str] - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] - """Per unit maximum to charge""" - - -class TieredBpsConfigModel(TypedDict, total=False): - tiers: Required[Iterable[Tier]] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ diff --git a/src/orb/types/shared_params/tiered_config_model.py b/src/orb/types/shared_params/tiered_config_model.py deleted file mode 100644 index a3b888c0..00000000 --- a/src/orb/types/shared_params/tiered_config_model.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable, Optional -from typing_extensions import Required, TypedDict - -__all__ = ["TieredConfigModel", "Tier"] - - -class Tier(TypedDict, total=False): - first_unit: Required[float] - """Inclusive tier starting value""" - - unit_amount: Required[str] - """Amount per unit""" - - last_unit: Optional[float] - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class TieredConfigModel(TypedDict, total=False): - tiers: Required[Iterable[Tier]] - """Tiers for rating based on total usage quantities into the specified tier""" diff --git a/src/orb/types/shared_params/unit_config_model.py b/src/orb/types/shared_params/unit_config_model.py deleted file mode 100644 index 593a5b3f..00000000 --- a/src/orb/types/shared_params/unit_config_model.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["UnitConfigModel"] - - -class UnitConfigModel(TypedDict, total=False): - unit_amount: Required[str] - """Rate per unit of usage""" diff --git a/src/orb/types/subscription.py b/src/orb/types/subscription.py new file mode 100644 index 00000000..f6118f04 --- /dev/null +++ b/src/orb/types/subscription.py @@ -0,0 +1,555 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from .plan import Plan +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .customer import Customer + +__all__ = [ + "Subscription", + "AdjustmentInterval", + "AdjustmentIntervalAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", + "BillingCycleAnchorConfiguration", + "DiscountInterval", + "DiscountIntervalAmountDiscountInterval", + "DiscountIntervalPercentageDiscountInterval", + "DiscountIntervalUsageDiscountInterval", + "FixedFeeQuantitySchedule", + "MaximumInterval", + "MinimumInterval", + "PriceInterval", + "PriceIntervalFixedFeeQuantityTransition", + "RedeemedCoupon", + "TrialInfo", +] + + +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(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. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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.""" + + +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + 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 AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + 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.""" + + +AdjustmentIntervalAdjustment: TypeAlias = Annotated[ + Union[ + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class AdjustmentInterval(BaseModel): + id: str + + adjustment: AdjustmentIntervalAdjustment + + applies_to_price_interval_ids: List[str] + """The price interval IDs that this adjustment applies to.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval.""" + + start_date: datetime + """The start date of the adjustment interval.""" + + +class BillingCycleAnchorConfiguration(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + +class DiscountIntervalAmountDiscountInterval(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["amount"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalPercentageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["percentage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + percentage_discount: float + """ + Only available if discount_type is `percentage`.This is a number between 0 + and 1. + """ + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalUsageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["usage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +DiscountInterval: TypeAlias = Annotated[ + Union[ + DiscountIntervalAmountDiscountInterval, + DiscountIntervalPercentageDiscountInterval, + DiscountIntervalUsageDiscountInterval, + ], + PropertyInfo(discriminator="discount_type"), +] + + +class FixedFeeQuantitySchedule(BaseModel): + end_date: Optional[datetime] = None + + price_id: str + + quantity: float + + start_date: datetime + + +class MaximumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this maximum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this maximum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the maximum interval.""" + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the price intervals + this transform applies to. + """ + + start_date: datetime + """The start date of the maximum interval.""" + + +class MinimumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this minimum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this minimum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the minimum interval.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the price intervals + this minimum applies to. + """ + + start_date: datetime + """The start date of the minimum interval.""" + + +class PriceIntervalFixedFeeQuantityTransition(BaseModel): + effective_date: datetime + + price_id: str + + quantity: int + + +class PriceInterval(BaseModel): + id: str + + billing_cycle_day: int + """The day of the month that Orb bills for this price""" + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is exactly the + end of the billing period. Set to null if this price interval is not currently + active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if this price interval is not currently active. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that Orb stops billing for this price. + """ + + filter: Optional[str] = None + """An additional filter to apply to usage queries.""" + + fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None + """The fixed fee quantity transitions for this price interval. + + This is only relevant for fixed fees. + """ + + price: Price + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + start_date: datetime + """The start date of the price interval. + + This is the date that Orb starts billing for this price. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer IDs whose usage events will be aggregated and billed under + this price interval. + """ + + +class RedeemedCoupon(BaseModel): + coupon_id: str + + end_date: Optional[datetime] = None + + start_date: datetime + + +class TrialInfo(BaseModel): + end_date: Optional[datetime] = None + + +class Subscription(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentInterval] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: Customer + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumInterval] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumInterval] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: Plan + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceInterval] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[RedeemedCoupon] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: TrialInfo diff --git a/src/orb/types/subscription_cancel_response.py b/src/orb/types/subscription_cancel_response.py new file mode 100644 index 00000000..797ecfe3 --- /dev/null +++ b/src/orb/types/subscription_cancel_response.py @@ -0,0 +1,555 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from .plan import Plan +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .customer import Customer + +__all__ = [ + "SubscriptionCancelResponse", + "AdjustmentInterval", + "AdjustmentIntervalAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", + "BillingCycleAnchorConfiguration", + "DiscountInterval", + "DiscountIntervalAmountDiscountInterval", + "DiscountIntervalPercentageDiscountInterval", + "DiscountIntervalUsageDiscountInterval", + "FixedFeeQuantitySchedule", + "MaximumInterval", + "MinimumInterval", + "PriceInterval", + "PriceIntervalFixedFeeQuantityTransition", + "RedeemedCoupon", + "TrialInfo", +] + + +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(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. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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.""" + + +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + 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 AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + 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.""" + + +AdjustmentIntervalAdjustment: TypeAlias = Annotated[ + Union[ + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class AdjustmentInterval(BaseModel): + id: str + + adjustment: AdjustmentIntervalAdjustment + + applies_to_price_interval_ids: List[str] + """The price interval IDs that this adjustment applies to.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval.""" + + start_date: datetime + """The start date of the adjustment interval.""" + + +class BillingCycleAnchorConfiguration(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + +class DiscountIntervalAmountDiscountInterval(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["amount"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalPercentageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["percentage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + percentage_discount: float + """ + Only available if discount_type is `percentage`.This is a number between 0 + and 1. + """ + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalUsageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["usage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +DiscountInterval: TypeAlias = Annotated[ + Union[ + DiscountIntervalAmountDiscountInterval, + DiscountIntervalPercentageDiscountInterval, + DiscountIntervalUsageDiscountInterval, + ], + PropertyInfo(discriminator="discount_type"), +] + + +class FixedFeeQuantitySchedule(BaseModel): + end_date: Optional[datetime] = None + + price_id: str + + quantity: float + + start_date: datetime + + +class MaximumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this maximum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this maximum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the maximum interval.""" + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the price intervals + this transform applies to. + """ + + start_date: datetime + """The start date of the maximum interval.""" + + +class MinimumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this minimum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this minimum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the minimum interval.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the price intervals + this minimum applies to. + """ + + start_date: datetime + """The start date of the minimum interval.""" + + +class PriceIntervalFixedFeeQuantityTransition(BaseModel): + effective_date: datetime + + price_id: str + + quantity: int + + +class PriceInterval(BaseModel): + id: str + + billing_cycle_day: int + """The day of the month that Orb bills for this price""" + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is exactly the + end of the billing period. Set to null if this price interval is not currently + active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if this price interval is not currently active. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that Orb stops billing for this price. + """ + + filter: Optional[str] = None + """An additional filter to apply to usage queries.""" + + fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None + """The fixed fee quantity transitions for this price interval. + + This is only relevant for fixed fees. + """ + + price: Price + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + start_date: datetime + """The start date of the price interval. + + This is the date that Orb starts billing for this price. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer IDs whose usage events will be aggregated and billed under + this price interval. + """ + + +class RedeemedCoupon(BaseModel): + coupon_id: str + + end_date: Optional[datetime] = None + + start_date: datetime + + +class TrialInfo(BaseModel): + end_date: Optional[datetime] = None + + +class SubscriptionCancelResponse(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentInterval] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: Customer + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumInterval] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumInterval] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: Plan + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceInterval] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[RedeemedCoupon] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: TrialInfo diff --git a/src/orb/types/subscription_create_params.py b/src/orb/types/subscription_create_params.py index c5c9d73c..3ef2b5ee 100644 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -4,7 +4,7 @@ from typing import Dict, List, Union, Iterable, Optional from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo from .shared_params.add_subscription_price_params import AddSubscriptionPriceParams @@ -13,9 +13,8 @@ from .shared_params.add_subscription_adjustment_params import AddSubscriptionAdjustmentParams from .shared_params.remove_subscription_adjustment_params import RemoveSubscriptionAdjustmentParams from .shared_params.replace_subscription_adjustment_params import ReplaceSubscriptionAdjustmentParams -from .shared_params.billing_cycle_anchor_configuration_model import BillingCycleAnchorConfigurationModel -__all__ = ["SubscriptionCreateParams"] +__all__ = ["SubscriptionCreateParams", "BillingCycleAnchorConfiguration"] class SubscriptionCreateParams(TypedDict, total=False): @@ -44,7 +43,7 @@ class SubscriptionCreateParams(TypedDict, total=False): aws_region: Optional[str] - billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfigurationModel] + billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfiguration] coupon_redemption_code: Optional[str] """Redemption code to be used for this subscription. @@ -173,3 +172,27 @@ class SubscriptionCreateParams(TypedDict, total=False): only. Provided usage_customer_ids must be either the customer for this subscription itself, or any of that customer's children. """ + + +class BillingCycleAnchorConfiguration(TypedDict, total=False): + day: Required[int] + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ diff --git a/src/orb/types/subscription_create_response.py b/src/orb/types/subscription_create_response.py new file mode 100644 index 00000000..5a494c5f --- /dev/null +++ b/src/orb/types/subscription_create_response.py @@ -0,0 +1,555 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from .plan import Plan +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .customer import Customer + +__all__ = [ + "SubscriptionCreateResponse", + "AdjustmentInterval", + "AdjustmentIntervalAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", + "BillingCycleAnchorConfiguration", + "DiscountInterval", + "DiscountIntervalAmountDiscountInterval", + "DiscountIntervalPercentageDiscountInterval", + "DiscountIntervalUsageDiscountInterval", + "FixedFeeQuantitySchedule", + "MaximumInterval", + "MinimumInterval", + "PriceInterval", + "PriceIntervalFixedFeeQuantityTransition", + "RedeemedCoupon", + "TrialInfo", +] + + +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(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. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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.""" + + +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + 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 AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + 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.""" + + +AdjustmentIntervalAdjustment: TypeAlias = Annotated[ + Union[ + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class AdjustmentInterval(BaseModel): + id: str + + adjustment: AdjustmentIntervalAdjustment + + applies_to_price_interval_ids: List[str] + """The price interval IDs that this adjustment applies to.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval.""" + + start_date: datetime + """The start date of the adjustment interval.""" + + +class BillingCycleAnchorConfiguration(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + +class DiscountIntervalAmountDiscountInterval(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["amount"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalPercentageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["percentage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + percentage_discount: float + """ + Only available if discount_type is `percentage`.This is a number between 0 + and 1. + """ + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalUsageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["usage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +DiscountInterval: TypeAlias = Annotated[ + Union[ + DiscountIntervalAmountDiscountInterval, + DiscountIntervalPercentageDiscountInterval, + DiscountIntervalUsageDiscountInterval, + ], + PropertyInfo(discriminator="discount_type"), +] + + +class FixedFeeQuantitySchedule(BaseModel): + end_date: Optional[datetime] = None + + price_id: str + + quantity: float + + start_date: datetime + + +class MaximumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this maximum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this maximum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the maximum interval.""" + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the price intervals + this transform applies to. + """ + + start_date: datetime + """The start date of the maximum interval.""" + + +class MinimumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this minimum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this minimum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the minimum interval.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the price intervals + this minimum applies to. + """ + + start_date: datetime + """The start date of the minimum interval.""" + + +class PriceIntervalFixedFeeQuantityTransition(BaseModel): + effective_date: datetime + + price_id: str + + quantity: int + + +class PriceInterval(BaseModel): + id: str + + billing_cycle_day: int + """The day of the month that Orb bills for this price""" + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is exactly the + end of the billing period. Set to null if this price interval is not currently + active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if this price interval is not currently active. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that Orb stops billing for this price. + """ + + filter: Optional[str] = None + """An additional filter to apply to usage queries.""" + + fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None + """The fixed fee quantity transitions for this price interval. + + This is only relevant for fixed fees. + """ + + price: Price + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + start_date: datetime + """The start date of the price interval. + + This is the date that Orb starts billing for this price. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer IDs whose usage events will be aggregated and billed under + this price interval. + """ + + +class RedeemedCoupon(BaseModel): + coupon_id: str + + end_date: Optional[datetime] = None + + start_date: datetime + + +class TrialInfo(BaseModel): + end_date: Optional[datetime] = None + + +class SubscriptionCreateResponse(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentInterval] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: Customer + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumInterval] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumInterval] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: Plan + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceInterval] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[RedeemedCoupon] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: TrialInfo diff --git a/src/orb/types/subscription_fetch_costs_response.py b/src/orb/types/subscription_fetch_costs_response.py index 9aec8dc3..64d9c0be 100644 --- a/src/orb/types/subscription_fetch_costs_response.py +++ b/src/orb/types/subscription_fetch_costs_response.py @@ -1,12 +1,44 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional +from datetime import datetime +from .price import Price from .._models import BaseModel -from .shared.aggregated_cost_model import AggregatedCostModel -__all__ = ["SubscriptionFetchCostsResponse"] +__all__ = ["SubscriptionFetchCostsResponse", "Data", "DataPerPriceCost"] + + +class DataPerPriceCost(BaseModel): + price: Price + """The price object""" + + price_id: str + """The price the cost is associated with""" + + subtotal: str + """Price's contributions for the timeframe, excluding any minimums and discounts.""" + + total: str + """Price's contributions for the timeframe, including minimums and discounts.""" + + quantity: Optional[float] = None + """The price's quantity for the timeframe""" + + +class Data(BaseModel): + per_price_costs: List[DataPerPriceCost] + + subtotal: str + """Total costs for the timeframe, excluding any minimums and discounts.""" + + timeframe_end: datetime + + timeframe_start: datetime + + total: str + """Total costs for the timeframe, including any minimums and discounts.""" class SubscriptionFetchCostsResponse(BaseModel): - data: List[AggregatedCostModel] + data: List[Data] diff --git a/src/orb/types/subscription_fetch_schedule_response.py b/src/orb/types/subscription_fetch_schedule_response.py index 7b82a9dd..38a3999c 100644 --- a/src/orb/types/subscription_fetch_schedule_response.py +++ b/src/orb/types/subscription_fetch_schedule_response.py @@ -4,9 +4,21 @@ from datetime import datetime from .._models import BaseModel -from .shared.plan_minified_model import PlanMinifiedModel -__all__ = ["SubscriptionFetchScheduleResponse"] +__all__ = ["SubscriptionFetchScheduleResponse", "Plan"] + + +class Plan(BaseModel): + id: Optional[str] = None + + external_plan_id: Optional[str] = None + """ + An optional user-defined ID for this plan resource, used throughout the system + as an alias for this Plan. Use this field to identify a plan by an existing + identifier in your system. + """ + + name: Optional[str] = None class SubscriptionFetchScheduleResponse(BaseModel): @@ -14,6 +26,6 @@ class SubscriptionFetchScheduleResponse(BaseModel): end_date: Optional[datetime] = None - plan: PlanMinifiedModel + plan: Plan start_date: datetime diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index c9a7ad70..0ae10958 100644 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -2,28 +2,131 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional +from typing import Dict, List, Union, Iterable, Optional from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo from .shared.billing_cycle_relative_date import BillingCycleRelativeDate -from .shared_params.new_adjustment_model import NewAdjustmentModel -from .shared_params.new_floating_price_model import NewFloatingPriceModel -from .shared_params.new_allocation_price_model import NewAllocationPriceModel -from .shared_params.price_interval_fixed_fee_quantity_transition_model import ( - PriceIntervalFixedFeeQuantityTransitionModel, -) __all__ = [ "SubscriptionPriceIntervalsParams", "Add", + "AddAllocationPrice", "AddDiscount", "AddDiscountAmountDiscountCreationParams", "AddDiscountPercentageDiscountCreationParams", "AddDiscountUsageDiscountCreationParams", + "AddFixedFeeQuantityTransition", + "AddPrice", + "AddPriceNewFloatingUnitPrice", + "AddPriceNewFloatingUnitPriceUnitConfig", + "AddPriceNewFloatingUnitPriceBillingCycleConfiguration", + "AddPriceNewFloatingUnitPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingPackagePrice", + "AddPriceNewFloatingPackagePricePackageConfig", + "AddPriceNewFloatingPackagePriceBillingCycleConfiguration", + "AddPriceNewFloatingPackagePriceInvoicingCycleConfiguration", + "AddPriceNewFloatingMatrixPrice", + "AddPriceNewFloatingMatrixPriceMatrixConfig", + "AddPriceNewFloatingMatrixPriceMatrixConfigMatrixValue", + "AddPriceNewFloatingMatrixPriceBillingCycleConfiguration", + "AddPriceNewFloatingMatrixPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingMatrixWithAllocationPrice", + "AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig", + "AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue", + "AddPriceNewFloatingMatrixWithAllocationPriceBillingCycleConfiguration", + "AddPriceNewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingTieredPrice", + "AddPriceNewFloatingTieredPriceTieredConfig", + "AddPriceNewFloatingTieredPriceTieredConfigTier", + "AddPriceNewFloatingTieredPriceBillingCycleConfiguration", + "AddPriceNewFloatingTieredPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingTieredBpsPrice", + "AddPriceNewFloatingTieredBpsPriceTieredBpsConfig", + "AddPriceNewFloatingTieredBpsPriceTieredBpsConfigTier", + "AddPriceNewFloatingTieredBpsPriceBillingCycleConfiguration", + "AddPriceNewFloatingTieredBpsPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingBpsPrice", + "AddPriceNewFloatingBpsPriceBpsConfig", + "AddPriceNewFloatingBpsPriceBillingCycleConfiguration", + "AddPriceNewFloatingBpsPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingBulkBpsPrice", + "AddPriceNewFloatingBulkBpsPriceBulkBpsConfig", + "AddPriceNewFloatingBulkBpsPriceBulkBpsConfigTier", + "AddPriceNewFloatingBulkBpsPriceBillingCycleConfiguration", + "AddPriceNewFloatingBulkBpsPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingBulkPrice", + "AddPriceNewFloatingBulkPriceBulkConfig", + "AddPriceNewFloatingBulkPriceBulkConfigTier", + "AddPriceNewFloatingBulkPriceBillingCycleConfiguration", + "AddPriceNewFloatingBulkPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingThresholdTotalAmountPrice", + "AddPriceNewFloatingThresholdTotalAmountPriceBillingCycleConfiguration", + "AddPriceNewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingTieredPackagePrice", + "AddPriceNewFloatingTieredPackagePriceBillingCycleConfiguration", + "AddPriceNewFloatingTieredPackagePriceInvoicingCycleConfiguration", + "AddPriceNewFloatingGroupedTieredPrice", + "AddPriceNewFloatingGroupedTieredPriceBillingCycleConfiguration", + "AddPriceNewFloatingGroupedTieredPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingMaxGroupTieredPackagePrice", + "AddPriceNewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration", + "AddPriceNewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration", + "AddPriceNewFloatingTieredWithMinimumPrice", + "AddPriceNewFloatingTieredWithMinimumPriceBillingCycleConfiguration", + "AddPriceNewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingPackageWithAllocationPrice", + "AddPriceNewFloatingPackageWithAllocationPriceBillingCycleConfiguration", + "AddPriceNewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingTieredPackageWithMinimumPrice", + "AddPriceNewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration", + "AddPriceNewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingUnitWithPercentPrice", + "AddPriceNewFloatingUnitWithPercentPriceBillingCycleConfiguration", + "AddPriceNewFloatingUnitWithPercentPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingTieredWithProrationPrice", + "AddPriceNewFloatingTieredWithProrationPriceBillingCycleConfiguration", + "AddPriceNewFloatingTieredWithProrationPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingUnitWithProrationPrice", + "AddPriceNewFloatingUnitWithProrationPriceBillingCycleConfiguration", + "AddPriceNewFloatingUnitWithProrationPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingGroupedAllocationPrice", + "AddPriceNewFloatingGroupedAllocationPriceBillingCycleConfiguration", + "AddPriceNewFloatingGroupedAllocationPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingGroupedWithProratedMinimumPrice", + "AddPriceNewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "AddPriceNewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingGroupedWithMeteredMinimumPrice", + "AddPriceNewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration", + "AddPriceNewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingMatrixWithDisplayNamePrice", + "AddPriceNewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration", + "AddPriceNewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration", + "AddPriceNewFloatingBulkWithProrationPrice", + "AddPriceNewFloatingBulkWithProrationPriceBillingCycleConfiguration", + "AddPriceNewFloatingBulkWithProrationPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingGroupedTieredPackagePrice", + "AddPriceNewFloatingGroupedTieredPackagePriceBillingCycleConfiguration", + "AddPriceNewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration", + "AddPriceNewFloatingScalableMatrixWithUnitPricingPrice", + "AddPriceNewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "AddPriceNewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingScalableMatrixWithTieredPricingPrice", + "AddPriceNewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "AddPriceNewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingCumulativeGroupedBulkPrice", + "AddPriceNewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration", + "AddPriceNewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration", "AddAdjustment", + "AddAdjustmentAdjustment", + "AddAdjustmentAdjustmentNewPercentageDiscount", + "AddAdjustmentAdjustmentNewUsageDiscount", + "AddAdjustmentAdjustmentNewAmountDiscount", + "AddAdjustmentAdjustmentNewMinimum", + "AddAdjustmentAdjustmentNewMaximum", "Edit", + "EditFixedFeeQuantityTransition", "EditAdjustment", ] @@ -49,37 +152,2493 @@ class SubscriptionPriceIntervalsParams(TypedDict, total=False): """A list of adjustments to edit on the subscription.""" +class AddAllocationPrice(TypedDict, total=False): + amount: Required[str] + """An amount of the currency to allocate to the customer at the specified cadence.""" + + cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] + """The cadence at which to allocate the amount to the customer.""" + + currency: Required[str] + """ + An ISO 4217 currency string or a custom pricing unit identifier in which to bill + this price. + """ + + expires_at_end_of_cadence: Required[bool] + """ + Whether the allocated amount should expire at the end of the cadence or roll + over to the next period. + """ + + class AddDiscountAmountDiscountCreationParams(TypedDict, total=False): amount_discount: Required[float] """Only available if discount_type is `amount`.""" - discount_type: Required[Literal["amount"]] + discount_type: Required[Literal["amount"]] + + +class AddDiscountPercentageDiscountCreationParams(TypedDict, total=False): + discount_type: Required[Literal["percentage"]] + + percentage_discount: Required[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + +class AddDiscountUsageDiscountCreationParams(TypedDict, total=False): + discount_type: Required[Literal["usage"]] + + usage_discount: Required[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for. + """ + + +AddDiscount: TypeAlias = Union[ + AddDiscountAmountDiscountCreationParams, + AddDiscountPercentageDiscountCreationParams, + AddDiscountUsageDiscountCreationParams, +] + + +class AddFixedFeeQuantityTransition(TypedDict, total=False): + effective_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] + """The date that the fixed fee quantity transition should take effect.""" + + quantity: Required[int] + """The quantity of the fixed fee quantity transition.""" + + +class AddPriceNewFloatingUnitPriceUnitConfig(TypedDict, total=False): + unit_amount: Required[str] + """Rate per unit of usage""" + + +class AddPriceNewFloatingUnitPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit"]] + + name: Required[str] + """The name of the price.""" + + unit_config: Required[AddPriceNewFloatingUnitPriceUnitConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingUnitPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingUnitPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingPackagePricePackageConfig(TypedDict, total=False): + package_amount: Required[str] + """A currency amount to rate usage by""" + + package_size: Required[int] + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + +class AddPriceNewFloatingPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package"]] + + name: Required[str] + """The name of the price.""" + + package_config: Required[AddPriceNewFloatingPackagePricePackageConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): + dimension_values: Required[List[Optional[str]]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: Required[str] + """Unit price for the specified dimension_values""" + + +class AddPriceNewFloatingMatrixPriceMatrixConfig(TypedDict, total=False): + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[AddPriceNewFloatingMatrixPriceMatrixConfigMatrixValue]] + """Matrix values for specified matrix grouping keys""" + + +class AddPriceNewFloatingMatrixPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_config: Required[AddPriceNewFloatingMatrixPriceMatrixConfig] + + model_type: Required[Literal["matrix"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingMatrixPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingMatrixPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue(TypedDict, total=False): + dimension_values: Required[List[Optional[str]]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: Required[str] + """Unit price for the specified dimension_values""" + + +class AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig(TypedDict, total=False): + allocation: Required[float] + """Allocation to be used to calculate the price""" + + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue]] + """Matrix values for specified matrix grouping keys""" + + +class AddPriceNewFloatingMatrixWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingMatrixWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_with_allocation_config: Required[AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig] + + model_type: Required[Literal["matrix_with_allocation"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingMatrixWithAllocationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingTieredPriceTieredConfigTier(TypedDict, total=False): + first_unit: Required[float] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + last_unit: Optional[float] + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class AddPriceNewFloatingTieredPriceTieredConfig(TypedDict, total=False): + tiers: Required[Iterable[AddPriceNewFloatingTieredPriceTieredConfigTier]] + """Tiers for rating based on total usage quantities into the specified tier""" + + +class AddPriceNewFloatingTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered"]] + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[AddPriceNewFloatingTieredPriceTieredConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingTieredPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Per-event basis point rate""" + + minimum_amount: Required[str] + """Inclusive tier starting value""" + + maximum_amount: Optional[str] + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] + """Per unit maximum to charge""" + + +class AddPriceNewFloatingTieredBpsPriceTieredBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[AddPriceNewFloatingTieredBpsPriceTieredBpsConfigTier]] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + +class AddPriceNewFloatingTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredBpsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_bps"]] + + name: Required[str] + """The name of the price.""" + + tiered_bps_config: Required[AddPriceNewFloatingTieredBpsPriceTieredBpsConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingTieredBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingBpsPriceBpsConfig(TypedDict, total=False): + bps: Required[float] + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] + """Optional currency amount maximum to cap spend per event""" + + +class AddPriceNewFloatingBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingBpsPrice(TypedDict, total=False): + bps_config: Required[AddPriceNewFloatingBpsPriceBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Basis points to rate on""" + + maximum_amount: Optional[str] + """Upper bound for tier""" + + per_unit_maximum: Optional[str] + """The maximum amount to charge for any one event""" + + +class AddPriceNewFloatingBulkBpsPriceBulkBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[AddPriceNewFloatingBulkBpsPriceBulkBpsConfigTier]] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ + + +class AddPriceNewFloatingBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingBulkBpsPrice(TypedDict, total=False): + bulk_bps_config: Required[AddPriceNewFloatingBulkBpsPriceBulkBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingBulkBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingBulkBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingBulkPriceBulkConfigTier(TypedDict, total=False): + unit_amount: Required[str] + """Amount per unit""" + + maximum_units: Optional[float] + """Upper bound for this tier""" + + +class AddPriceNewFloatingBulkPriceBulkConfig(TypedDict, total=False): + tiers: Required[Iterable[AddPriceNewFloatingBulkPriceBulkConfigTier]] + """Bulk tiers for rating based on total usage volume""" + + +class AddPriceNewFloatingBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingBulkPrice(TypedDict, total=False): + bulk_config: Required[AddPriceNewFloatingBulkPriceBulkConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingBulkPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["threshold_total_amount"]] + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingThresholdTotalAmountPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_package"]] + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingGroupedTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingGroupedTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingGroupedTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_tiered_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_tiered"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingGroupedTieredPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingGroupedTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: Required[Dict[str, object]] + + model_type: Required[Literal["max_group_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_minimum"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingTieredWithMinimumPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package_with_allocation"]] + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingPackageWithAllocationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_package_with_minimum"]] + + name: Required[str] + """The name of the price.""" + + tiered_package_with_minimum_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_percent"]] + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingUnitWithPercentPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingUnitWithPercentPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingTieredWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_proration"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingTieredWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_proration"]] + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingUnitWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingUnitWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_allocation_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_allocation"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingGroupedAllocationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingGroupedAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_with_prorated_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPriceNewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_with_metered_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_metered_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPriceNewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + +class AddPriceNewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" -class AddDiscountPercentageDiscountCreationParams(TypedDict, total=False): - discount_type: Required[Literal["percentage"]] + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" - percentage_discount: Required[float] - """Only available if discount_type is `percentage`. + item_id: Required[str] + """The id of the item the price will be associated with.""" - This is a number between 0 and 1. + matrix_with_display_name_config: Required[Dict[str, object]] + + model_type: Required[Literal["matrix_with_display_name"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. """ + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ -class AddDiscountUsageDiscountCreationParams(TypedDict, total=False): - discount_type: Required[Literal["usage"]] + billing_cycle_configuration: Optional[AddPriceNewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ - usage_discount: Required[float] - """Only available if discount_type is `usage`. + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" - Number of usage units that this discount is for. + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. """ + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" -AddDiscount: TypeAlias = Union[ - AddDiscountAmountDiscountCreationParams, - AddDiscountPercentageDiscountCreationParams, - AddDiscountUsageDiscountCreationParams, + invoicing_cycle_configuration: Optional[AddPriceNewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[Dict[str, object]] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_with_proration"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingBulkWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingBulkWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_tiered_package_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingGroupedTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPriceNewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPriceNewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPriceNewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPriceNewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddPriceNewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Required[Dict[str, object]] + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["cumulative_grouped_bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPriceNewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +AddPrice: TypeAlias = Union[ + AddPriceNewFloatingUnitPrice, + AddPriceNewFloatingPackagePrice, + AddPriceNewFloatingMatrixPrice, + AddPriceNewFloatingMatrixWithAllocationPrice, + AddPriceNewFloatingTieredPrice, + AddPriceNewFloatingTieredBpsPrice, + AddPriceNewFloatingBpsPrice, + AddPriceNewFloatingBulkBpsPrice, + AddPriceNewFloatingBulkPrice, + AddPriceNewFloatingThresholdTotalAmountPrice, + AddPriceNewFloatingTieredPackagePrice, + AddPriceNewFloatingGroupedTieredPrice, + AddPriceNewFloatingMaxGroupTieredPackagePrice, + AddPriceNewFloatingTieredWithMinimumPrice, + AddPriceNewFloatingPackageWithAllocationPrice, + AddPriceNewFloatingTieredPackageWithMinimumPrice, + AddPriceNewFloatingUnitWithPercentPrice, + AddPriceNewFloatingTieredWithProrationPrice, + AddPriceNewFloatingUnitWithProrationPrice, + AddPriceNewFloatingGroupedAllocationPrice, + AddPriceNewFloatingGroupedWithProratedMinimumPrice, + AddPriceNewFloatingGroupedWithMeteredMinimumPrice, + AddPriceNewFloatingMatrixWithDisplayNamePrice, + AddPriceNewFloatingBulkWithProrationPrice, + AddPriceNewFloatingGroupedTieredPackagePrice, + AddPriceNewFloatingScalableMatrixWithUnitPricingPrice, + AddPriceNewFloatingScalableMatrixWithTieredPricingPrice, + AddPriceNewFloatingCumulativeGroupedBulkPrice, ] @@ -92,7 +2651,7 @@ class Add(TypedDict, total=False): This is the date that the price will start billing on the subscription. """ - allocation_price: Optional[NewAllocationPriceModel] + allocation_price: Optional[AddAllocationPrice] """The definition of a new allocation price to create and add to the subscription.""" discounts: Optional[Iterable[AddDiscount]] @@ -115,7 +2674,7 @@ class Add(TypedDict, total=False): null, usage queries will not include any additional filter. """ - fixed_fee_quantity_transitions: Optional[Iterable[PriceIntervalFixedFeeQuantityTransitionModel]] + fixed_fee_quantity_transitions: Optional[Iterable[AddFixedFeeQuantityTransition]] """A list of fixed fee quantity transitions to initialize on the price interval.""" maximum_amount: Optional[float] @@ -130,7 +2689,7 @@ class Add(TypedDict, total=False): billing period. """ - price: Optional[NewFloatingPriceModel] + price: Optional[AddPrice] """The definition of a new price to create and add to the subscription.""" price_id: Optional[str] @@ -147,8 +2706,95 @@ class Add(TypedDict, total=False): """ +class AddAdjustmentAdjustmentNewPercentageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["percentage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + percentage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AddAdjustmentAdjustmentNewUsageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["usage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + usage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AddAdjustmentAdjustmentNewAmountDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["amount_discount"]] + + amount_discount: Required[str] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AddAdjustmentAdjustmentNewMinimum(TypedDict, total=False): + adjustment_type: Required[Literal["minimum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + item_id: Required[str] + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AddAdjustmentAdjustmentNewMaximum(TypedDict, total=False): + adjustment_type: Required[Literal["maximum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + maximum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +AddAdjustmentAdjustment: TypeAlias = Union[ + AddAdjustmentAdjustmentNewPercentageDiscount, + AddAdjustmentAdjustmentNewUsageDiscount, + AddAdjustmentAdjustmentNewAmountDiscount, + AddAdjustmentAdjustmentNewMinimum, + AddAdjustmentAdjustmentNewMaximum, +] + + class AddAdjustment(TypedDict, total=False): - adjustment: Required[NewAdjustmentModel] + adjustment: Required[AddAdjustmentAdjustment] """The definition of a new adjustment to create and add to the subscription.""" start_date: Required[ @@ -168,6 +2814,14 @@ class AddAdjustment(TypedDict, total=False): """ +class EditFixedFeeQuantityTransition(TypedDict, total=False): + effective_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] + """The date that the fixed fee quantity transition should take effect.""" + + quantity: Required[int] + """The quantity of the fixed fee quantity transition.""" + + class Edit(TypedDict, total=False): price_interval_id: Required[str] """The id of the price interval to edit.""" @@ -193,7 +2847,7 @@ class Edit(TypedDict, total=False): null, usage queries will not include any additional filter. """ - fixed_fee_quantity_transitions: Optional[Iterable[PriceIntervalFixedFeeQuantityTransitionModel]] + fixed_fee_quantity_transitions: Optional[Iterable[EditFixedFeeQuantityTransition]] """A list of fixed fee quantity transitions to use for this price interval. Note that this list will overwrite all existing fixed fee quantity transitions diff --git a/src/orb/types/subscription_price_intervals_response.py b/src/orb/types/subscription_price_intervals_response.py new file mode 100644 index 00000000..0dc1d984 --- /dev/null +++ b/src/orb/types/subscription_price_intervals_response.py @@ -0,0 +1,555 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from .plan import Plan +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .customer import Customer + +__all__ = [ + "SubscriptionPriceIntervalsResponse", + "AdjustmentInterval", + "AdjustmentIntervalAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", + "BillingCycleAnchorConfiguration", + "DiscountInterval", + "DiscountIntervalAmountDiscountInterval", + "DiscountIntervalPercentageDiscountInterval", + "DiscountIntervalUsageDiscountInterval", + "FixedFeeQuantitySchedule", + "MaximumInterval", + "MinimumInterval", + "PriceInterval", + "PriceIntervalFixedFeeQuantityTransition", + "RedeemedCoupon", + "TrialInfo", +] + + +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(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. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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.""" + + +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + 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 AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + 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.""" + + +AdjustmentIntervalAdjustment: TypeAlias = Annotated[ + Union[ + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class AdjustmentInterval(BaseModel): + id: str + + adjustment: AdjustmentIntervalAdjustment + + applies_to_price_interval_ids: List[str] + """The price interval IDs that this adjustment applies to.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval.""" + + start_date: datetime + """The start date of the adjustment interval.""" + + +class BillingCycleAnchorConfiguration(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + +class DiscountIntervalAmountDiscountInterval(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["amount"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalPercentageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["percentage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + percentage_discount: float + """ + Only available if discount_type is `percentage`.This is a number between 0 + and 1. + """ + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalUsageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["usage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +DiscountInterval: TypeAlias = Annotated[ + Union[ + DiscountIntervalAmountDiscountInterval, + DiscountIntervalPercentageDiscountInterval, + DiscountIntervalUsageDiscountInterval, + ], + PropertyInfo(discriminator="discount_type"), +] + + +class FixedFeeQuantitySchedule(BaseModel): + end_date: Optional[datetime] = None + + price_id: str + + quantity: float + + start_date: datetime + + +class MaximumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this maximum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this maximum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the maximum interval.""" + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the price intervals + this transform applies to. + """ + + start_date: datetime + """The start date of the maximum interval.""" + + +class MinimumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this minimum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this minimum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the minimum interval.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the price intervals + this minimum applies to. + """ + + start_date: datetime + """The start date of the minimum interval.""" + + +class PriceIntervalFixedFeeQuantityTransition(BaseModel): + effective_date: datetime + + price_id: str + + quantity: int + + +class PriceInterval(BaseModel): + id: str + + billing_cycle_day: int + """The day of the month that Orb bills for this price""" + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is exactly the + end of the billing period. Set to null if this price interval is not currently + active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if this price interval is not currently active. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that Orb stops billing for this price. + """ + + filter: Optional[str] = None + """An additional filter to apply to usage queries.""" + + fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None + """The fixed fee quantity transitions for this price interval. + + This is only relevant for fixed fees. + """ + + price: Price + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + start_date: datetime + """The start date of the price interval. + + This is the date that Orb starts billing for this price. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer IDs whose usage events will be aggregated and billed under + this price interval. + """ + + +class RedeemedCoupon(BaseModel): + coupon_id: str + + end_date: Optional[datetime] = None + + start_date: datetime + + +class TrialInfo(BaseModel): + end_date: Optional[datetime] = None + + +class SubscriptionPriceIntervalsResponse(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentInterval] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: Customer + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumInterval] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumInterval] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: Plan + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceInterval] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[RedeemedCoupon] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: TrialInfo diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index 60641243..ae687f1b 100644 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -13,9 +13,8 @@ from .shared_params.add_subscription_adjustment_params import AddSubscriptionAdjustmentParams from .shared_params.remove_subscription_adjustment_params import RemoveSubscriptionAdjustmentParams from .shared_params.replace_subscription_adjustment_params import ReplaceSubscriptionAdjustmentParams -from .shared_params.billing_cycle_anchor_configuration_model import BillingCycleAnchorConfigurationModel -__all__ = ["SubscriptionSchedulePlanChangeParams"] +__all__ = ["SubscriptionSchedulePlanChangeParams", "BillingCycleAnchorConfiguration"] class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): @@ -55,7 +54,7 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): billing cycle alignment. """ - billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfigurationModel] + billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfiguration] change_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] """The date that the plan change should take effect. @@ -173,3 +172,27 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): only. Provided usage_customer_ids must be either the customer for this subscription itself, or any of that customer's children. """ + + +class BillingCycleAnchorConfiguration(TypedDict, total=False): + day: Required[int] + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ diff --git a/src/orb/types/subscription_schedule_plan_change_response.py b/src/orb/types/subscription_schedule_plan_change_response.py new file mode 100644 index 00000000..5549771f --- /dev/null +++ b/src/orb/types/subscription_schedule_plan_change_response.py @@ -0,0 +1,555 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from .plan import Plan +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .customer import Customer + +__all__ = [ + "SubscriptionSchedulePlanChangeResponse", + "AdjustmentInterval", + "AdjustmentIntervalAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", + "BillingCycleAnchorConfiguration", + "DiscountInterval", + "DiscountIntervalAmountDiscountInterval", + "DiscountIntervalPercentageDiscountInterval", + "DiscountIntervalUsageDiscountInterval", + "FixedFeeQuantitySchedule", + "MaximumInterval", + "MinimumInterval", + "PriceInterval", + "PriceIntervalFixedFeeQuantityTransition", + "RedeemedCoupon", + "TrialInfo", +] + + +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(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. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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.""" + + +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + 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 AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + 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.""" + + +AdjustmentIntervalAdjustment: TypeAlias = Annotated[ + Union[ + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class AdjustmentInterval(BaseModel): + id: str + + adjustment: AdjustmentIntervalAdjustment + + applies_to_price_interval_ids: List[str] + """The price interval IDs that this adjustment applies to.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval.""" + + start_date: datetime + """The start date of the adjustment interval.""" + + +class BillingCycleAnchorConfiguration(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + +class DiscountIntervalAmountDiscountInterval(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["amount"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalPercentageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["percentage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + percentage_discount: float + """ + Only available if discount_type is `percentage`.This is a number between 0 + and 1. + """ + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalUsageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["usage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +DiscountInterval: TypeAlias = Annotated[ + Union[ + DiscountIntervalAmountDiscountInterval, + DiscountIntervalPercentageDiscountInterval, + DiscountIntervalUsageDiscountInterval, + ], + PropertyInfo(discriminator="discount_type"), +] + + +class FixedFeeQuantitySchedule(BaseModel): + end_date: Optional[datetime] = None + + price_id: str + + quantity: float + + start_date: datetime + + +class MaximumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this maximum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this maximum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the maximum interval.""" + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the price intervals + this transform applies to. + """ + + start_date: datetime + """The start date of the maximum interval.""" + + +class MinimumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this minimum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this minimum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the minimum interval.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the price intervals + this minimum applies to. + """ + + start_date: datetime + """The start date of the minimum interval.""" + + +class PriceIntervalFixedFeeQuantityTransition(BaseModel): + effective_date: datetime + + price_id: str + + quantity: int + + +class PriceInterval(BaseModel): + id: str + + billing_cycle_day: int + """The day of the month that Orb bills for this price""" + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is exactly the + end of the billing period. Set to null if this price interval is not currently + active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if this price interval is not currently active. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that Orb stops billing for this price. + """ + + filter: Optional[str] = None + """An additional filter to apply to usage queries.""" + + fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None + """The fixed fee quantity transitions for this price interval. + + This is only relevant for fixed fees. + """ + + price: Price + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + start_date: datetime + """The start date of the price interval. + + This is the date that Orb starts billing for this price. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer IDs whose usage events will be aggregated and billed under + this price interval. + """ + + +class RedeemedCoupon(BaseModel): + coupon_id: str + + end_date: Optional[datetime] = None + + start_date: datetime + + +class TrialInfo(BaseModel): + end_date: Optional[datetime] = None + + +class SubscriptionSchedulePlanChangeResponse(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentInterval] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: Customer + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumInterval] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumInterval] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: Plan + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceInterval] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[RedeemedCoupon] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: TrialInfo diff --git a/src/orb/types/subscription_trigger_phase_response.py b/src/orb/types/subscription_trigger_phase_response.py new file mode 100644 index 00000000..a0891557 --- /dev/null +++ b/src/orb/types/subscription_trigger_phase_response.py @@ -0,0 +1,555 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from .plan import Plan +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .customer import Customer + +__all__ = [ + "SubscriptionTriggerPhaseResponse", + "AdjustmentInterval", + "AdjustmentIntervalAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", + "BillingCycleAnchorConfiguration", + "DiscountInterval", + "DiscountIntervalAmountDiscountInterval", + "DiscountIntervalPercentageDiscountInterval", + "DiscountIntervalUsageDiscountInterval", + "FixedFeeQuantitySchedule", + "MaximumInterval", + "MinimumInterval", + "PriceInterval", + "PriceIntervalFixedFeeQuantityTransition", + "RedeemedCoupon", + "TrialInfo", +] + + +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(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. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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.""" + + +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + 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 AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + 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.""" + + +AdjustmentIntervalAdjustment: TypeAlias = Annotated[ + Union[ + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class AdjustmentInterval(BaseModel): + id: str + + adjustment: AdjustmentIntervalAdjustment + + applies_to_price_interval_ids: List[str] + """The price interval IDs that this adjustment applies to.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval.""" + + start_date: datetime + """The start date of the adjustment interval.""" + + +class BillingCycleAnchorConfiguration(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + +class DiscountIntervalAmountDiscountInterval(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["amount"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalPercentageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["percentage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + percentage_discount: float + """ + Only available if discount_type is `percentage`.This is a number between 0 + and 1. + """ + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalUsageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["usage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +DiscountInterval: TypeAlias = Annotated[ + Union[ + DiscountIntervalAmountDiscountInterval, + DiscountIntervalPercentageDiscountInterval, + DiscountIntervalUsageDiscountInterval, + ], + PropertyInfo(discriminator="discount_type"), +] + + +class FixedFeeQuantitySchedule(BaseModel): + end_date: Optional[datetime] = None + + price_id: str + + quantity: float + + start_date: datetime + + +class MaximumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this maximum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this maximum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the maximum interval.""" + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the price intervals + this transform applies to. + """ + + start_date: datetime + """The start date of the maximum interval.""" + + +class MinimumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this minimum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this minimum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the minimum interval.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the price intervals + this minimum applies to. + """ + + start_date: datetime + """The start date of the minimum interval.""" + + +class PriceIntervalFixedFeeQuantityTransition(BaseModel): + effective_date: datetime + + price_id: str + + quantity: int + + +class PriceInterval(BaseModel): + id: str + + billing_cycle_day: int + """The day of the month that Orb bills for this price""" + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is exactly the + end of the billing period. Set to null if this price interval is not currently + active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if this price interval is not currently active. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that Orb stops billing for this price. + """ + + filter: Optional[str] = None + """An additional filter to apply to usage queries.""" + + fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None + """The fixed fee quantity transitions for this price interval. + + This is only relevant for fixed fees. + """ + + price: Price + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + start_date: datetime + """The start date of the price interval. + + This is the date that Orb starts billing for this price. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer IDs whose usage events will be aggregated and billed under + this price interval. + """ + + +class RedeemedCoupon(BaseModel): + coupon_id: str + + end_date: Optional[datetime] = None + + start_date: datetime + + +class TrialInfo(BaseModel): + end_date: Optional[datetime] = None + + +class SubscriptionTriggerPhaseResponse(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentInterval] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: Customer + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumInterval] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumInterval] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: Plan + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceInterval] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[RedeemedCoupon] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: TrialInfo diff --git a/src/orb/types/subscription_unschedule_cancellation_response.py b/src/orb/types/subscription_unschedule_cancellation_response.py new file mode 100644 index 00000000..f084f56a --- /dev/null +++ b/src/orb/types/subscription_unschedule_cancellation_response.py @@ -0,0 +1,555 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from .plan import Plan +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .customer import Customer + +__all__ = [ + "SubscriptionUnscheduleCancellationResponse", + "AdjustmentInterval", + "AdjustmentIntervalAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", + "BillingCycleAnchorConfiguration", + "DiscountInterval", + "DiscountIntervalAmountDiscountInterval", + "DiscountIntervalPercentageDiscountInterval", + "DiscountIntervalUsageDiscountInterval", + "FixedFeeQuantitySchedule", + "MaximumInterval", + "MinimumInterval", + "PriceInterval", + "PriceIntervalFixedFeeQuantityTransition", + "RedeemedCoupon", + "TrialInfo", +] + + +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(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. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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.""" + + +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + 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 AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + 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.""" + + +AdjustmentIntervalAdjustment: TypeAlias = Annotated[ + Union[ + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class AdjustmentInterval(BaseModel): + id: str + + adjustment: AdjustmentIntervalAdjustment + + applies_to_price_interval_ids: List[str] + """The price interval IDs that this adjustment applies to.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval.""" + + start_date: datetime + """The start date of the adjustment interval.""" + + +class BillingCycleAnchorConfiguration(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + +class DiscountIntervalAmountDiscountInterval(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["amount"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalPercentageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["percentage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + percentage_discount: float + """ + Only available if discount_type is `percentage`.This is a number between 0 + and 1. + """ + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalUsageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["usage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +DiscountInterval: TypeAlias = Annotated[ + Union[ + DiscountIntervalAmountDiscountInterval, + DiscountIntervalPercentageDiscountInterval, + DiscountIntervalUsageDiscountInterval, + ], + PropertyInfo(discriminator="discount_type"), +] + + +class FixedFeeQuantitySchedule(BaseModel): + end_date: Optional[datetime] = None + + price_id: str + + quantity: float + + start_date: datetime + + +class MaximumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this maximum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this maximum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the maximum interval.""" + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the price intervals + this transform applies to. + """ + + start_date: datetime + """The start date of the maximum interval.""" + + +class MinimumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this minimum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this minimum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the minimum interval.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the price intervals + this minimum applies to. + """ + + start_date: datetime + """The start date of the minimum interval.""" + + +class PriceIntervalFixedFeeQuantityTransition(BaseModel): + effective_date: datetime + + price_id: str + + quantity: int + + +class PriceInterval(BaseModel): + id: str + + billing_cycle_day: int + """The day of the month that Orb bills for this price""" + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is exactly the + end of the billing period. Set to null if this price interval is not currently + active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if this price interval is not currently active. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that Orb stops billing for this price. + """ + + filter: Optional[str] = None + """An additional filter to apply to usage queries.""" + + fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None + """The fixed fee quantity transitions for this price interval. + + This is only relevant for fixed fees. + """ + + price: Price + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + start_date: datetime + """The start date of the price interval. + + This is the date that Orb starts billing for this price. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer IDs whose usage events will be aggregated and billed under + this price interval. + """ + + +class RedeemedCoupon(BaseModel): + coupon_id: str + + end_date: Optional[datetime] = None + + start_date: datetime + + +class TrialInfo(BaseModel): + end_date: Optional[datetime] = None + + +class SubscriptionUnscheduleCancellationResponse(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentInterval] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: Customer + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumInterval] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumInterval] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: Plan + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceInterval] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[RedeemedCoupon] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: TrialInfo 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 new file mode 100644 index 00000000..6e27be58 --- /dev/null +++ b/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py @@ -0,0 +1,555 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from .plan import Plan +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .customer import Customer + +__all__ = [ + "SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse", + "AdjustmentInterval", + "AdjustmentIntervalAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", + "BillingCycleAnchorConfiguration", + "DiscountInterval", + "DiscountIntervalAmountDiscountInterval", + "DiscountIntervalPercentageDiscountInterval", + "DiscountIntervalUsageDiscountInterval", + "FixedFeeQuantitySchedule", + "MaximumInterval", + "MinimumInterval", + "PriceInterval", + "PriceIntervalFixedFeeQuantityTransition", + "RedeemedCoupon", + "TrialInfo", +] + + +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(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. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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.""" + + +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + 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 AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + 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.""" + + +AdjustmentIntervalAdjustment: TypeAlias = Annotated[ + Union[ + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class AdjustmentInterval(BaseModel): + id: str + + adjustment: AdjustmentIntervalAdjustment + + applies_to_price_interval_ids: List[str] + """The price interval IDs that this adjustment applies to.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval.""" + + start_date: datetime + """The start date of the adjustment interval.""" + + +class BillingCycleAnchorConfiguration(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + +class DiscountIntervalAmountDiscountInterval(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["amount"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalPercentageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["percentage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + percentage_discount: float + """ + Only available if discount_type is `percentage`.This is a number between 0 + and 1. + """ + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalUsageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["usage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +DiscountInterval: TypeAlias = Annotated[ + Union[ + DiscountIntervalAmountDiscountInterval, + DiscountIntervalPercentageDiscountInterval, + DiscountIntervalUsageDiscountInterval, + ], + PropertyInfo(discriminator="discount_type"), +] + + +class FixedFeeQuantitySchedule(BaseModel): + end_date: Optional[datetime] = None + + price_id: str + + quantity: float + + start_date: datetime + + +class MaximumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this maximum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this maximum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the maximum interval.""" + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the price intervals + this transform applies to. + """ + + start_date: datetime + """The start date of the maximum interval.""" + + +class MinimumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this minimum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this minimum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the minimum interval.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the price intervals + this minimum applies to. + """ + + start_date: datetime + """The start date of the minimum interval.""" + + +class PriceIntervalFixedFeeQuantityTransition(BaseModel): + effective_date: datetime + + price_id: str + + quantity: int + + +class PriceInterval(BaseModel): + id: str + + billing_cycle_day: int + """The day of the month that Orb bills for this price""" + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is exactly the + end of the billing period. Set to null if this price interval is not currently + active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if this price interval is not currently active. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that Orb stops billing for this price. + """ + + filter: Optional[str] = None + """An additional filter to apply to usage queries.""" + + fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None + """The fixed fee quantity transitions for this price interval. + + This is only relevant for fixed fees. + """ + + price: Price + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + start_date: datetime + """The start date of the price interval. + + This is the date that Orb starts billing for this price. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer IDs whose usage events will be aggregated and billed under + this price interval. + """ + + +class RedeemedCoupon(BaseModel): + coupon_id: str + + end_date: Optional[datetime] = None + + start_date: datetime + + +class TrialInfo(BaseModel): + end_date: Optional[datetime] = None + + +class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentInterval] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: Customer + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumInterval] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumInterval] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: Plan + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceInterval] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[RedeemedCoupon] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: TrialInfo diff --git a/src/orb/types/subscription_unschedule_pending_plan_changes_response.py b/src/orb/types/subscription_unschedule_pending_plan_changes_response.py new file mode 100644 index 00000000..3d5943a6 --- /dev/null +++ b/src/orb/types/subscription_unschedule_pending_plan_changes_response.py @@ -0,0 +1,555 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from .plan import Plan +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .customer import Customer + +__all__ = [ + "SubscriptionUnschedulePendingPlanChangesResponse", + "AdjustmentInterval", + "AdjustmentIntervalAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", + "BillingCycleAnchorConfiguration", + "DiscountInterval", + "DiscountIntervalAmountDiscountInterval", + "DiscountIntervalPercentageDiscountInterval", + "DiscountIntervalUsageDiscountInterval", + "FixedFeeQuantitySchedule", + "MaximumInterval", + "MinimumInterval", + "PriceInterval", + "PriceIntervalFixedFeeQuantityTransition", + "RedeemedCoupon", + "TrialInfo", +] + + +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(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. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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.""" + + +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + 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 AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + 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.""" + + +AdjustmentIntervalAdjustment: TypeAlias = Annotated[ + Union[ + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class AdjustmentInterval(BaseModel): + id: str + + adjustment: AdjustmentIntervalAdjustment + + applies_to_price_interval_ids: List[str] + """The price interval IDs that this adjustment applies to.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval.""" + + start_date: datetime + """The start date of the adjustment interval.""" + + +class BillingCycleAnchorConfiguration(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + +class DiscountIntervalAmountDiscountInterval(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["amount"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalPercentageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["percentage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + percentage_discount: float + """ + Only available if discount_type is `percentage`.This is a number between 0 + and 1. + """ + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalUsageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["usage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +DiscountInterval: TypeAlias = Annotated[ + Union[ + DiscountIntervalAmountDiscountInterval, + DiscountIntervalPercentageDiscountInterval, + DiscountIntervalUsageDiscountInterval, + ], + PropertyInfo(discriminator="discount_type"), +] + + +class FixedFeeQuantitySchedule(BaseModel): + end_date: Optional[datetime] = None + + price_id: str + + quantity: float + + start_date: datetime + + +class MaximumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this maximum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this maximum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the maximum interval.""" + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the price intervals + this transform applies to. + """ + + start_date: datetime + """The start date of the maximum interval.""" + + +class MinimumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this minimum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this minimum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the minimum interval.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the price intervals + this minimum applies to. + """ + + start_date: datetime + """The start date of the minimum interval.""" + + +class PriceIntervalFixedFeeQuantityTransition(BaseModel): + effective_date: datetime + + price_id: str + + quantity: int + + +class PriceInterval(BaseModel): + id: str + + billing_cycle_day: int + """The day of the month that Orb bills for this price""" + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is exactly the + end of the billing period. Set to null if this price interval is not currently + active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if this price interval is not currently active. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that Orb stops billing for this price. + """ + + filter: Optional[str] = None + """An additional filter to apply to usage queries.""" + + fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None + """The fixed fee quantity transitions for this price interval. + + This is only relevant for fixed fees. + """ + + price: Price + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + start_date: datetime + """The start date of the price interval. + + This is the date that Orb starts billing for this price. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer IDs whose usage events will be aggregated and billed under + this price interval. + """ + + +class RedeemedCoupon(BaseModel): + coupon_id: str + + end_date: Optional[datetime] = None + + start_date: datetime + + +class TrialInfo(BaseModel): + end_date: Optional[datetime] = None + + +class SubscriptionUnschedulePendingPlanChangesResponse(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentInterval] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: Customer + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumInterval] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumInterval] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: Plan + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceInterval] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[RedeemedCoupon] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: TrialInfo diff --git a/src/orb/types/subscription_update_fixed_fee_quantity_response.py b/src/orb/types/subscription_update_fixed_fee_quantity_response.py new file mode 100644 index 00000000..4be85ee3 --- /dev/null +++ b/src/orb/types/subscription_update_fixed_fee_quantity_response.py @@ -0,0 +1,555 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from .plan import Plan +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .customer import Customer + +__all__ = [ + "SubscriptionUpdateFixedFeeQuantityResponse", + "AdjustmentInterval", + "AdjustmentIntervalAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", + "BillingCycleAnchorConfiguration", + "DiscountInterval", + "DiscountIntervalAmountDiscountInterval", + "DiscountIntervalPercentageDiscountInterval", + "DiscountIntervalUsageDiscountInterval", + "FixedFeeQuantitySchedule", + "MaximumInterval", + "MinimumInterval", + "PriceInterval", + "PriceIntervalFixedFeeQuantityTransition", + "RedeemedCoupon", + "TrialInfo", +] + + +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(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. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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.""" + + +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + 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 AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + 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.""" + + +AdjustmentIntervalAdjustment: TypeAlias = Annotated[ + Union[ + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class AdjustmentInterval(BaseModel): + id: str + + adjustment: AdjustmentIntervalAdjustment + + applies_to_price_interval_ids: List[str] + """The price interval IDs that this adjustment applies to.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval.""" + + start_date: datetime + """The start date of the adjustment interval.""" + + +class BillingCycleAnchorConfiguration(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + +class DiscountIntervalAmountDiscountInterval(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["amount"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalPercentageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["percentage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + percentage_discount: float + """ + Only available if discount_type is `percentage`.This is a number between 0 + and 1. + """ + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalUsageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["usage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +DiscountInterval: TypeAlias = Annotated[ + Union[ + DiscountIntervalAmountDiscountInterval, + DiscountIntervalPercentageDiscountInterval, + DiscountIntervalUsageDiscountInterval, + ], + PropertyInfo(discriminator="discount_type"), +] + + +class FixedFeeQuantitySchedule(BaseModel): + end_date: Optional[datetime] = None + + price_id: str + + quantity: float + + start_date: datetime + + +class MaximumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this maximum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this maximum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the maximum interval.""" + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the price intervals + this transform applies to. + """ + + start_date: datetime + """The start date of the maximum interval.""" + + +class MinimumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this minimum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this minimum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the minimum interval.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the price intervals + this minimum applies to. + """ + + start_date: datetime + """The start date of the minimum interval.""" + + +class PriceIntervalFixedFeeQuantityTransition(BaseModel): + effective_date: datetime + + price_id: str + + quantity: int + + +class PriceInterval(BaseModel): + id: str + + billing_cycle_day: int + """The day of the month that Orb bills for this price""" + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is exactly the + end of the billing period. Set to null if this price interval is not currently + active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if this price interval is not currently active. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that Orb stops billing for this price. + """ + + filter: Optional[str] = None + """An additional filter to apply to usage queries.""" + + fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None + """The fixed fee quantity transitions for this price interval. + + This is only relevant for fixed fees. + """ + + price: Price + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + start_date: datetime + """The start date of the price interval. + + This is the date that Orb starts billing for this price. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer IDs whose usage events will be aggregated and billed under + this price interval. + """ + + +class RedeemedCoupon(BaseModel): + coupon_id: str + + end_date: Optional[datetime] = None + + start_date: datetime + + +class TrialInfo(BaseModel): + end_date: Optional[datetime] = None + + +class SubscriptionUpdateFixedFeeQuantityResponse(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentInterval] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: Customer + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumInterval] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumInterval] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: Plan + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceInterval] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[RedeemedCoupon] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: TrialInfo diff --git a/src/orb/types/subscription_update_trial_response.py b/src/orb/types/subscription_update_trial_response.py new file mode 100644 index 00000000..c56975f6 --- /dev/null +++ b/src/orb/types/subscription_update_trial_response.py @@ -0,0 +1,555 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from .plan import Plan +from .price import Price +from .._utils import PropertyInfo +from .._models import BaseModel +from .customer import Customer + +__all__ = [ + "SubscriptionUpdateTrialResponse", + "AdjustmentInterval", + "AdjustmentIntervalAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", + "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", + "BillingCycleAnchorConfiguration", + "DiscountInterval", + "DiscountIntervalAmountDiscountInterval", + "DiscountIntervalPercentageDiscountInterval", + "DiscountIntervalUsageDiscountInterval", + "FixedFeeQuantitySchedule", + "MaximumInterval", + "MinimumInterval", + "PriceInterval", + "PriceIntervalFixedFeeQuantityTransition", + "RedeemedCoupon", + "TrialInfo", +] + + +class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(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. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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.""" + + +class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + 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 AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + 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 AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + 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.""" + + +AdjustmentIntervalAdjustment: TypeAlias = Annotated[ + Union[ + AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, + AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + +class AdjustmentInterval(BaseModel): + id: str + + adjustment: AdjustmentIntervalAdjustment + + applies_to_price_interval_ids: List[str] + """The price interval IDs that this adjustment applies to.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval.""" + + start_date: datetime + """The start date of the adjustment interval.""" + + +class BillingCycleAnchorConfiguration(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + +class DiscountIntervalAmountDiscountInterval(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["amount"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalPercentageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["percentage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + percentage_discount: float + """ + Only available if discount_type is `percentage`.This is a number between 0 + and 1. + """ + + start_date: datetime + """The start date of the discount interval.""" + + +class DiscountIntervalUsageDiscountInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["usage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +DiscountInterval: TypeAlias = Annotated[ + Union[ + DiscountIntervalAmountDiscountInterval, + DiscountIntervalPercentageDiscountInterval, + DiscountIntervalUsageDiscountInterval, + ], + PropertyInfo(discriminator="discount_type"), +] + + +class FixedFeeQuantitySchedule(BaseModel): + end_date: Optional[datetime] = None + + price_id: str + + quantity: float + + start_date: datetime + + +class MaximumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this maximum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this maximum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the maximum interval.""" + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the price intervals + this transform applies to. + """ + + start_date: datetime + """The start date of the maximum interval.""" + + +class MinimumInterval(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this minimum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this minimum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the minimum interval.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the price intervals + this minimum applies to. + """ + + start_date: datetime + """The start date of the minimum interval.""" + + +class PriceIntervalFixedFeeQuantityTransition(BaseModel): + effective_date: datetime + + price_id: str + + quantity: int + + +class PriceInterval(BaseModel): + id: str + + billing_cycle_day: int + """The day of the month that Orb bills for this price""" + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is exactly the + end of the billing period. Set to null if this price interval is not currently + active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if this price interval is not currently active. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that Orb stops billing for this price. + """ + + filter: Optional[str] = None + """An additional filter to apply to usage queries.""" + + fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None + """The fixed fee quantity transitions for this price interval. + + This is only relevant for fixed fees. + """ + + price: Price + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + start_date: datetime + """The start date of the price interval. + + This is the date that Orb starts billing for this price. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer IDs whose usage events will be aggregated and billed under + this price interval. + """ + + +class RedeemedCoupon(BaseModel): + coupon_id: str + + end_date: Optional[datetime] = None + + start_date: datetime + + +class TrialInfo(BaseModel): + end_date: Optional[datetime] = None + + +class SubscriptionUpdateTrialResponse(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentInterval] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: Customer + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumInterval] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumInterval] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: Plan + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceInterval] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[RedeemedCoupon] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: TrialInfo diff --git a/src/orb/types/subscription_usage.py b/src/orb/types/subscription_usage.py index 124140df..4a5c4f2e 100644 --- a/src/orb/types/subscription_usage.py +++ b/src/orb/types/subscription_usage.py @@ -1,27 +1,44 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Union, Optional +from datetime import datetime from typing_extensions import Literal, TypeAlias from .._models import BaseModel -from .shared.usage_model import UsageModel from .shared.pagination_metadata import PaginationMetadata -from .shared.billable_metric_simple_model import BillableMetricSimpleModel __all__ = [ "SubscriptionUsage", "UngroupedSubscriptionUsage", "UngroupedSubscriptionUsageData", + "UngroupedSubscriptionUsageDataBillableMetric", + "UngroupedSubscriptionUsageDataUsage", "GroupedSubscriptionUsage", "GroupedSubscriptionUsageData", + "GroupedSubscriptionUsageDataBillableMetric", "GroupedSubscriptionUsageDataMetricGroup", + "GroupedSubscriptionUsageDataUsage", ] +class UngroupedSubscriptionUsageDataBillableMetric(BaseModel): + id: str + + name: str + + +class UngroupedSubscriptionUsageDataUsage(BaseModel): + quantity: float + + timeframe_end: datetime + + timeframe_start: datetime + + class UngroupedSubscriptionUsageData(BaseModel): - billable_metric: BillableMetricSimpleModel + billable_metric: UngroupedSubscriptionUsageDataBillableMetric - usage: List[UsageModel] + usage: List[UngroupedSubscriptionUsageDataUsage] view_mode: Literal["periodic", "cumulative"] @@ -30,18 +47,32 @@ class UngroupedSubscriptionUsage(BaseModel): data: List[UngroupedSubscriptionUsageData] +class GroupedSubscriptionUsageDataBillableMetric(BaseModel): + id: str + + name: str + + class GroupedSubscriptionUsageDataMetricGroup(BaseModel): property_key: str property_value: str +class GroupedSubscriptionUsageDataUsage(BaseModel): + quantity: float + + timeframe_end: datetime + + timeframe_start: datetime + + class GroupedSubscriptionUsageData(BaseModel): - billable_metric: BillableMetricSimpleModel + billable_metric: GroupedSubscriptionUsageDataBillableMetric metric_group: GroupedSubscriptionUsageDataMetricGroup - usage: List[UsageModel] + usage: List[GroupedSubscriptionUsageDataUsage] view_mode: Literal["periodic", "cumulative"] diff --git a/src/orb/types/subscriptions.py b/src/orb/types/subscriptions.py index f331072d..c80fef11 100644 --- a/src/orb/types/subscriptions.py +++ b/src/orb/types/subscriptions.py @@ -3,13 +3,13 @@ from typing import List from .._models import BaseModel -from .shared.subscription_model import SubscriptionModel +from .subscription import Subscription from .shared.pagination_metadata import PaginationMetadata __all__ = ["Subscriptions"] class Subscriptions(BaseModel): - data: List[SubscriptionModel] + data: List[Subscription] pagination_metadata: PaginationMetadata diff --git a/tests/api_resources/coupons/test_subscriptions.py b/tests/api_resources/coupons/test_subscriptions.py index 6e2e5a7f..4c190521 100644 --- a/tests/api_resources/coupons/test_subscriptions.py +++ b/tests/api_resources/coupons/test_subscriptions.py @@ -8,9 +8,9 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import Subscription from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import SubscriptionModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_list(self, client: Orb) -> None: subscription = client.coupons.subscriptions.list( coupon_id="coupon_id", ) - assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -32,7 +32,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -43,7 +43,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -54,7 +54,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -74,7 +74,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: subscription = await async_client.coupons.subscriptions.list( coupon_id="coupon_id", ) - assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -83,7 +83,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -94,7 +94,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -105,7 +105,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/customers/credits/test_ledger.py b/tests/api_resources/customers/credits/test_ledger.py index 478e10ac..ff759955 100644 --- a/tests/api_resources/customers/credits/test_ledger.py +++ b/tests/api_resources/customers/credits/test_ledger.py @@ -11,7 +11,12 @@ from orb._utils import parse_date, parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import CreditLedgerEntryModel +from orb.types.customers.credits import ( + LedgerListResponse, + LedgerCreateEntryResponse, + LedgerListByExternalIDResponse, + LedgerCreateEntryByExternalIDResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +29,7 @@ def test_method_list(self, client: Orb) -> None: ledger = client.customers.credits.ledger.list( customer_id="customer_id", ) - assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(SyncPage[LedgerListResponse], ledger, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -41,7 +46,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: limit=1, minimum_amount="minimum_amount", ) - assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(SyncPage[LedgerListResponse], ledger, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -52,7 +57,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(SyncPage[LedgerListResponse], ledger, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -63,7 +68,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(SyncPage[LedgerListResponse], ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -81,7 +86,7 @@ def test_method_create_entry_overload_1(self, client: Orb) -> None: amount=0, entry_type="increment", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_method_create_entry_with_all_params_overload_1(self, client: Orb) -> None: @@ -102,7 +107,7 @@ def test_method_create_entry_with_all_params_overload_1(self, client: Orb) -> No metadata={"foo": "string"}, per_unit_cost_basis="per_unit_cost_basis", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_overload_1(self, client: Orb) -> None: @@ -115,7 +120,7 @@ def test_raw_response_create_entry_overload_1(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_overload_1(self, client: Orb) -> None: @@ -128,7 +133,7 @@ def test_streaming_response_create_entry_overload_1(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -148,7 +153,7 @@ def test_method_create_entry_overload_2(self, client: Orb) -> None: amount=0, entry_type="decrement", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_method_create_entry_with_all_params_overload_2(self, client: Orb) -> None: @@ -160,7 +165,7 @@ def test_method_create_entry_with_all_params_overload_2(self, client: Orb) -> No description="description", metadata={"foo": "string"}, ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_overload_2(self, client: Orb) -> None: @@ -173,7 +178,7 @@ def test_raw_response_create_entry_overload_2(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_overload_2(self, client: Orb) -> None: @@ -186,7 +191,7 @@ def test_streaming_response_create_entry_overload_2(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -207,7 +212,7 @@ def test_method_create_entry_overload_3(self, client: Orb) -> None: expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_method_create_entry_with_all_params_overload_3(self, client: Orb) -> None: @@ -222,7 +227,7 @@ def test_method_create_entry_with_all_params_overload_3(self, client: Orb) -> No description="description", metadata={"foo": "string"}, ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_overload_3(self, client: Orb) -> None: @@ -236,7 +241,7 @@ def test_raw_response_create_entry_overload_3(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_overload_3(self, client: Orb) -> None: @@ -250,7 +255,7 @@ def test_streaming_response_create_entry_overload_3(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -272,7 +277,7 @@ def test_method_create_entry_overload_4(self, client: Orb) -> None: block_id="block_id", entry_type="void", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_method_create_entry_with_all_params_overload_4(self, client: Orb) -> None: @@ -286,7 +291,7 @@ def test_method_create_entry_with_all_params_overload_4(self, client: Orb) -> No metadata={"foo": "string"}, void_reason="refund", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_overload_4(self, client: Orb) -> None: @@ -300,7 +305,7 @@ def test_raw_response_create_entry_overload_4(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_overload_4(self, client: Orb) -> None: @@ -314,7 +319,7 @@ def test_streaming_response_create_entry_overload_4(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -336,7 +341,7 @@ def test_method_create_entry_overload_5(self, client: Orb) -> None: block_id="block_id", entry_type="amendment", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_method_create_entry_with_all_params_overload_5(self, client: Orb) -> None: @@ -349,7 +354,7 @@ def test_method_create_entry_with_all_params_overload_5(self, client: Orb) -> No description="description", metadata={"foo": "string"}, ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_overload_5(self, client: Orb) -> None: @@ -363,7 +368,7 @@ def test_raw_response_create_entry_overload_5(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_overload_5(self, client: Orb) -> None: @@ -377,7 +382,7 @@ def test_streaming_response_create_entry_overload_5(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -398,7 +403,7 @@ def test_method_create_entry_by_external_id_overload_1(self, client: Orb) -> Non amount=0, entry_type="increment", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_method_create_entry_by_external_id_with_all_params_overload_1(self, client: Orb) -> None: @@ -419,7 +424,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_1(self, cli metadata={"foo": "string"}, per_unit_cost_basis="per_unit_cost_basis", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_by_external_id_overload_1(self, client: Orb) -> None: @@ -432,7 +437,7 @@ def test_raw_response_create_entry_by_external_id_overload_1(self, client: Orb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_by_external_id_overload_1(self, client: Orb) -> None: @@ -445,7 +450,7 @@ def test_streaming_response_create_entry_by_external_id_overload_1(self, client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -465,7 +470,7 @@ def test_method_create_entry_by_external_id_overload_2(self, client: Orb) -> Non amount=0, entry_type="decrement", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_method_create_entry_by_external_id_with_all_params_overload_2(self, client: Orb) -> None: @@ -477,7 +482,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_2(self, cli description="description", metadata={"foo": "string"}, ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_by_external_id_overload_2(self, client: Orb) -> None: @@ -490,7 +495,7 @@ def test_raw_response_create_entry_by_external_id_overload_2(self, client: Orb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_by_external_id_overload_2(self, client: Orb) -> None: @@ -503,7 +508,7 @@ def test_streaming_response_create_entry_by_external_id_overload_2(self, client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -524,7 +529,7 @@ def test_method_create_entry_by_external_id_overload_3(self, client: Orb) -> Non expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_method_create_entry_by_external_id_with_all_params_overload_3(self, client: Orb) -> None: @@ -539,7 +544,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_3(self, cli description="description", metadata={"foo": "string"}, ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_by_external_id_overload_3(self, client: Orb) -> None: @@ -553,7 +558,7 @@ def test_raw_response_create_entry_by_external_id_overload_3(self, client: Orb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_by_external_id_overload_3(self, client: Orb) -> None: @@ -567,7 +572,7 @@ def test_streaming_response_create_entry_by_external_id_overload_3(self, client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -589,7 +594,7 @@ def test_method_create_entry_by_external_id_overload_4(self, client: Orb) -> Non block_id="block_id", entry_type="void", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_method_create_entry_by_external_id_with_all_params_overload_4(self, client: Orb) -> None: @@ -603,7 +608,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_4(self, cli metadata={"foo": "string"}, void_reason="refund", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_by_external_id_overload_4(self, client: Orb) -> None: @@ -617,7 +622,7 @@ def test_raw_response_create_entry_by_external_id_overload_4(self, client: Orb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_by_external_id_overload_4(self, client: Orb) -> None: @@ -631,7 +636,7 @@ def test_streaming_response_create_entry_by_external_id_overload_4(self, client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -653,7 +658,7 @@ def test_method_create_entry_by_external_id_overload_5(self, client: Orb) -> Non block_id="block_id", entry_type="amendment", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_method_create_entry_by_external_id_with_all_params_overload_5(self, client: Orb) -> None: @@ -666,7 +671,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_5(self, cli description="description", metadata={"foo": "string"}, ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_by_external_id_overload_5(self, client: Orb) -> None: @@ -680,7 +685,7 @@ def test_raw_response_create_entry_by_external_id_overload_5(self, client: Orb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_by_external_id_overload_5(self, client: Orb) -> None: @@ -694,7 +699,7 @@ def test_streaming_response_create_entry_by_external_id_overload_5(self, client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -713,7 +718,7 @@ def test_method_list_by_external_id(self, client: Orb) -> None: ledger = client.customers.credits.ledger.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(SyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) @parametrize def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: @@ -730,7 +735,7 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: limit=1, minimum_amount="minimum_amount", ) - assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(SyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) @parametrize def test_raw_response_list_by_external_id(self, client: Orb) -> None: @@ -741,7 +746,7 @@ def test_raw_response_list_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(SyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) @parametrize def test_streaming_response_list_by_external_id(self, client: Orb) -> None: @@ -752,7 +757,7 @@ def test_streaming_response_list_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(SyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -772,7 +777,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: ledger = await async_client.customers.credits.ledger.list( customer_id="customer_id", ) - assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(AsyncPage[LedgerListResponse], ledger, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -789,7 +794,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None limit=1, minimum_amount="minimum_amount", ) - assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(AsyncPage[LedgerListResponse], ledger, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -800,7 +805,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(AsyncPage[LedgerListResponse], ledger, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -811,7 +816,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(AsyncPage[LedgerListResponse], ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -829,7 +834,7 @@ async def test_method_create_entry_overload_1(self, async_client: AsyncOrb) -> N amount=0, entry_type="increment", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_method_create_entry_with_all_params_overload_1(self, async_client: AsyncOrb) -> None: @@ -850,7 +855,7 @@ async def test_method_create_entry_with_all_params_overload_1(self, async_client metadata={"foo": "string"}, per_unit_cost_basis="per_unit_cost_basis", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_overload_1(self, async_client: AsyncOrb) -> None: @@ -863,7 +868,7 @@ async def test_raw_response_create_entry_overload_1(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_overload_1(self, async_client: AsyncOrb) -> None: @@ -876,7 +881,7 @@ async def test_streaming_response_create_entry_overload_1(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -896,7 +901,7 @@ async def test_method_create_entry_overload_2(self, async_client: AsyncOrb) -> N amount=0, entry_type="decrement", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_method_create_entry_with_all_params_overload_2(self, async_client: AsyncOrb) -> None: @@ -908,7 +913,7 @@ async def test_method_create_entry_with_all_params_overload_2(self, async_client description="description", metadata={"foo": "string"}, ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_overload_2(self, async_client: AsyncOrb) -> None: @@ -921,7 +926,7 @@ async def test_raw_response_create_entry_overload_2(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_overload_2(self, async_client: AsyncOrb) -> None: @@ -934,7 +939,7 @@ async def test_streaming_response_create_entry_overload_2(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -955,7 +960,7 @@ async def test_method_create_entry_overload_3(self, async_client: AsyncOrb) -> N expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_method_create_entry_with_all_params_overload_3(self, async_client: AsyncOrb) -> None: @@ -970,7 +975,7 @@ async def test_method_create_entry_with_all_params_overload_3(self, async_client description="description", metadata={"foo": "string"}, ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_overload_3(self, async_client: AsyncOrb) -> None: @@ -984,7 +989,7 @@ async def test_raw_response_create_entry_overload_3(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_overload_3(self, async_client: AsyncOrb) -> None: @@ -998,7 +1003,7 @@ async def test_streaming_response_create_entry_overload_3(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1020,7 +1025,7 @@ async def test_method_create_entry_overload_4(self, async_client: AsyncOrb) -> N block_id="block_id", entry_type="void", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_method_create_entry_with_all_params_overload_4(self, async_client: AsyncOrb) -> None: @@ -1034,7 +1039,7 @@ async def test_method_create_entry_with_all_params_overload_4(self, async_client metadata={"foo": "string"}, void_reason="refund", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_overload_4(self, async_client: AsyncOrb) -> None: @@ -1048,7 +1053,7 @@ async def test_raw_response_create_entry_overload_4(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_overload_4(self, async_client: AsyncOrb) -> None: @@ -1062,7 +1067,7 @@ async def test_streaming_response_create_entry_overload_4(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1084,7 +1089,7 @@ async def test_method_create_entry_overload_5(self, async_client: AsyncOrb) -> N block_id="block_id", entry_type="amendment", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_method_create_entry_with_all_params_overload_5(self, async_client: AsyncOrb) -> None: @@ -1097,7 +1102,7 @@ async def test_method_create_entry_with_all_params_overload_5(self, async_client description="description", metadata={"foo": "string"}, ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_overload_5(self, async_client: AsyncOrb) -> None: @@ -1111,7 +1116,7 @@ async def test_raw_response_create_entry_overload_5(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_overload_5(self, async_client: AsyncOrb) -> None: @@ -1125,7 +1130,7 @@ async def test_streaming_response_create_entry_overload_5(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1146,7 +1151,7 @@ async def test_method_create_entry_by_external_id_overload_1(self, async_client: amount=0, entry_type="increment", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_method_create_entry_by_external_id_with_all_params_overload_1(self, async_client: AsyncOrb) -> None: @@ -1167,7 +1172,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_1(sel metadata={"foo": "string"}, per_unit_cost_basis="per_unit_cost_basis", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_by_external_id_overload_1(self, async_client: AsyncOrb) -> None: @@ -1180,7 +1185,7 @@ async def test_raw_response_create_entry_by_external_id_overload_1(self, async_c assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_by_external_id_overload_1(self, async_client: AsyncOrb) -> None: @@ -1193,7 +1198,7 @@ async def test_streaming_response_create_entry_by_external_id_overload_1(self, a assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1213,7 +1218,7 @@ async def test_method_create_entry_by_external_id_overload_2(self, async_client: amount=0, entry_type="decrement", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_method_create_entry_by_external_id_with_all_params_overload_2(self, async_client: AsyncOrb) -> None: @@ -1225,7 +1230,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_2(sel description="description", metadata={"foo": "string"}, ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_by_external_id_overload_2(self, async_client: AsyncOrb) -> None: @@ -1238,7 +1243,7 @@ async def test_raw_response_create_entry_by_external_id_overload_2(self, async_c assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_by_external_id_overload_2(self, async_client: AsyncOrb) -> None: @@ -1251,7 +1256,7 @@ async def test_streaming_response_create_entry_by_external_id_overload_2(self, a assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1272,7 +1277,7 @@ async def test_method_create_entry_by_external_id_overload_3(self, async_client: expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_method_create_entry_by_external_id_with_all_params_overload_3(self, async_client: AsyncOrb) -> None: @@ -1287,7 +1292,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_3(sel description="description", metadata={"foo": "string"}, ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_by_external_id_overload_3(self, async_client: AsyncOrb) -> None: @@ -1301,7 +1306,7 @@ async def test_raw_response_create_entry_by_external_id_overload_3(self, async_c assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_by_external_id_overload_3(self, async_client: AsyncOrb) -> None: @@ -1315,7 +1320,7 @@ async def test_streaming_response_create_entry_by_external_id_overload_3(self, a assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1337,7 +1342,7 @@ async def test_method_create_entry_by_external_id_overload_4(self, async_client: block_id="block_id", entry_type="void", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_method_create_entry_by_external_id_with_all_params_overload_4(self, async_client: AsyncOrb) -> None: @@ -1351,7 +1356,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_4(sel metadata={"foo": "string"}, void_reason="refund", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_by_external_id_overload_4(self, async_client: AsyncOrb) -> None: @@ -1365,7 +1370,7 @@ async def test_raw_response_create_entry_by_external_id_overload_4(self, async_c assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_by_external_id_overload_4(self, async_client: AsyncOrb) -> None: @@ -1379,7 +1384,7 @@ async def test_streaming_response_create_entry_by_external_id_overload_4(self, a assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1401,7 +1406,7 @@ async def test_method_create_entry_by_external_id_overload_5(self, async_client: block_id="block_id", entry_type="amendment", ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_method_create_entry_by_external_id_with_all_params_overload_5(self, async_client: AsyncOrb) -> None: @@ -1414,7 +1419,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_5(sel description="description", metadata={"foo": "string"}, ) - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_by_external_id_overload_5(self, async_client: AsyncOrb) -> None: @@ -1428,7 +1433,7 @@ async def test_raw_response_create_entry_by_external_id_overload_5(self, async_c assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_by_external_id_overload_5(self, async_client: AsyncOrb) -> None: @@ -1442,7 +1447,7 @@ async def test_streaming_response_create_entry_by_external_id_overload_5(self, a assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) + assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1461,7 +1466,7 @@ async def test_method_list_by_external_id(self, async_client: AsyncOrb) -> None: ledger = await async_client.customers.credits.ledger.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(AsyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) @parametrize async def test_method_list_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1478,7 +1483,7 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As limit=1, minimum_amount="minimum_amount", ) - assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(AsyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) @parametrize async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -1489,7 +1494,7 @@ async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(AsyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) @parametrize async def test_streaming_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -1500,7 +1505,7 @@ async def test_streaming_response_list_by_external_id(self, async_client: AsyncO assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) + assert_matches_type(AsyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/customers/credits/test_top_ups.py b/tests/api_resources/customers/credits/test_top_ups.py index 0cf7af9f..03281ee1 100644 --- a/tests/api_resources/customers/credits/test_top_ups.py +++ b/tests/api_resources/customers/credits/test_top_ups.py @@ -11,7 +11,12 @@ from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import TopUpModel +from orb.types.customers.credits import ( + TopUpListResponse, + TopUpCreateResponse, + TopUpListByExternalIDResponse, + TopUpCreateByExternalIDResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -32,7 +37,7 @@ def test_method_create(self, client: Orb) -> None: per_unit_cost_basis="per_unit_cost_basis", threshold="threshold", ) - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -52,7 +57,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: expires_after=0, expires_after_unit="day", ) - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -71,7 +76,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -90,7 +95,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -114,7 +119,7 @@ def test_method_list(self, client: Orb) -> None: top_up = client.customers.credits.top_ups.list( customer_id="customer_id", ) - assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpListResponse], top_up, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -123,7 +128,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpListResponse], top_up, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -134,7 +139,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpListResponse], top_up, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -145,7 +150,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpListResponse], top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -217,7 +222,7 @@ def test_method_create_by_external_id(self, client: Orb) -> None: per_unit_cost_basis="per_unit_cost_basis", threshold="threshold", ) - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) @parametrize def test_method_create_by_external_id_with_all_params(self, client: Orb) -> None: @@ -237,7 +242,7 @@ def test_method_create_by_external_id_with_all_params(self, client: Orb) -> None expires_after=0, expires_after_unit="day", ) - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) @parametrize def test_raw_response_create_by_external_id(self, client: Orb) -> None: @@ -256,7 +261,7 @@ def test_raw_response_create_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) @parametrize def test_streaming_response_create_by_external_id(self, client: Orb) -> None: @@ -275,7 +280,7 @@ def test_streaming_response_create_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -347,7 +352,7 @@ def test_method_list_by_external_id(self, client: Orb) -> None: top_up = client.customers.credits.top_ups.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) @parametrize def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: @@ -356,7 +361,7 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) @parametrize def test_raw_response_list_by_external_id(self, client: Orb) -> None: @@ -367,7 +372,7 @@ def test_raw_response_list_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) @parametrize def test_streaming_response_list_by_external_id(self, client: Orb) -> None: @@ -378,7 +383,7 @@ def test_streaming_response_list_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -406,7 +411,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: per_unit_cost_basis="per_unit_cost_basis", threshold="threshold", ) - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -426,7 +431,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No expires_after=0, expires_after_unit="day", ) - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -445,7 +450,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -464,7 +469,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = await response.parse() - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -488,7 +493,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: top_up = await async_client.customers.credits.top_ups.list( customer_id="customer_id", ) - assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpListResponse], top_up, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -497,7 +502,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpListResponse], top_up, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -508,7 +513,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpListResponse], top_up, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -519,7 +524,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = await response.parse() - assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpListResponse], top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -591,7 +596,7 @@ async def test_method_create_by_external_id(self, async_client: AsyncOrb) -> Non per_unit_cost_basis="per_unit_cost_basis", threshold="threshold", ) - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) @parametrize async def test_method_create_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None: @@ -611,7 +616,7 @@ async def test_method_create_by_external_id_with_all_params(self, async_client: expires_after=0, expires_after_unit="day", ) - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) @parametrize async def test_raw_response_create_by_external_id(self, async_client: AsyncOrb) -> None: @@ -630,7 +635,7 @@ async def test_raw_response_create_by_external_id(self, async_client: AsyncOrb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) @parametrize async def test_streaming_response_create_by_external_id(self, async_client: AsyncOrb) -> None: @@ -649,7 +654,7 @@ async def test_streaming_response_create_by_external_id(self, async_client: Asyn assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = await response.parse() - assert_matches_type(TopUpModel, top_up, path=["response"]) + assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -721,7 +726,7 @@ async def test_method_list_by_external_id(self, async_client: AsyncOrb) -> None: top_up = await async_client.customers.credits.top_ups.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) @parametrize async def test_method_list_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None: @@ -730,7 +735,7 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) @parametrize async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -741,7 +746,7 @@ async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) @parametrize async def test_streaming_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -752,7 +757,7 @@ async def test_streaming_response_list_by_external_id(self, async_client: AsyncO assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = await response.parse() - assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/customers/test_balance_transactions.py b/tests/api_resources/customers/test_balance_transactions.py index 10fe89aa..77d23372 100644 --- a/tests/api_resources/customers/test_balance_transactions.py +++ b/tests/api_resources/customers/test_balance_transactions.py @@ -11,7 +11,10 @@ from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import CustomerBalanceTransactionModel +from orb.types.customers import ( + BalanceTransactionListResponse, + BalanceTransactionCreateResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +29,7 @@ def test_method_create(self, client: Orb) -> None: amount="amount", type="increment", ) - assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) + assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -36,7 +39,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: type="increment", description="description", ) - assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) + assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -49,7 +52,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = response.parse() - assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) + assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -62,7 +65,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = response.parse() - assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) + assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) assert cast(Any, response.is_closed) is True @@ -80,7 +83,7 @@ def test_method_list(self, client: Orb) -> None: balance_transaction = client.customers.balance_transactions.list( customer_id="customer_id", ) - assert_matches_type(SyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) + assert_matches_type(SyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -93,7 +96,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: operation_time_lt=parse_datetime("2019-12-27T18:11:19.117Z"), operation_time_lte=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(SyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) + assert_matches_type(SyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -104,7 +107,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = response.parse() - assert_matches_type(SyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) + assert_matches_type(SyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -115,7 +118,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = response.parse() - assert_matches_type(SyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) + assert_matches_type(SyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) assert cast(Any, response.is_closed) is True @@ -137,7 +140,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: amount="amount", type="increment", ) - assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) + assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -147,7 +150,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No type="increment", description="description", ) - assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) + assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -160,7 +163,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = response.parse() - assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) + assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -173,7 +176,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = await response.parse() - assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) + assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) assert cast(Any, response.is_closed) is True @@ -191,7 +194,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: balance_transaction = await async_client.customers.balance_transactions.list( customer_id="customer_id", ) - assert_matches_type(AsyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) + assert_matches_type(AsyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -204,7 +207,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None operation_time_lt=parse_datetime("2019-12-27T18:11:19.117Z"), operation_time_lte=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(AsyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) + assert_matches_type(AsyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -215,7 +218,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = response.parse() - assert_matches_type(AsyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) + assert_matches_type(AsyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -226,7 +229,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = await response.parse() - assert_matches_type(AsyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) + assert_matches_type(AsyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/customers/test_costs.py b/tests/api_resources/customers/test_costs.py index 603e4258..17d95e60 100644 --- a/tests/api_resources/customers/test_costs.py +++ b/tests/api_resources/customers/test_costs.py @@ -10,7 +10,10 @@ from orb import Orb, AsyncOrb from orb._utils import parse_datetime from tests.utils import assert_matches_type -from orb.types.shared import CustomerCostsModel +from orb.types.customers import ( + CostListResponse, + CostListByExternalIDResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +26,7 @@ def test_method_list(self, client: Orb) -> None: cost = client.customers.costs.list( customer_id="customer_id", ) - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListResponse, cost, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -34,7 +37,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: timeframe_start=parse_datetime("2022-02-01T05:00:00Z"), view_mode="periodic", ) - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListResponse, cost, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -45,7 +48,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = response.parse() - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListResponse, cost, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -56,7 +59,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = response.parse() - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListResponse, cost, path=["response"]) assert cast(Any, response.is_closed) is True @@ -72,7 +75,7 @@ def test_method_list_by_external_id(self, client: Orb) -> None: cost = client.customers.costs.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) @parametrize def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: @@ -83,7 +86,7 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: timeframe_start=parse_datetime("2022-02-01T05:00:00Z"), view_mode="periodic", ) - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) @parametrize def test_raw_response_list_by_external_id(self, client: Orb) -> None: @@ -94,7 +97,7 @@ def test_raw_response_list_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = response.parse() - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) @parametrize def test_streaming_response_list_by_external_id(self, client: Orb) -> None: @@ -105,7 +108,7 @@ def test_streaming_response_list_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = response.parse() - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) assert cast(Any, response.is_closed) is True @@ -125,7 +128,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: cost = await async_client.customers.costs.list( customer_id="customer_id", ) - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListResponse, cost, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -136,7 +139,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None timeframe_start=parse_datetime("2022-02-01T05:00:00Z"), view_mode="periodic", ) - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListResponse, cost, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -147,7 +150,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = response.parse() - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListResponse, cost, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -158,7 +161,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = await response.parse() - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListResponse, cost, path=["response"]) assert cast(Any, response.is_closed) is True @@ -174,7 +177,7 @@ async def test_method_list_by_external_id(self, async_client: AsyncOrb) -> None: cost = await async_client.customers.costs.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) @parametrize async def test_method_list_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None: @@ -185,7 +188,7 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As timeframe_start=parse_datetime("2022-02-01T05:00:00Z"), view_mode="periodic", ) - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) @parametrize async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -196,7 +199,7 @@ async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = response.parse() - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) @parametrize async def test_streaming_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -207,7 +210,7 @@ async def test_streaming_response_list_by_external_id(self, async_client: AsyncO assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = await response.parse() - assert_matches_type(CustomerCostsModel, cost, path=["response"]) + assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/customers/test_credits.py b/tests/api_resources/customers/test_credits.py index 9e1abcf5..19de5732 100644 --- a/tests/api_resources/customers/test_credits.py +++ b/tests/api_resources/customers/test_credits.py @@ -10,7 +10,10 @@ from orb import Orb, AsyncOrb from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared.customer_credit_balances_model import Data +from orb.types.customers import ( + CreditListResponse, + CreditListByExternalIDResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +26,7 @@ def test_method_list(self, client: Orb) -> None: credit = client.customers.credits.list( customer_id="customer_id", ) - assert_matches_type(SyncPage[Data], credit, path=["response"]) + assert_matches_type(SyncPage[CreditListResponse], credit, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -34,7 +37,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: include_all_blocks=True, limit=1, ) - assert_matches_type(SyncPage[Data], credit, path=["response"]) + assert_matches_type(SyncPage[CreditListResponse], credit, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -45,7 +48,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = response.parse() - assert_matches_type(SyncPage[Data], credit, path=["response"]) + assert_matches_type(SyncPage[CreditListResponse], credit, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -56,7 +59,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = response.parse() - assert_matches_type(SyncPage[Data], credit, path=["response"]) + assert_matches_type(SyncPage[CreditListResponse], credit, path=["response"]) assert cast(Any, response.is_closed) is True @@ -72,7 +75,7 @@ def test_method_list_by_external_id(self, client: Orb) -> None: credit = client.customers.credits.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(SyncPage[Data], credit, path=["response"]) + assert_matches_type(SyncPage[CreditListByExternalIDResponse], credit, path=["response"]) @parametrize def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: @@ -83,7 +86,7 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: include_all_blocks=True, limit=1, ) - assert_matches_type(SyncPage[Data], credit, path=["response"]) + assert_matches_type(SyncPage[CreditListByExternalIDResponse], credit, path=["response"]) @parametrize def test_raw_response_list_by_external_id(self, client: Orb) -> None: @@ -94,7 +97,7 @@ def test_raw_response_list_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = response.parse() - assert_matches_type(SyncPage[Data], credit, path=["response"]) + assert_matches_type(SyncPage[CreditListByExternalIDResponse], credit, path=["response"]) @parametrize def test_streaming_response_list_by_external_id(self, client: Orb) -> None: @@ -105,7 +108,7 @@ def test_streaming_response_list_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = response.parse() - assert_matches_type(SyncPage[Data], credit, path=["response"]) + assert_matches_type(SyncPage[CreditListByExternalIDResponse], credit, path=["response"]) assert cast(Any, response.is_closed) is True @@ -125,7 +128,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: credit = await async_client.customers.credits.list( customer_id="customer_id", ) - assert_matches_type(AsyncPage[Data], credit, path=["response"]) + assert_matches_type(AsyncPage[CreditListResponse], credit, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -136,7 +139,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None include_all_blocks=True, limit=1, ) - assert_matches_type(AsyncPage[Data], credit, path=["response"]) + assert_matches_type(AsyncPage[CreditListResponse], credit, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -147,7 +150,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = response.parse() - assert_matches_type(AsyncPage[Data], credit, path=["response"]) + assert_matches_type(AsyncPage[CreditListResponse], credit, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -158,7 +161,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = await response.parse() - assert_matches_type(AsyncPage[Data], credit, path=["response"]) + assert_matches_type(AsyncPage[CreditListResponse], credit, path=["response"]) assert cast(Any, response.is_closed) is True @@ -174,7 +177,7 @@ async def test_method_list_by_external_id(self, async_client: AsyncOrb) -> None: credit = await async_client.customers.credits.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(AsyncPage[Data], credit, path=["response"]) + assert_matches_type(AsyncPage[CreditListByExternalIDResponse], credit, path=["response"]) @parametrize async def test_method_list_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None: @@ -185,7 +188,7 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As include_all_blocks=True, limit=1, ) - assert_matches_type(AsyncPage[Data], credit, path=["response"]) + assert_matches_type(AsyncPage[CreditListByExternalIDResponse], credit, path=["response"]) @parametrize async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -196,7 +199,7 @@ async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = response.parse() - assert_matches_type(AsyncPage[Data], credit, path=["response"]) + assert_matches_type(AsyncPage[CreditListByExternalIDResponse], credit, path=["response"]) @parametrize async def test_streaming_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -207,7 +210,7 @@ async def test_streaming_response_list_by_external_id(self, async_client: AsyncO assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = await response.parse() - assert_matches_type(AsyncPage[Data], credit, path=["response"]) + assert_matches_type(AsyncPage[CreditListByExternalIDResponse], credit, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/dimensional_price_groups/test_external_dimensional_price_group_id.py b/tests/api_resources/dimensional_price_groups/test_external_dimensional_price_group_id.py index d6af6534..e4d7118f 100644 --- a/tests/api_resources/dimensional_price_groups/test_external_dimensional_price_group_id.py +++ b/tests/api_resources/dimensional_price_groups/test_external_dimensional_price_group_id.py @@ -8,8 +8,8 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import DimensionalPriceGroup from tests.utils import assert_matches_type -from orb.types.shared import DimensionalPriceGroupModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_retrieve(self, client: Orb) -> None: "external_dimensional_price_group_id", ) ) - assert_matches_type(DimensionalPriceGroupModel, external_dimensional_price_group_id, path=["response"]) + assert_matches_type(DimensionalPriceGroup, external_dimensional_price_group_id, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Orb) -> None: @@ -35,7 +35,7 @@ def test_raw_response_retrieve(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_dimensional_price_group_id = response.parse() - assert_matches_type(DimensionalPriceGroupModel, external_dimensional_price_group_id, path=["response"]) + assert_matches_type(DimensionalPriceGroup, external_dimensional_price_group_id, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Orb) -> None: @@ -46,7 +46,7 @@ def test_streaming_response_retrieve(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_dimensional_price_group_id = response.parse() - assert_matches_type(DimensionalPriceGroupModel, external_dimensional_price_group_id, path=["response"]) + assert_matches_type(DimensionalPriceGroup, external_dimensional_price_group_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +70,7 @@ async def test_method_retrieve(self, async_client: AsyncOrb) -> None: "external_dimensional_price_group_id", ) ) - assert_matches_type(DimensionalPriceGroupModel, external_dimensional_price_group_id, path=["response"]) + assert_matches_type(DimensionalPriceGroup, external_dimensional_price_group_id, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: @@ -83,7 +83,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_dimensional_price_group_id = response.parse() - assert_matches_type(DimensionalPriceGroupModel, external_dimensional_price_group_id, path=["response"]) + assert_matches_type(DimensionalPriceGroup, external_dimensional_price_group_id, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None: @@ -96,7 +96,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_dimensional_price_group_id = await response.parse() - assert_matches_type(DimensionalPriceGroupModel, external_dimensional_price_group_id, path=["response"]) + assert_matches_type(DimensionalPriceGroup, external_dimensional_price_group_id, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/events/test_backfills.py b/tests/api_resources/events/test_backfills.py index ca095e83..bed65b8c 100644 --- a/tests/api_resources/events/test_backfills.py +++ b/tests/api_resources/events/test_backfills.py @@ -11,7 +11,13 @@ from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import BackfillModel +from orb.types.events import ( + BackfillListResponse, + BackfillCloseResponse, + BackfillFetchResponse, + BackfillCreateResponse, + BackfillRevertResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +31,7 @@ def test_method_create(self, client: Orb) -> None: timeframe_end=parse_datetime("2019-12-27T18:11:19.117Z"), timeframe_start=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -38,7 +44,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: external_customer_id="external_customer_id", replace_existing_events=True, ) - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -50,7 +56,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -62,14 +68,14 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_list(self, client: Orb) -> None: backfill = client.events.backfills.list() - assert_matches_type(SyncPage[BackfillModel], backfill, path=["response"]) + assert_matches_type(SyncPage[BackfillListResponse], backfill, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -77,7 +83,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[BackfillModel], backfill, path=["response"]) + assert_matches_type(SyncPage[BackfillListResponse], backfill, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -86,7 +92,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(SyncPage[BackfillModel], backfill, path=["response"]) + assert_matches_type(SyncPage[BackfillListResponse], backfill, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -95,7 +101,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(SyncPage[BackfillModel], backfill, path=["response"]) + assert_matches_type(SyncPage[BackfillListResponse], backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -104,7 +110,7 @@ def test_method_close(self, client: Orb) -> None: backfill = client.events.backfills.close( "backfill_id", ) - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCloseResponse, backfill, path=["response"]) @parametrize def test_raw_response_close(self, client: Orb) -> None: @@ -115,7 +121,7 @@ def test_raw_response_close(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCloseResponse, backfill, path=["response"]) @parametrize def test_streaming_response_close(self, client: Orb) -> None: @@ -126,7 +132,7 @@ def test_streaming_response_close(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCloseResponse, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -142,7 +148,7 @@ def test_method_fetch(self, client: Orb) -> None: backfill = client.events.backfills.fetch( "backfill_id", ) - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillFetchResponse, backfill, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -153,7 +159,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillFetchResponse, backfill, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -164,7 +170,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillFetchResponse, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -180,7 +186,7 @@ def test_method_revert(self, client: Orb) -> None: backfill = client.events.backfills.revert( "backfill_id", ) - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillRevertResponse, backfill, path=["response"]) @parametrize def test_raw_response_revert(self, client: Orb) -> None: @@ -191,7 +197,7 @@ def test_raw_response_revert(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillRevertResponse, backfill, path=["response"]) @parametrize def test_streaming_response_revert(self, client: Orb) -> None: @@ -202,7 +208,7 @@ def test_streaming_response_revert(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillRevertResponse, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -223,7 +229,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: timeframe_end=parse_datetime("2019-12-27T18:11:19.117Z"), timeframe_start=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -236,7 +242,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No external_customer_id="external_customer_id", replace_existing_events=True, ) - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -248,7 +254,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -260,14 +266,14 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = await response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: backfill = await async_client.events.backfills.list() - assert_matches_type(AsyncPage[BackfillModel], backfill, path=["response"]) + assert_matches_type(AsyncPage[BackfillListResponse], backfill, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -275,7 +281,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[BackfillModel], backfill, path=["response"]) + assert_matches_type(AsyncPage[BackfillListResponse], backfill, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -284,7 +290,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(AsyncPage[BackfillModel], backfill, path=["response"]) + assert_matches_type(AsyncPage[BackfillListResponse], backfill, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -293,7 +299,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = await response.parse() - assert_matches_type(AsyncPage[BackfillModel], backfill, path=["response"]) + assert_matches_type(AsyncPage[BackfillListResponse], backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -302,7 +308,7 @@ async def test_method_close(self, async_client: AsyncOrb) -> None: backfill = await async_client.events.backfills.close( "backfill_id", ) - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCloseResponse, backfill, path=["response"]) @parametrize async def test_raw_response_close(self, async_client: AsyncOrb) -> None: @@ -313,7 +319,7 @@ async def test_raw_response_close(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCloseResponse, backfill, path=["response"]) @parametrize async def test_streaming_response_close(self, async_client: AsyncOrb) -> None: @@ -324,7 +330,7 @@ async def test_streaming_response_close(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = await response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillCloseResponse, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -340,7 +346,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: backfill = await async_client.events.backfills.fetch( "backfill_id", ) - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillFetchResponse, backfill, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -351,7 +357,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillFetchResponse, backfill, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -362,7 +368,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = await response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillFetchResponse, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -378,7 +384,7 @@ async def test_method_revert(self, async_client: AsyncOrb) -> None: backfill = await async_client.events.backfills.revert( "backfill_id", ) - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillRevertResponse, backfill, path=["response"]) @parametrize async def test_raw_response_revert(self, async_client: AsyncOrb) -> None: @@ -389,7 +395,7 @@ async def test_raw_response_revert(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillRevertResponse, backfill, path=["response"]) @parametrize async def test_streaming_response_revert(self, async_client: AsyncOrb) -> None: @@ -400,7 +406,7 @@ async def test_streaming_response_revert(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = await response.parse() - assert_matches_type(BackfillModel, backfill, path=["response"]) + assert_matches_type(BackfillRevertResponse, backfill, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/plans/test_external_plan_id.py b/tests/api_resources/plans/test_external_plan_id.py index 75448b46..a73b26ea 100644 --- a/tests/api_resources/plans/test_external_plan_id.py +++ b/tests/api_resources/plans/test_external_plan_id.py @@ -8,8 +8,8 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import Plan from tests.utils import assert_matches_type -from orb.types.shared import PlanModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ def test_method_update(self, client: Orb) -> None: external_plan_id = client.plans.external_plan_id.update( other_external_plan_id="external_plan_id", ) - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -31,7 +31,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: external_plan_id="external_plan_id", metadata={"foo": "string"}, ) - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -42,7 +42,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = response.parse() - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -53,7 +53,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = response.parse() - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -72,7 +72,7 @@ def test_method_fetch(self, client: Orb) -> None: external_plan_id = client.plans.external_plan_id.fetch( "external_plan_id", ) - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -83,7 +83,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = response.parse() - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -94,7 +94,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = response.parse() - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -114,7 +114,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: external_plan_id = await async_client.plans.external_plan_id.update( other_external_plan_id="external_plan_id", ) - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -123,7 +123,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No external_plan_id="external_plan_id", metadata={"foo": "string"}, ) - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -134,7 +134,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = response.parse() - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -145,7 +145,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = await response.parse() - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -164,7 +164,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: external_plan_id = await async_client.plans.external_plan_id.fetch( "external_plan_id", ) - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -175,7 +175,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = response.parse() - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -186,7 +186,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = await response.parse() - assert_matches_type(PlanModel, external_plan_id, path=["response"]) + assert_matches_type(Plan, external_plan_id, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/prices/test_external_price_id.py b/tests/api_resources/prices/test_external_price_id.py index 9128c0dc..cfee75ae 100644 --- a/tests/api_resources/prices/test_external_price_id.py +++ b/tests/api_resources/prices/test_external_price_id.py @@ -8,8 +8,8 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import Price from tests.utils import assert_matches_type -from orb.types.shared import PriceModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ def test_method_update(self, client: Orb) -> None: external_price_id = client.prices.external_price_id.update( external_price_id="external_price_id", ) - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -30,7 +30,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: external_price_id="external_price_id", metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -41,7 +41,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = response.parse() - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -52,7 +52,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = response.parse() - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -68,7 +68,7 @@ def test_method_fetch(self, client: Orb) -> None: external_price_id = client.prices.external_price_id.fetch( "external_price_id", ) - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -79,7 +79,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = response.parse() - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -90,7 +90,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = response.parse() - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -110,7 +110,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: external_price_id = await async_client.prices.external_price_id.update( external_price_id="external_price_id", ) - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -118,7 +118,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No external_price_id="external_price_id", metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -129,7 +129,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = response.parse() - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -140,7 +140,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = await response.parse() - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -156,7 +156,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: external_price_id = await async_client.prices.external_price_id.fetch( "external_price_id", ) - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -167,7 +167,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = response.parse() - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -178,7 +178,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = await response.parse() - assert_matches_type(PriceModel, external_price_id, path=["response"]) + assert_matches_type(Price, external_price_id, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_alerts.py b/tests/api_resources/test_alerts.py index 1425bd7e..568aa4ea 100644 --- a/tests/api_resources/test_alerts.py +++ b/tests/api_resources/test_alerts.py @@ -8,10 +8,12 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import ( + Alert, +) from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import AlertModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +26,7 @@ def test_method_retrieve(self, client: Orb) -> None: alert = client.alerts.retrieve( "alert_id", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Orb) -> None: @@ -35,7 +37,7 @@ def test_raw_response_retrieve(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Orb) -> None: @@ -46,7 +48,7 @@ def test_streaming_response_retrieve(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -63,7 +65,7 @@ def test_method_update(self, client: Orb) -> None: alert_configuration_id="alert_configuration_id", thresholds=[{"value": 0}], ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -75,7 +77,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -87,7 +89,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -105,7 +107,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: alert = client.alerts.list() - assert_matches_type(SyncPage[AlertModel], alert, path=["response"]) + assert_matches_type(SyncPage[Alert], alert, path=["response"]) @pytest.mark.skip(reason="plan_version=0 breaks Prism") @parametrize @@ -121,7 +123,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: limit=1, subscription_id="subscription_id", ) - assert_matches_type(SyncPage[AlertModel], alert, path=["response"]) + assert_matches_type(SyncPage[Alert], alert, path=["response"]) @pytest.mark.skip(reason="plan_version=0 breaks Prism") @parametrize @@ -131,7 +133,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(SyncPage[AlertModel], alert, path=["response"]) + assert_matches_type(SyncPage[Alert], alert, path=["response"]) @pytest.mark.skip(reason="plan_version=0 breaks Prism") @parametrize @@ -141,7 +143,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(SyncPage[AlertModel], alert, path=["response"]) + assert_matches_type(SyncPage[Alert], alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -152,7 +154,7 @@ def test_method_create_for_customer(self, client: Orb) -> None: currency="currency", type="usage_exceeded", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_method_create_for_customer_with_all_params(self, client: Orb) -> None: @@ -162,7 +164,7 @@ def test_method_create_for_customer_with_all_params(self, client: Orb) -> None: type="usage_exceeded", thresholds=[{"value": 0}], ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_raw_response_create_for_customer(self, client: Orb) -> None: @@ -175,7 +177,7 @@ def test_raw_response_create_for_customer(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_streaming_response_create_for_customer(self, client: Orb) -> None: @@ -188,7 +190,7 @@ def test_streaming_response_create_for_customer(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -208,7 +210,7 @@ def test_method_create_for_external_customer(self, client: Orb) -> None: currency="currency", type="usage_exceeded", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_method_create_for_external_customer_with_all_params(self, client: Orb) -> None: @@ -218,7 +220,7 @@ def test_method_create_for_external_customer_with_all_params(self, client: Orb) type="usage_exceeded", thresholds=[{"value": 0}], ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_raw_response_create_for_external_customer(self, client: Orb) -> None: @@ -231,7 +233,7 @@ def test_raw_response_create_for_external_customer(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_streaming_response_create_for_external_customer(self, client: Orb) -> None: @@ -244,7 +246,7 @@ def test_streaming_response_create_for_external_customer(self, client: Orb) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -264,7 +266,7 @@ def test_method_create_for_subscription(self, client: Orb) -> None: thresholds=[{"value": 0}], type="usage_exceeded", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_method_create_for_subscription_with_all_params(self, client: Orb) -> None: @@ -274,7 +276,7 @@ def test_method_create_for_subscription_with_all_params(self, client: Orb) -> No type="usage_exceeded", metric_id="metric_id", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_raw_response_create_for_subscription(self, client: Orb) -> None: @@ -287,7 +289,7 @@ def test_raw_response_create_for_subscription(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_streaming_response_create_for_subscription(self, client: Orb) -> None: @@ -300,7 +302,7 @@ def test_streaming_response_create_for_subscription(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -318,7 +320,7 @@ def test_method_disable(self, client: Orb) -> None: alert = client.alerts.disable( alert_configuration_id="alert_configuration_id", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_method_disable_with_all_params(self, client: Orb) -> None: @@ -326,7 +328,7 @@ def test_method_disable_with_all_params(self, client: Orb) -> None: alert_configuration_id="alert_configuration_id", subscription_id="subscription_id", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_raw_response_disable(self, client: Orb) -> None: @@ -337,7 +339,7 @@ def test_raw_response_disable(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_streaming_response_disable(self, client: Orb) -> None: @@ -348,7 +350,7 @@ def test_streaming_response_disable(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -366,7 +368,7 @@ def test_method_enable(self, client: Orb) -> None: alert = client.alerts.enable( alert_configuration_id="alert_configuration_id", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_method_enable_with_all_params(self, client: Orb) -> None: @@ -374,7 +376,7 @@ def test_method_enable_with_all_params(self, client: Orb) -> None: alert_configuration_id="alert_configuration_id", subscription_id="subscription_id", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_raw_response_enable(self, client: Orb) -> None: @@ -385,7 +387,7 @@ def test_raw_response_enable(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize def test_streaming_response_enable(self, client: Orb) -> None: @@ -396,7 +398,7 @@ def test_streaming_response_enable(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -418,7 +420,7 @@ async def test_method_retrieve(self, async_client: AsyncOrb) -> None: alert = await async_client.alerts.retrieve( "alert_id", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: @@ -429,7 +431,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None: @@ -440,7 +442,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -457,7 +459,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: alert_configuration_id="alert_configuration_id", thresholds=[{"value": 0}], ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -469,7 +471,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -481,7 +483,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -499,7 +501,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: alert = await async_client.alerts.list() - assert_matches_type(AsyncPage[AlertModel], alert, path=["response"]) + assert_matches_type(AsyncPage[Alert], alert, path=["response"]) @pytest.mark.skip(reason="plan_version=0 breaks Prism") @parametrize @@ -515,7 +517,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None limit=1, subscription_id="subscription_id", ) - assert_matches_type(AsyncPage[AlertModel], alert, path=["response"]) + assert_matches_type(AsyncPage[Alert], alert, path=["response"]) @pytest.mark.skip(reason="plan_version=0 breaks Prism") @parametrize @@ -525,7 +527,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AsyncPage[AlertModel], alert, path=["response"]) + assert_matches_type(AsyncPage[Alert], alert, path=["response"]) @pytest.mark.skip(reason="plan_version=0 breaks Prism") @parametrize @@ -535,7 +537,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(AsyncPage[AlertModel], alert, path=["response"]) + assert_matches_type(AsyncPage[Alert], alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -546,7 +548,7 @@ async def test_method_create_for_customer(self, async_client: AsyncOrb) -> None: currency="currency", type="usage_exceeded", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_method_create_for_customer_with_all_params(self, async_client: AsyncOrb) -> None: @@ -556,7 +558,7 @@ async def test_method_create_for_customer_with_all_params(self, async_client: As type="usage_exceeded", thresholds=[{"value": 0}], ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_raw_response_create_for_customer(self, async_client: AsyncOrb) -> None: @@ -569,7 +571,7 @@ async def test_raw_response_create_for_customer(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_streaming_response_create_for_customer(self, async_client: AsyncOrb) -> None: @@ -582,7 +584,7 @@ async def test_streaming_response_create_for_customer(self, async_client: AsyncO assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -602,7 +604,7 @@ async def test_method_create_for_external_customer(self, async_client: AsyncOrb) currency="currency", type="usage_exceeded", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_method_create_for_external_customer_with_all_params(self, async_client: AsyncOrb) -> None: @@ -612,7 +614,7 @@ async def test_method_create_for_external_customer_with_all_params(self, async_c type="usage_exceeded", thresholds=[{"value": 0}], ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_raw_response_create_for_external_customer(self, async_client: AsyncOrb) -> None: @@ -625,7 +627,7 @@ async def test_raw_response_create_for_external_customer(self, async_client: Asy assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_streaming_response_create_for_external_customer(self, async_client: AsyncOrb) -> None: @@ -638,7 +640,7 @@ async def test_streaming_response_create_for_external_customer(self, async_clien assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -658,7 +660,7 @@ async def test_method_create_for_subscription(self, async_client: AsyncOrb) -> N thresholds=[{"value": 0}], type="usage_exceeded", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_method_create_for_subscription_with_all_params(self, async_client: AsyncOrb) -> None: @@ -668,7 +670,7 @@ async def test_method_create_for_subscription_with_all_params(self, async_client type="usage_exceeded", metric_id="metric_id", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_raw_response_create_for_subscription(self, async_client: AsyncOrb) -> None: @@ -681,7 +683,7 @@ async def test_raw_response_create_for_subscription(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_streaming_response_create_for_subscription(self, async_client: AsyncOrb) -> None: @@ -694,7 +696,7 @@ async def test_streaming_response_create_for_subscription(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -712,7 +714,7 @@ async def test_method_disable(self, async_client: AsyncOrb) -> None: alert = await async_client.alerts.disable( alert_configuration_id="alert_configuration_id", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_method_disable_with_all_params(self, async_client: AsyncOrb) -> None: @@ -720,7 +722,7 @@ async def test_method_disable_with_all_params(self, async_client: AsyncOrb) -> N alert_configuration_id="alert_configuration_id", subscription_id="subscription_id", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_raw_response_disable(self, async_client: AsyncOrb) -> None: @@ -731,7 +733,7 @@ async def test_raw_response_disable(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_streaming_response_disable(self, async_client: AsyncOrb) -> None: @@ -742,7 +744,7 @@ async def test_streaming_response_disable(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -760,7 +762,7 @@ async def test_method_enable(self, async_client: AsyncOrb) -> None: alert = await async_client.alerts.enable( alert_configuration_id="alert_configuration_id", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_method_enable_with_all_params(self, async_client: AsyncOrb) -> None: @@ -768,7 +770,7 @@ async def test_method_enable_with_all_params(self, async_client: AsyncOrb) -> No alert_configuration_id="alert_configuration_id", subscription_id="subscription_id", ) - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_raw_response_enable(self, async_client: AsyncOrb) -> None: @@ -779,7 +781,7 @@ async def test_raw_response_enable(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) @parametrize async def test_streaming_response_enable(self, async_client: AsyncOrb) -> None: @@ -790,7 +792,7 @@ async def test_streaming_response_enable(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(AlertModel, alert, path=["response"]) + assert_matches_type(Alert, alert, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_coupons.py b/tests/api_resources/test_coupons.py index 4c9e0f59..8d59baa8 100644 --- a/tests/api_resources/test_coupons.py +++ b/tests/api_resources/test_coupons.py @@ -8,9 +8,9 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import Coupon from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import CouponModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -27,7 +27,7 @@ def test_method_create(self, client: Orb) -> None: }, redemption_code="HALFOFF", ) - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -40,7 +40,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: duration_in_months=12, max_redemptions=1, ) - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -55,7 +55,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -70,14 +70,14 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_list(self, client: Orb) -> None: coupon = client.coupons.list() - assert_matches_type(SyncPage[CouponModel], coupon, path=["response"]) + assert_matches_type(SyncPage[Coupon], coupon, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -87,7 +87,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: redemption_code="redemption_code", show_archived=True, ) - assert_matches_type(SyncPage[CouponModel], coupon, path=["response"]) + assert_matches_type(SyncPage[Coupon], coupon, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -96,7 +96,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(SyncPage[CouponModel], coupon, path=["response"]) + assert_matches_type(SyncPage[Coupon], coupon, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -105,7 +105,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(SyncPage[CouponModel], coupon, path=["response"]) + assert_matches_type(SyncPage[Coupon], coupon, path=["response"]) assert cast(Any, response.is_closed) is True @@ -114,7 +114,7 @@ def test_method_archive(self, client: Orb) -> None: coupon = client.coupons.archive( "coupon_id", ) - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize def test_raw_response_archive(self, client: Orb) -> None: @@ -125,7 +125,7 @@ def test_raw_response_archive(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize def test_streaming_response_archive(self, client: Orb) -> None: @@ -136,7 +136,7 @@ def test_streaming_response_archive(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) assert cast(Any, response.is_closed) is True @@ -152,7 +152,7 @@ def test_method_fetch(self, client: Orb) -> None: coupon = client.coupons.fetch( "coupon_id", ) - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -163,7 +163,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -174,7 +174,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) assert cast(Any, response.is_closed) is True @@ -198,7 +198,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: }, redemption_code="HALFOFF", ) - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -211,7 +211,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No duration_in_months=12, max_redemptions=1, ) - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -226,7 +226,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -241,14 +241,14 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = await response.parse() - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: coupon = await async_client.coupons.list() - assert_matches_type(AsyncPage[CouponModel], coupon, path=["response"]) + assert_matches_type(AsyncPage[Coupon], coupon, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -258,7 +258,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None redemption_code="redemption_code", show_archived=True, ) - assert_matches_type(AsyncPage[CouponModel], coupon, path=["response"]) + assert_matches_type(AsyncPage[Coupon], coupon, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -267,7 +267,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(AsyncPage[CouponModel], coupon, path=["response"]) + assert_matches_type(AsyncPage[Coupon], coupon, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -276,7 +276,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = await response.parse() - assert_matches_type(AsyncPage[CouponModel], coupon, path=["response"]) + assert_matches_type(AsyncPage[Coupon], coupon, path=["response"]) assert cast(Any, response.is_closed) is True @@ -285,7 +285,7 @@ async def test_method_archive(self, async_client: AsyncOrb) -> None: coupon = await async_client.coupons.archive( "coupon_id", ) - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize async def test_raw_response_archive(self, async_client: AsyncOrb) -> None: @@ -296,7 +296,7 @@ async def test_raw_response_archive(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize async def test_streaming_response_archive(self, async_client: AsyncOrb) -> None: @@ -307,7 +307,7 @@ async def test_streaming_response_archive(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = await response.parse() - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) assert cast(Any, response.is_closed) is True @@ -323,7 +323,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: coupon = await async_client.coupons.fetch( "coupon_id", ) - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -334,7 +334,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -345,7 +345,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = await response.parse() - assert_matches_type(CouponModel, coupon, path=["response"]) + assert_matches_type(Coupon, coupon, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_credit_notes.py b/tests/api_resources/test_credit_notes.py index 73080142..08d07146 100644 --- a/tests/api_resources/test_credit_notes.py +++ b/tests/api_resources/test_credit_notes.py @@ -8,9 +8,9 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import CreditNote from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import CreditNoteModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +28,7 @@ def test_method_create(self, client: Orb) -> None: } ], ) - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -42,7 +42,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: memo="An optional memo for my credit note.", reason="duplicate", ) - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -74,14 +74,14 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_list(self, client: Orb) -> None: credit_note = client.credit_notes.list() - assert_matches_type(SyncPage[CreditNoteModel], credit_note, path=["response"]) + assert_matches_type(SyncPage[CreditNote], credit_note, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -89,7 +89,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[CreditNoteModel], credit_note, path=["response"]) + assert_matches_type(SyncPage[CreditNote], credit_note, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -98,7 +98,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(SyncPage[CreditNoteModel], credit_note, path=["response"]) + assert_matches_type(SyncPage[CreditNote], credit_note, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -107,7 +107,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(SyncPage[CreditNoteModel], credit_note, path=["response"]) + assert_matches_type(SyncPage[CreditNote], credit_note, path=["response"]) assert cast(Any, response.is_closed) is True @@ -116,7 +116,7 @@ def test_method_fetch(self, client: Orb) -> None: credit_note = client.credit_notes.fetch( "credit_note_id", ) - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -127,7 +127,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -138,7 +138,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) assert cast(Any, response.is_closed) is True @@ -163,7 +163,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: } ], ) - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -177,7 +177,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No memo="An optional memo for my credit note.", reason="duplicate", ) - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -193,7 +193,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -209,14 +209,14 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = await response.parse() - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: credit_note = await async_client.credit_notes.list() - assert_matches_type(AsyncPage[CreditNoteModel], credit_note, path=["response"]) + assert_matches_type(AsyncPage[CreditNote], credit_note, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -224,7 +224,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[CreditNoteModel], credit_note, path=["response"]) + assert_matches_type(AsyncPage[CreditNote], credit_note, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -233,7 +233,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(AsyncPage[CreditNoteModel], credit_note, path=["response"]) + assert_matches_type(AsyncPage[CreditNote], credit_note, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -242,7 +242,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = await response.parse() - assert_matches_type(AsyncPage[CreditNoteModel], credit_note, path=["response"]) + assert_matches_type(AsyncPage[CreditNote], credit_note, path=["response"]) assert cast(Any, response.is_closed) is True @@ -251,7 +251,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: credit_note = await async_client.credit_notes.fetch( "credit_note_id", ) - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -262,7 +262,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -273,7 +273,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = await response.parse() - assert_matches_type(CreditNoteModel, credit_note, path=["response"]) + assert_matches_type(CreditNote, credit_note, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 3616c1ee..1e87e427 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -8,10 +8,12 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import ( + Customer, +) from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import CustomerModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +27,7 @@ def test_method_create(self, client: Orb) -> None: email="dev@stainless.com", name="x", ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -82,7 +84,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: }, timezone="timezone", ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -94,7 +96,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -106,7 +108,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -115,7 +117,7 @@ def test_method_update(self, client: Orb) -> None: customer = client.customers.update( customer_id="customer_id", ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -172,7 +174,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: "value": "value", }, ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -183,7 +185,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -194,7 +196,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -208,7 +210,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: customer = client.customers.list() - assert_matches_type(SyncPage[CustomerModel], customer, path=["response"]) + assert_matches_type(SyncPage[Customer], customer, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -220,7 +222,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[CustomerModel], customer, path=["response"]) + assert_matches_type(SyncPage[Customer], customer, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -229,7 +231,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(SyncPage[CustomerModel], customer, path=["response"]) + assert_matches_type(SyncPage[Customer], customer, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -238,7 +240,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(SyncPage[CustomerModel], customer, path=["response"]) + assert_matches_type(SyncPage[Customer], customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -285,7 +287,7 @@ def test_method_fetch(self, client: Orb) -> None: customer = client.customers.fetch( "customer_id", ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -296,7 +298,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -307,7 +309,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -323,7 +325,7 @@ def test_method_fetch_by_external_id(self, client: Orb) -> None: customer = client.customers.fetch_by_external_id( "external_customer_id", ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_raw_response_fetch_by_external_id(self, client: Orb) -> None: @@ -334,7 +336,7 @@ def test_raw_response_fetch_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_streaming_response_fetch_by_external_id(self, client: Orb) -> None: @@ -345,7 +347,7 @@ def test_streaming_response_fetch_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -437,7 +439,7 @@ def test_method_update_by_external_id(self, client: Orb) -> None: customer = client.customers.update_by_external_id( id="external_customer_id", ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_method_update_by_external_id_with_all_params(self, client: Orb) -> None: @@ -494,7 +496,7 @@ def test_method_update_by_external_id_with_all_params(self, client: Orb) -> None "value": "value", }, ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_raw_response_update_by_external_id(self, client: Orb) -> None: @@ -505,7 +507,7 @@ def test_raw_response_update_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize def test_streaming_response_update_by_external_id(self, client: Orb) -> None: @@ -516,7 +518,7 @@ def test_streaming_response_update_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -538,7 +540,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: email="dev@stainless.com", name="x", ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -595,7 +597,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No }, timezone="timezone", ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -607,7 +609,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -619,7 +621,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = await response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -628,7 +630,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: customer = await async_client.customers.update( customer_id="customer_id", ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -685,7 +687,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No "value": "value", }, ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -696,7 +698,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -707,7 +709,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = await response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -721,7 +723,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: customer = await async_client.customers.list() - assert_matches_type(AsyncPage[CustomerModel], customer, path=["response"]) + assert_matches_type(AsyncPage[Customer], customer, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -733,7 +735,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[CustomerModel], customer, path=["response"]) + assert_matches_type(AsyncPage[Customer], customer, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -742,7 +744,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(AsyncPage[CustomerModel], customer, path=["response"]) + assert_matches_type(AsyncPage[Customer], customer, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -751,7 +753,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = await response.parse() - assert_matches_type(AsyncPage[CustomerModel], customer, path=["response"]) + assert_matches_type(AsyncPage[Customer], customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -798,7 +800,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: customer = await async_client.customers.fetch( "customer_id", ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -809,7 +811,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -820,7 +822,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = await response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -836,7 +838,7 @@ async def test_method_fetch_by_external_id(self, async_client: AsyncOrb) -> None customer = await async_client.customers.fetch_by_external_id( "external_customer_id", ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_raw_response_fetch_by_external_id(self, async_client: AsyncOrb) -> None: @@ -847,7 +849,7 @@ async def test_raw_response_fetch_by_external_id(self, async_client: AsyncOrb) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_streaming_response_fetch_by_external_id(self, async_client: AsyncOrb) -> None: @@ -858,7 +860,7 @@ async def test_streaming_response_fetch_by_external_id(self, async_client: Async assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = await response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -962,7 +964,7 @@ async def test_method_update_by_external_id(self, async_client: AsyncOrb) -> Non customer = await async_client.customers.update_by_external_id( id="external_customer_id", ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_method_update_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1019,7 +1021,7 @@ async def test_method_update_by_external_id_with_all_params(self, async_client: "value": "value", }, ) - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_raw_response_update_by_external_id(self, async_client: AsyncOrb) -> None: @@ -1030,7 +1032,7 @@ async def test_raw_response_update_by_external_id(self, async_client: AsyncOrb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) @parametrize async def test_streaming_response_update_by_external_id(self, async_client: AsyncOrb) -> None: @@ -1041,7 +1043,7 @@ async def test_streaming_response_update_by_external_id(self, async_client: Asyn assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = await response.parse() - assert_matches_type(CustomerModel, customer, path=["response"]) + assert_matches_type(Customer, customer, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_dimensional_price_groups.py b/tests/api_resources/test_dimensional_price_groups.py index de1e9f2a..d371b7c5 100644 --- a/tests/api_resources/test_dimensional_price_groups.py +++ b/tests/api_resources/test_dimensional_price_groups.py @@ -8,9 +8,9 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import DimensionalPriceGroup from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import DimensionalPriceGroupModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_create(self, client: Orb) -> None: dimensions=["region", "instance_type"], name="name", ) - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -36,7 +36,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: external_dimensional_price_group_id="external_dimensional_price_group_id", metadata={"foo": "string"}, ) - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -62,7 +62,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -71,7 +71,7 @@ def test_method_retrieve(self, client: Orb) -> None: dimensional_price_group = client.dimensional_price_groups.retrieve( "dimensional_price_group_id", ) - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Orb) -> None: @@ -82,7 +82,7 @@ def test_raw_response_retrieve(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Orb) -> None: @@ -93,7 +93,7 @@ def test_streaming_response_retrieve(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -109,7 +109,7 @@ def test_path_params_retrieve(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: dimensional_price_group = client.dimensional_price_groups.list() - assert_matches_type(SyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) + assert_matches_type(SyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -117,7 +117,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) + assert_matches_type(SyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -126,7 +126,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(SyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) + assert_matches_type(SyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -135,7 +135,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(SyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) + assert_matches_type(SyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -150,7 +150,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: dimensions=["region", "instance_type"], name="name", ) - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -161,7 +161,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No external_dimensional_price_group_id="external_dimensional_price_group_id", metadata={"foo": "string"}, ) - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -174,7 +174,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -187,7 +187,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = await response.parse() - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -196,7 +196,7 @@ async def test_method_retrieve(self, async_client: AsyncOrb) -> None: dimensional_price_group = await async_client.dimensional_price_groups.retrieve( "dimensional_price_group_id", ) - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: @@ -207,7 +207,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None: @@ -218,7 +218,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = await response.parse() - assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -234,7 +234,7 @@ async def test_path_params_retrieve(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: dimensional_price_group = await async_client.dimensional_price_groups.list() - assert_matches_type(AsyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) + assert_matches_type(AsyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -242,7 +242,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) + assert_matches_type(AsyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -251,7 +251,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(AsyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) + assert_matches_type(AsyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -260,6 +260,6 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = await response.parse() - assert_matches_type(AsyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) + assert_matches_type(AsyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_invoice_line_items.py b/tests/api_resources/test_invoice_line_items.py index 78f266bc..55411e85 100644 --- a/tests/api_resources/test_invoice_line_items.py +++ b/tests/api_resources/test_invoice_line_items.py @@ -8,9 +8,9 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import InvoiceLineItemCreateResponse from orb._utils import parse_date from tests.utils import assert_matches_type -from orb.types.shared import InvoiceLineItemModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +28,7 @@ def test_method_create(self, client: Orb) -> None: quantity=1, start_date=parse_date("2023-09-22"), ) - assert_matches_type(InvoiceLineItemModel, invoice_line_item, path=["response"]) + assert_matches_type(InvoiceLineItemCreateResponse, invoice_line_item, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -44,7 +44,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice_line_item = response.parse() - assert_matches_type(InvoiceLineItemModel, invoice_line_item, path=["response"]) + assert_matches_type(InvoiceLineItemCreateResponse, invoice_line_item, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -60,7 +60,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice_line_item = response.parse() - assert_matches_type(InvoiceLineItemModel, invoice_line_item, path=["response"]) + assert_matches_type(InvoiceLineItemCreateResponse, invoice_line_item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -78,7 +78,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: quantity=1, start_date=parse_date("2023-09-22"), ) - assert_matches_type(InvoiceLineItemModel, invoice_line_item, path=["response"]) + assert_matches_type(InvoiceLineItemCreateResponse, invoice_line_item, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -94,7 +94,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice_line_item = response.parse() - assert_matches_type(InvoiceLineItemModel, invoice_line_item, path=["response"]) + assert_matches_type(InvoiceLineItemCreateResponse, invoice_line_item, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -110,6 +110,6 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice_line_item = await response.parse() - assert_matches_type(InvoiceLineItemModel, invoice_line_item, path=["response"]) + assert_matches_type(InvoiceLineItemCreateResponse, invoice_line_item, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py index 2d9c3076..4d379d1f 100644 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -9,12 +9,12 @@ from orb import Orb, AsyncOrb from orb.types import ( + Invoice, InvoiceFetchUpcomingResponse, ) from orb._utils import parse_date, parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import InvoiceModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -40,7 +40,7 @@ def test_method_create(self, client: Orb) -> None: ], net_terms=0, ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -71,7 +71,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: metadata={"foo": "string"}, will_auto_issue=False, ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -95,7 +95,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -119,7 +119,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -128,7 +128,7 @@ def test_method_update(self, client: Orb) -> None: invoice = client.invoices.update( invoice_id="invoice_id", ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -136,7 +136,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: invoice_id="invoice_id", metadata={"foo": "string"}, ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -147,7 +147,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -158,7 +158,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -172,7 +172,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: invoice = client.invoices.list() - assert_matches_type(SyncPage[InvoiceModel], invoice, path=["response"]) + assert_matches_type(SyncPage[Invoice], invoice, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -197,7 +197,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: status=["draft"], subscription_id="subscription_id", ) - assert_matches_type(SyncPage[InvoiceModel], invoice, path=["response"]) + assert_matches_type(SyncPage[Invoice], invoice, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -206,7 +206,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(SyncPage[InvoiceModel], invoice, path=["response"]) + assert_matches_type(SyncPage[Invoice], invoice, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -215,7 +215,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(SyncPage[InvoiceModel], invoice, path=["response"]) + assert_matches_type(SyncPage[Invoice], invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -224,7 +224,7 @@ def test_method_fetch(self, client: Orb) -> None: invoice = client.invoices.fetch( "invoice_id", ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -235,7 +235,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -246,7 +246,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -293,7 +293,7 @@ def test_method_issue(self, client: Orb) -> None: invoice = client.invoices.issue( invoice_id="invoice_id", ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_method_issue_with_all_params(self, client: Orb) -> None: @@ -301,7 +301,7 @@ def test_method_issue_with_all_params(self, client: Orb) -> None: invoice_id="invoice_id", synchronous=True, ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_raw_response_issue(self, client: Orb) -> None: @@ -312,7 +312,7 @@ def test_raw_response_issue(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_streaming_response_issue(self, client: Orb) -> None: @@ -323,7 +323,7 @@ def test_streaming_response_issue(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -340,7 +340,7 @@ def test_method_mark_paid(self, client: Orb) -> None: invoice_id="invoice_id", payment_received_date=parse_date("2023-09-22"), ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_method_mark_paid_with_all_params(self, client: Orb) -> None: @@ -350,7 +350,7 @@ def test_method_mark_paid_with_all_params(self, client: Orb) -> None: external_id="external_payment_id_123", notes="notes", ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_raw_response_mark_paid(self, client: Orb) -> None: @@ -362,7 +362,7 @@ def test_raw_response_mark_paid(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_streaming_response_mark_paid(self, client: Orb) -> None: @@ -374,7 +374,7 @@ def test_streaming_response_mark_paid(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -391,7 +391,7 @@ def test_method_pay(self, client: Orb) -> None: invoice = client.invoices.pay( "invoice_id", ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_raw_response_pay(self, client: Orb) -> None: @@ -402,7 +402,7 @@ def test_raw_response_pay(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_streaming_response_pay(self, client: Orb) -> None: @@ -413,7 +413,7 @@ def test_streaming_response_pay(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -429,7 +429,7 @@ def test_method_void(self, client: Orb) -> None: invoice = client.invoices.void( "invoice_id", ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_raw_response_void(self, client: Orb) -> None: @@ -440,7 +440,7 @@ def test_raw_response_void(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_streaming_response_void(self, client: Orb) -> None: @@ -451,7 +451,7 @@ def test_streaming_response_void(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -484,7 +484,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: ], net_terms=0, ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -515,7 +515,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No metadata={"foo": "string"}, will_auto_issue=False, ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -539,7 +539,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -563,7 +563,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -572,7 +572,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.update( invoice_id="invoice_id", ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -580,7 +580,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No invoice_id="invoice_id", metadata={"foo": "string"}, ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -591,7 +591,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -602,7 +602,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -616,7 +616,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.list() - assert_matches_type(AsyncPage[InvoiceModel], invoice, path=["response"]) + assert_matches_type(AsyncPage[Invoice], invoice, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -641,7 +641,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None status=["draft"], subscription_id="subscription_id", ) - assert_matches_type(AsyncPage[InvoiceModel], invoice, path=["response"]) + assert_matches_type(AsyncPage[Invoice], invoice, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -650,7 +650,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(AsyncPage[InvoiceModel], invoice, path=["response"]) + assert_matches_type(AsyncPage[Invoice], invoice, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -659,7 +659,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(AsyncPage[InvoiceModel], invoice, path=["response"]) + assert_matches_type(AsyncPage[Invoice], invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -668,7 +668,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.fetch( "invoice_id", ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -679,7 +679,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -690,7 +690,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -737,7 +737,7 @@ async def test_method_issue(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.issue( invoice_id="invoice_id", ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_method_issue_with_all_params(self, async_client: AsyncOrb) -> None: @@ -745,7 +745,7 @@ async def test_method_issue_with_all_params(self, async_client: AsyncOrb) -> Non invoice_id="invoice_id", synchronous=True, ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_raw_response_issue(self, async_client: AsyncOrb) -> None: @@ -756,7 +756,7 @@ async def test_raw_response_issue(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_streaming_response_issue(self, async_client: AsyncOrb) -> None: @@ -767,7 +767,7 @@ async def test_streaming_response_issue(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -784,7 +784,7 @@ async def test_method_mark_paid(self, async_client: AsyncOrb) -> None: invoice_id="invoice_id", payment_received_date=parse_date("2023-09-22"), ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_method_mark_paid_with_all_params(self, async_client: AsyncOrb) -> None: @@ -794,7 +794,7 @@ async def test_method_mark_paid_with_all_params(self, async_client: AsyncOrb) -> external_id="external_payment_id_123", notes="notes", ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_raw_response_mark_paid(self, async_client: AsyncOrb) -> None: @@ -806,7 +806,7 @@ async def test_raw_response_mark_paid(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_streaming_response_mark_paid(self, async_client: AsyncOrb) -> None: @@ -818,7 +818,7 @@ async def test_streaming_response_mark_paid(self, async_client: AsyncOrb) -> Non assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -835,7 +835,7 @@ async def test_method_pay(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.pay( "invoice_id", ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_raw_response_pay(self, async_client: AsyncOrb) -> None: @@ -846,7 +846,7 @@ async def test_raw_response_pay(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_streaming_response_pay(self, async_client: AsyncOrb) -> None: @@ -857,7 +857,7 @@ async def test_streaming_response_pay(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -873,7 +873,7 @@ async def test_method_void(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.void( "invoice_id", ) - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_raw_response_void(self, async_client: AsyncOrb) -> None: @@ -884,7 +884,7 @@ async def test_raw_response_void(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_streaming_response_void(self, async_client: AsyncOrb) -> None: @@ -895,7 +895,7 @@ async def test_streaming_response_void(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(InvoiceModel, invoice, path=["response"]) + assert_matches_type(Invoice, invoice, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_items.py b/tests/api_resources/test_items.py index 688a0630..c65f50ad 100644 --- a/tests/api_resources/test_items.py +++ b/tests/api_resources/test_items.py @@ -8,9 +8,9 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import Item from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import ItemModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_create(self, client: Orb) -> None: item = client.items.create( name="API requests", ) - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -34,7 +34,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -45,7 +45,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -54,7 +54,7 @@ def test_method_update(self, client: Orb) -> None: item = client.items.update( item_id="item_id", ) - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -68,7 +68,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: ], name="name", ) - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -79,7 +79,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -90,7 +90,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -104,7 +104,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: item = client.items.list() - assert_matches_type(SyncPage[ItemModel], item, path=["response"]) + assert_matches_type(SyncPage[Item], item, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -112,7 +112,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[ItemModel], item, path=["response"]) + assert_matches_type(SyncPage[Item], item, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -121,7 +121,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(SyncPage[ItemModel], item, path=["response"]) + assert_matches_type(SyncPage[Item], item, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -130,7 +130,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(SyncPage[ItemModel], item, path=["response"]) + assert_matches_type(SyncPage[Item], item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -139,7 +139,7 @@ def test_method_fetch(self, client: Orb) -> None: item = client.items.fetch( "item_id", ) - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -150,7 +150,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -161,7 +161,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -181,7 +181,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: item = await async_client.items.create( name="API requests", ) - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -192,7 +192,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -203,7 +203,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = await response.parse() - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -212,7 +212,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: item = await async_client.items.update( item_id="item_id", ) - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -226,7 +226,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No ], name="name", ) - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -237,7 +237,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -248,7 +248,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = await response.parse() - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -262,7 +262,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: item = await async_client.items.list() - assert_matches_type(AsyncPage[ItemModel], item, path=["response"]) + assert_matches_type(AsyncPage[Item], item, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -270,7 +270,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[ItemModel], item, path=["response"]) + assert_matches_type(AsyncPage[Item], item, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -279,7 +279,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(AsyncPage[ItemModel], item, path=["response"]) + assert_matches_type(AsyncPage[Item], item, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -288,7 +288,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = await response.parse() - assert_matches_type(AsyncPage[ItemModel], item, path=["response"]) + assert_matches_type(AsyncPage[Item], item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -297,7 +297,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: item = await async_client.items.fetch( "item_id", ) - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -308,7 +308,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -319,7 +319,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = await response.parse() - assert_matches_type(ItemModel, item, path=["response"]) + assert_matches_type(Item, item, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_metrics.py b/tests/api_resources/test_metrics.py index c723d1e0..f111499e 100644 --- a/tests/api_resources/test_metrics.py +++ b/tests/api_resources/test_metrics.py @@ -8,10 +8,10 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import BillableMetric from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import BillableMetricModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -27,7 +27,7 @@ def test_method_create(self, client: Orb) -> None: name="Bytes downloaded", sql="SELECT sum(bytes_downloaded) FROM events WHERE download_speed = 'fast'", ) - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: sql="SELECT sum(bytes_downloaded) FROM events WHERE download_speed = 'fast'", metadata={"foo": "string"}, ) - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -52,7 +52,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -66,7 +66,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +75,7 @@ def test_method_update(self, client: Orb) -> None: metric = client.metrics.update( metric_id="metric_id", ) - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -83,7 +83,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: metric_id="metric_id", metadata={"foo": "string"}, ) - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -94,7 +94,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -105,7 +105,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -119,7 +119,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: metric = client.metrics.list() - assert_matches_type(SyncPage[BillableMetricModel], metric, path=["response"]) + assert_matches_type(SyncPage[BillableMetric], metric, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -131,7 +131,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[BillableMetricModel], metric, path=["response"]) + assert_matches_type(SyncPage[BillableMetric], metric, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -140,7 +140,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(SyncPage[BillableMetricModel], metric, path=["response"]) + assert_matches_type(SyncPage[BillableMetric], metric, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -149,7 +149,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(SyncPage[BillableMetricModel], metric, path=["response"]) + assert_matches_type(SyncPage[BillableMetric], metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -158,7 +158,7 @@ def test_method_fetch(self, client: Orb) -> None: metric = client.metrics.fetch( "metric_id", ) - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -169,7 +169,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -180,7 +180,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -203,7 +203,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: name="Bytes downloaded", sql="SELECT sum(bytes_downloaded) FROM events WHERE download_speed = 'fast'", ) - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -214,7 +214,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No sql="SELECT sum(bytes_downloaded) FROM events WHERE download_speed = 'fast'", metadata={"foo": "string"}, ) - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -228,7 +228,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -242,7 +242,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = await response.parse() - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -251,7 +251,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: metric = await async_client.metrics.update( metric_id="metric_id", ) - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -259,7 +259,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No metric_id="metric_id", metadata={"foo": "string"}, ) - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -270,7 +270,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -281,7 +281,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = await response.parse() - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -295,7 +295,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: metric = await async_client.metrics.list() - assert_matches_type(AsyncPage[BillableMetricModel], metric, path=["response"]) + assert_matches_type(AsyncPage[BillableMetric], metric, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -307,7 +307,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[BillableMetricModel], metric, path=["response"]) + assert_matches_type(AsyncPage[BillableMetric], metric, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -316,7 +316,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(AsyncPage[BillableMetricModel], metric, path=["response"]) + assert_matches_type(AsyncPage[BillableMetric], metric, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -325,7 +325,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = await response.parse() - assert_matches_type(AsyncPage[BillableMetricModel], metric, path=["response"]) + assert_matches_type(AsyncPage[BillableMetric], metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -334,7 +334,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: metric = await async_client.metrics.fetch( "metric_id", ) - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -345,7 +345,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -356,7 +356,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = await response.parse() - assert_matches_type(BillableMetricModel, metric, path=["response"]) + assert_matches_type(BillableMetric, metric, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_plans.py b/tests/api_resources/test_plans.py index 1adee0ff..938816b8 100644 --- a/tests/api_resources/test_plans.py +++ b/tests/api_resources/test_plans.py @@ -8,10 +8,10 @@ import pytest from orb import Orb, AsyncOrb +from orb.types import Plan from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import PlanModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -34,7 +34,7 @@ def test_method_create(self, client: Orb) -> None: } ], ) - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -72,7 +72,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: net_terms=0, status="active", ) - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -93,7 +93,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -114,7 +114,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -123,7 +123,7 @@ def test_method_update(self, client: Orb) -> None: plan = client.plans.update( plan_id="plan_id", ) - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -132,7 +132,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: external_plan_id="external_plan_id", metadata={"foo": "string"}, ) - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -143,7 +143,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -154,7 +154,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -168,7 +168,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: plan = client.plans.list() - assert_matches_type(SyncPage[PlanModel], plan, path=["response"]) + assert_matches_type(SyncPage[Plan], plan, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -181,7 +181,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: limit=1, status="active", ) - assert_matches_type(SyncPage[PlanModel], plan, path=["response"]) + assert_matches_type(SyncPage[Plan], plan, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -190,7 +190,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(SyncPage[PlanModel], plan, path=["response"]) + assert_matches_type(SyncPage[Plan], plan, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -199,7 +199,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(SyncPage[PlanModel], plan, path=["response"]) + assert_matches_type(SyncPage[Plan], plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -208,7 +208,7 @@ def test_method_fetch(self, client: Orb) -> None: plan = client.plans.fetch( "plan_id", ) - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -219,7 +219,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -230,7 +230,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -260,7 +260,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: } ], ) - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -298,7 +298,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No net_terms=0, status="active", ) - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -319,7 +319,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -340,7 +340,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = await response.parse() - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -349,7 +349,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: plan = await async_client.plans.update( plan_id="plan_id", ) - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -358,7 +358,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No external_plan_id="external_plan_id", metadata={"foo": "string"}, ) - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -369,7 +369,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -380,7 +380,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = await response.parse() - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -394,7 +394,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: plan = await async_client.plans.list() - assert_matches_type(AsyncPage[PlanModel], plan, path=["response"]) + assert_matches_type(AsyncPage[Plan], plan, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -407,7 +407,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None limit=1, status="active", ) - assert_matches_type(AsyncPage[PlanModel], plan, path=["response"]) + assert_matches_type(AsyncPage[Plan], plan, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -416,7 +416,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(AsyncPage[PlanModel], plan, path=["response"]) + assert_matches_type(AsyncPage[Plan], plan, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -425,7 +425,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = await response.parse() - assert_matches_type(AsyncPage[PlanModel], plan, path=["response"]) + assert_matches_type(AsyncPage[Plan], plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -434,7 +434,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: plan = await async_client.plans.fetch( "plan_id", ) - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -445,7 +445,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -456,7 +456,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = await response.parse() - assert_matches_type(PlanModel, plan, path=["response"]) + assert_matches_type(Plan, plan, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index 675422aa..41b706cf 100644 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -9,12 +9,12 @@ from orb import Orb, AsyncOrb from orb.types import ( + Price, PriceEvaluateResponse, ) from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import PriceModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -32,7 +32,7 @@ def test_method_create_overload_1(self, client: Orb) -> None: name="Annual fee", unit_config={"unit_amount": "unit_amount"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_1(self, client: Orb) -> None: @@ -59,7 +59,7 @@ def test_method_create_with_all_params_overload_1(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_1(self, client: Orb) -> None: @@ -75,7 +75,7 @@ def test_raw_response_create_overload_1(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_1(self, client: Orb) -> None: @@ -91,7 +91,7 @@ def test_streaming_response_create_overload_1(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -108,7 +108,7 @@ def test_method_create_overload_2(self, client: Orb) -> None: "package_size": 0, }, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_2(self, client: Orb) -> None: @@ -138,7 +138,7 @@ def test_method_create_with_all_params_overload_2(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_2(self, client: Orb) -> None: @@ -157,7 +157,7 @@ def test_raw_response_create_overload_2(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_2(self, client: Orb) -> None: @@ -176,7 +176,7 @@ def test_streaming_response_create_overload_2(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -199,7 +199,7 @@ def test_method_create_overload_3(self, client: Orb) -> None: model_type="matrix", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_3(self, client: Orb) -> None: @@ -235,7 +235,7 @@ def test_method_create_with_all_params_overload_3(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_3(self, client: Orb) -> None: @@ -260,7 +260,7 @@ def test_raw_response_create_overload_3(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_3(self, client: Orb) -> None: @@ -285,7 +285,7 @@ def test_streaming_response_create_overload_3(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -309,7 +309,7 @@ def test_method_create_overload_4(self, client: Orb) -> None: model_type="matrix_with_allocation", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_4(self, client: Orb) -> None: @@ -346,7 +346,7 @@ def test_method_create_with_all_params_overload_4(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_4(self, client: Orb) -> None: @@ -372,7 +372,7 @@ def test_raw_response_create_overload_4(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_4(self, client: Orb) -> None: @@ -398,7 +398,7 @@ def test_streaming_response_create_overload_4(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -419,7 +419,7 @@ def test_method_create_overload_5(self, client: Orb) -> None: ] }, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_5(self, client: Orb) -> None: @@ -454,7 +454,7 @@ def test_method_create_with_all_params_overload_5(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_5(self, client: Orb) -> None: @@ -477,7 +477,7 @@ def test_raw_response_create_overload_5(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_5(self, client: Orb) -> None: @@ -500,7 +500,7 @@ def test_streaming_response_create_overload_5(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -521,7 +521,7 @@ def test_method_create_overload_6(self, client: Orb) -> None: ] }, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_6(self, client: Orb) -> None: @@ -557,7 +557,7 @@ def test_method_create_with_all_params_overload_6(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_6(self, client: Orb) -> None: @@ -580,7 +580,7 @@ def test_raw_response_create_overload_6(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_6(self, client: Orb) -> None: @@ -603,7 +603,7 @@ def test_streaming_response_create_overload_6(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -617,7 +617,7 @@ def test_method_create_overload_7(self, client: Orb) -> None: model_type="bps", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_7(self, client: Orb) -> None: @@ -647,7 +647,7 @@ def test_method_create_with_all_params_overload_7(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_7(self, client: Orb) -> None: @@ -663,7 +663,7 @@ def test_raw_response_create_overload_7(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_7(self, client: Orb) -> None: @@ -679,7 +679,7 @@ def test_streaming_response_create_overload_7(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -693,7 +693,7 @@ def test_method_create_overload_8(self, client: Orb) -> None: model_type="bulk_bps", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_8(self, client: Orb) -> None: @@ -728,7 +728,7 @@ def test_method_create_with_all_params_overload_8(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_8(self, client: Orb) -> None: @@ -744,7 +744,7 @@ def test_raw_response_create_overload_8(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_8(self, client: Orb) -> None: @@ -760,7 +760,7 @@ def test_streaming_response_create_overload_8(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -774,7 +774,7 @@ def test_method_create_overload_9(self, client: Orb) -> None: model_type="bulk", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_9(self, client: Orb) -> None: @@ -808,7 +808,7 @@ def test_method_create_with_all_params_overload_9(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_9(self, client: Orb) -> None: @@ -824,7 +824,7 @@ def test_raw_response_create_overload_9(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_9(self, client: Orb) -> None: @@ -840,7 +840,7 @@ def test_streaming_response_create_overload_9(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -854,7 +854,7 @@ def test_method_create_overload_10(self, client: Orb) -> None: name="Annual fee", threshold_total_amount_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_10(self, client: Orb) -> None: @@ -881,7 +881,7 @@ def test_method_create_with_all_params_overload_10(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_10(self, client: Orb) -> None: @@ -897,7 +897,7 @@ def test_raw_response_create_overload_10(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_10(self, client: Orb) -> None: @@ -913,7 +913,7 @@ def test_streaming_response_create_overload_10(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -927,7 +927,7 @@ def test_method_create_overload_11(self, client: Orb) -> None: name="Annual fee", tiered_package_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_11(self, client: Orb) -> None: @@ -954,7 +954,7 @@ def test_method_create_with_all_params_overload_11(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_11(self, client: Orb) -> None: @@ -970,7 +970,7 @@ def test_raw_response_create_overload_11(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_11(self, client: Orb) -> None: @@ -986,7 +986,7 @@ def test_streaming_response_create_overload_11(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1000,7 +1000,7 @@ def test_method_create_overload_12(self, client: Orb) -> None: model_type="grouped_tiered", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_12(self, client: Orb) -> None: @@ -1027,7 +1027,7 @@ def test_method_create_with_all_params_overload_12(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_12(self, client: Orb) -> None: @@ -1043,7 +1043,7 @@ def test_raw_response_create_overload_12(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_12(self, client: Orb) -> None: @@ -1059,7 +1059,7 @@ def test_streaming_response_create_overload_12(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1073,7 +1073,7 @@ def test_method_create_overload_13(self, client: Orb) -> None: model_type="max_group_tiered_package", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_13(self, client: Orb) -> None: @@ -1100,7 +1100,7 @@ def test_method_create_with_all_params_overload_13(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_13(self, client: Orb) -> None: @@ -1116,7 +1116,7 @@ def test_raw_response_create_overload_13(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_13(self, client: Orb) -> None: @@ -1132,7 +1132,7 @@ def test_streaming_response_create_overload_13(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1146,7 +1146,7 @@ def test_method_create_overload_14(self, client: Orb) -> None: name="Annual fee", tiered_with_minimum_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_14(self, client: Orb) -> None: @@ -1173,7 +1173,7 @@ def test_method_create_with_all_params_overload_14(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_14(self, client: Orb) -> None: @@ -1189,7 +1189,7 @@ def test_raw_response_create_overload_14(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_14(self, client: Orb) -> None: @@ -1205,7 +1205,7 @@ def test_streaming_response_create_overload_14(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1219,7 +1219,7 @@ def test_method_create_overload_15(self, client: Orb) -> None: name="Annual fee", package_with_allocation_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_15(self, client: Orb) -> None: @@ -1246,7 +1246,7 @@ def test_method_create_with_all_params_overload_15(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_15(self, client: Orb) -> None: @@ -1262,7 +1262,7 @@ def test_raw_response_create_overload_15(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_15(self, client: Orb) -> None: @@ -1278,7 +1278,7 @@ def test_streaming_response_create_overload_15(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1292,7 +1292,7 @@ def test_method_create_overload_16(self, client: Orb) -> None: name="Annual fee", tiered_package_with_minimum_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_16(self, client: Orb) -> None: @@ -1319,7 +1319,7 @@ def test_method_create_with_all_params_overload_16(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_16(self, client: Orb) -> None: @@ -1335,7 +1335,7 @@ def test_raw_response_create_overload_16(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_16(self, client: Orb) -> None: @@ -1351,7 +1351,7 @@ def test_streaming_response_create_overload_16(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1365,7 +1365,7 @@ def test_method_create_overload_17(self, client: Orb) -> None: name="Annual fee", unit_with_percent_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_17(self, client: Orb) -> None: @@ -1392,7 +1392,7 @@ def test_method_create_with_all_params_overload_17(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_17(self, client: Orb) -> None: @@ -1408,7 +1408,7 @@ def test_raw_response_create_overload_17(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_17(self, client: Orb) -> None: @@ -1424,7 +1424,7 @@ def test_streaming_response_create_overload_17(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1438,7 +1438,7 @@ def test_method_create_overload_18(self, client: Orb) -> None: name="Annual fee", tiered_with_proration_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_18(self, client: Orb) -> None: @@ -1465,7 +1465,7 @@ def test_method_create_with_all_params_overload_18(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_18(self, client: Orb) -> None: @@ -1481,7 +1481,7 @@ def test_raw_response_create_overload_18(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_18(self, client: Orb) -> None: @@ -1497,7 +1497,7 @@ def test_streaming_response_create_overload_18(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1511,7 +1511,7 @@ def test_method_create_overload_19(self, client: Orb) -> None: name="Annual fee", unit_with_proration_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_19(self, client: Orb) -> None: @@ -1538,7 +1538,7 @@ def test_method_create_with_all_params_overload_19(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_19(self, client: Orb) -> None: @@ -1554,7 +1554,7 @@ def test_raw_response_create_overload_19(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_19(self, client: Orb) -> None: @@ -1570,7 +1570,7 @@ def test_streaming_response_create_overload_19(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1584,7 +1584,7 @@ def test_method_create_overload_20(self, client: Orb) -> None: model_type="grouped_allocation", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: @@ -1611,7 +1611,7 @@ def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_20(self, client: Orb) -> None: @@ -1627,7 +1627,7 @@ def test_raw_response_create_overload_20(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_20(self, client: Orb) -> None: @@ -1643,7 +1643,7 @@ def test_streaming_response_create_overload_20(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1657,7 +1657,7 @@ def test_method_create_overload_21(self, client: Orb) -> None: model_type="grouped_with_prorated_minimum", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_21(self, client: Orb) -> None: @@ -1684,7 +1684,7 @@ def test_method_create_with_all_params_overload_21(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_21(self, client: Orb) -> None: @@ -1700,7 +1700,7 @@ def test_raw_response_create_overload_21(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_21(self, client: Orb) -> None: @@ -1716,7 +1716,7 @@ def test_streaming_response_create_overload_21(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1730,7 +1730,7 @@ def test_method_create_overload_22(self, client: Orb) -> None: model_type="grouped_with_metered_minimum", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_22(self, client: Orb) -> None: @@ -1757,7 +1757,7 @@ def test_method_create_with_all_params_overload_22(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_22(self, client: Orb) -> None: @@ -1773,7 +1773,7 @@ def test_raw_response_create_overload_22(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_22(self, client: Orb) -> None: @@ -1789,7 +1789,7 @@ def test_streaming_response_create_overload_22(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1803,7 +1803,7 @@ def test_method_create_overload_23(self, client: Orb) -> None: model_type="matrix_with_display_name", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_23(self, client: Orb) -> None: @@ -1830,7 +1830,7 @@ def test_method_create_with_all_params_overload_23(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_23(self, client: Orb) -> None: @@ -1846,7 +1846,7 @@ def test_raw_response_create_overload_23(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_23(self, client: Orb) -> None: @@ -1862,7 +1862,7 @@ def test_streaming_response_create_overload_23(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1876,7 +1876,7 @@ def test_method_create_overload_24(self, client: Orb) -> None: model_type="bulk_with_proration", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_24(self, client: Orb) -> None: @@ -1903,7 +1903,7 @@ def test_method_create_with_all_params_overload_24(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_24(self, client: Orb) -> None: @@ -1919,7 +1919,7 @@ def test_raw_response_create_overload_24(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_24(self, client: Orb) -> None: @@ -1935,7 +1935,7 @@ def test_streaming_response_create_overload_24(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1949,7 +1949,7 @@ def test_method_create_overload_25(self, client: Orb) -> None: model_type="grouped_tiered_package", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_25(self, client: Orb) -> None: @@ -1976,7 +1976,7 @@ def test_method_create_with_all_params_overload_25(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_25(self, client: Orb) -> None: @@ -1992,7 +1992,7 @@ def test_raw_response_create_overload_25(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_25(self, client: Orb) -> None: @@ -2008,7 +2008,7 @@ def test_streaming_response_create_overload_25(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2022,7 +2022,7 @@ def test_method_create_overload_26(self, client: Orb) -> None: name="Annual fee", scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_26(self, client: Orb) -> None: @@ -2049,7 +2049,7 @@ def test_method_create_with_all_params_overload_26(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_26(self, client: Orb) -> None: @@ -2065,7 +2065,7 @@ def test_raw_response_create_overload_26(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_26(self, client: Orb) -> None: @@ -2081,7 +2081,7 @@ def test_streaming_response_create_overload_26(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2095,7 +2095,7 @@ def test_method_create_overload_27(self, client: Orb) -> None: name="Annual fee", scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_27(self, client: Orb) -> None: @@ -2122,7 +2122,7 @@ def test_method_create_with_all_params_overload_27(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_27(self, client: Orb) -> None: @@ -2138,7 +2138,7 @@ def test_raw_response_create_overload_27(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_27(self, client: Orb) -> None: @@ -2154,7 +2154,7 @@ def test_streaming_response_create_overload_27(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2168,7 +2168,7 @@ def test_method_create_overload_28(self, client: Orb) -> None: model_type="cumulative_grouped_bulk", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_28(self, client: Orb) -> None: @@ -2195,7 +2195,7 @@ def test_method_create_with_all_params_overload_28(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_create_overload_28(self, client: Orb) -> None: @@ -2211,7 +2211,7 @@ def test_raw_response_create_overload_28(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_create_overload_28(self, client: Orb) -> None: @@ -2227,7 +2227,7 @@ def test_streaming_response_create_overload_28(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2236,7 +2236,7 @@ def test_method_update(self, client: Orb) -> None: price = client.prices.update( price_id="price_id", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -2244,7 +2244,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: price_id="price_id", metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -2255,7 +2255,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -2266,7 +2266,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2280,7 +2280,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: price = client.prices.list() - assert_matches_type(SyncPage[PriceModel], price, path=["response"]) + assert_matches_type(SyncPage[Price], price, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -2288,7 +2288,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[PriceModel], price, path=["response"]) + assert_matches_type(SyncPage[Price], price, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -2297,7 +2297,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(SyncPage[PriceModel], price, path=["response"]) + assert_matches_type(SyncPage[Price], price, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -2306,7 +2306,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(SyncPage[PriceModel], price, path=["response"]) + assert_matches_type(SyncPage[Price], price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2374,7 +2374,7 @@ def test_method_fetch(self, client: Orb) -> None: price = client.prices.fetch( "price_id", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -2385,7 +2385,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -2396,7 +2396,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2421,7 +2421,7 @@ async def test_method_create_overload_1(self, async_client: AsyncOrb) -> None: name="Annual fee", unit_config={"unit_amount": "unit_amount"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncOrb) -> None: @@ -2448,7 +2448,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncOrb) -> None: @@ -2464,7 +2464,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncOrb) -> None: @@ -2480,7 +2480,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2497,7 +2497,7 @@ async def test_method_create_overload_2(self, async_client: AsyncOrb) -> None: "package_size": 0, }, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncOrb) -> None: @@ -2527,7 +2527,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncOrb) -> None: @@ -2546,7 +2546,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncOrb) -> None: @@ -2565,7 +2565,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2588,7 +2588,7 @@ async def test_method_create_overload_3(self, async_client: AsyncOrb) -> None: model_type="matrix", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_3(self, async_client: AsyncOrb) -> None: @@ -2624,7 +2624,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_3(self, async_client: AsyncOrb) -> None: @@ -2649,7 +2649,7 @@ async def test_raw_response_create_overload_3(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_3(self, async_client: AsyncOrb) -> None: @@ -2674,7 +2674,7 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2698,7 +2698,7 @@ async def test_method_create_overload_4(self, async_client: AsyncOrb) -> None: model_type="matrix_with_allocation", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_4(self, async_client: AsyncOrb) -> None: @@ -2735,7 +2735,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_4(self, async_client: AsyncOrb) -> None: @@ -2761,7 +2761,7 @@ async def test_raw_response_create_overload_4(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_4(self, async_client: AsyncOrb) -> None: @@ -2787,7 +2787,7 @@ async def test_streaming_response_create_overload_4(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2808,7 +2808,7 @@ async def test_method_create_overload_5(self, async_client: AsyncOrb) -> None: ] }, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_5(self, async_client: AsyncOrb) -> None: @@ -2843,7 +2843,7 @@ async def test_method_create_with_all_params_overload_5(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_5(self, async_client: AsyncOrb) -> None: @@ -2866,7 +2866,7 @@ async def test_raw_response_create_overload_5(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_5(self, async_client: AsyncOrb) -> None: @@ -2889,7 +2889,7 @@ async def test_streaming_response_create_overload_5(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2910,7 +2910,7 @@ async def test_method_create_overload_6(self, async_client: AsyncOrb) -> None: ] }, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_6(self, async_client: AsyncOrb) -> None: @@ -2946,7 +2946,7 @@ async def test_method_create_with_all_params_overload_6(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_6(self, async_client: AsyncOrb) -> None: @@ -2969,7 +2969,7 @@ async def test_raw_response_create_overload_6(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_6(self, async_client: AsyncOrb) -> None: @@ -2992,7 +2992,7 @@ async def test_streaming_response_create_overload_6(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3006,7 +3006,7 @@ async def test_method_create_overload_7(self, async_client: AsyncOrb) -> None: model_type="bps", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_7(self, async_client: AsyncOrb) -> None: @@ -3036,7 +3036,7 @@ async def test_method_create_with_all_params_overload_7(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_7(self, async_client: AsyncOrb) -> None: @@ -3052,7 +3052,7 @@ async def test_raw_response_create_overload_7(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_7(self, async_client: AsyncOrb) -> None: @@ -3068,7 +3068,7 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3082,7 +3082,7 @@ async def test_method_create_overload_8(self, async_client: AsyncOrb) -> None: model_type="bulk_bps", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_8(self, async_client: AsyncOrb) -> None: @@ -3117,7 +3117,7 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_8(self, async_client: AsyncOrb) -> None: @@ -3133,7 +3133,7 @@ async def test_raw_response_create_overload_8(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_8(self, async_client: AsyncOrb) -> None: @@ -3149,7 +3149,7 @@ async def test_streaming_response_create_overload_8(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3163,7 +3163,7 @@ async def test_method_create_overload_9(self, async_client: AsyncOrb) -> None: model_type="bulk", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_9(self, async_client: AsyncOrb) -> None: @@ -3197,7 +3197,7 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_9(self, async_client: AsyncOrb) -> None: @@ -3213,7 +3213,7 @@ async def test_raw_response_create_overload_9(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_9(self, async_client: AsyncOrb) -> None: @@ -3229,7 +3229,7 @@ async def test_streaming_response_create_overload_9(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3243,7 +3243,7 @@ async def test_method_create_overload_10(self, async_client: AsyncOrb) -> None: name="Annual fee", threshold_total_amount_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_10(self, async_client: AsyncOrb) -> None: @@ -3270,7 +3270,7 @@ async def test_method_create_with_all_params_overload_10(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_10(self, async_client: AsyncOrb) -> None: @@ -3286,7 +3286,7 @@ async def test_raw_response_create_overload_10(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_10(self, async_client: AsyncOrb) -> None: @@ -3302,7 +3302,7 @@ async def test_streaming_response_create_overload_10(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3316,7 +3316,7 @@ async def test_method_create_overload_11(self, async_client: AsyncOrb) -> None: name="Annual fee", tiered_package_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_11(self, async_client: AsyncOrb) -> None: @@ -3343,7 +3343,7 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_11(self, async_client: AsyncOrb) -> None: @@ -3359,7 +3359,7 @@ async def test_raw_response_create_overload_11(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_11(self, async_client: AsyncOrb) -> None: @@ -3375,7 +3375,7 @@ async def test_streaming_response_create_overload_11(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3389,7 +3389,7 @@ async def test_method_create_overload_12(self, async_client: AsyncOrb) -> None: model_type="grouped_tiered", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_12(self, async_client: AsyncOrb) -> None: @@ -3416,7 +3416,7 @@ async def test_method_create_with_all_params_overload_12(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_12(self, async_client: AsyncOrb) -> None: @@ -3432,7 +3432,7 @@ async def test_raw_response_create_overload_12(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_12(self, async_client: AsyncOrb) -> None: @@ -3448,7 +3448,7 @@ async def test_streaming_response_create_overload_12(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3462,7 +3462,7 @@ async def test_method_create_overload_13(self, async_client: AsyncOrb) -> None: model_type="max_group_tiered_package", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_13(self, async_client: AsyncOrb) -> None: @@ -3489,7 +3489,7 @@ async def test_method_create_with_all_params_overload_13(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_13(self, async_client: AsyncOrb) -> None: @@ -3505,7 +3505,7 @@ async def test_raw_response_create_overload_13(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_13(self, async_client: AsyncOrb) -> None: @@ -3521,7 +3521,7 @@ async def test_streaming_response_create_overload_13(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3535,7 +3535,7 @@ async def test_method_create_overload_14(self, async_client: AsyncOrb) -> None: name="Annual fee", tiered_with_minimum_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_14(self, async_client: AsyncOrb) -> None: @@ -3562,7 +3562,7 @@ async def test_method_create_with_all_params_overload_14(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_14(self, async_client: AsyncOrb) -> None: @@ -3578,7 +3578,7 @@ async def test_raw_response_create_overload_14(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_14(self, async_client: AsyncOrb) -> None: @@ -3594,7 +3594,7 @@ async def test_streaming_response_create_overload_14(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3608,7 +3608,7 @@ async def test_method_create_overload_15(self, async_client: AsyncOrb) -> None: name="Annual fee", package_with_allocation_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_15(self, async_client: AsyncOrb) -> None: @@ -3635,7 +3635,7 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_15(self, async_client: AsyncOrb) -> None: @@ -3651,7 +3651,7 @@ async def test_raw_response_create_overload_15(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_15(self, async_client: AsyncOrb) -> None: @@ -3667,7 +3667,7 @@ async def test_streaming_response_create_overload_15(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3681,7 +3681,7 @@ async def test_method_create_overload_16(self, async_client: AsyncOrb) -> None: name="Annual fee", tiered_package_with_minimum_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_16(self, async_client: AsyncOrb) -> None: @@ -3708,7 +3708,7 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_16(self, async_client: AsyncOrb) -> None: @@ -3724,7 +3724,7 @@ async def test_raw_response_create_overload_16(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_16(self, async_client: AsyncOrb) -> None: @@ -3740,7 +3740,7 @@ async def test_streaming_response_create_overload_16(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3754,7 +3754,7 @@ async def test_method_create_overload_17(self, async_client: AsyncOrb) -> None: name="Annual fee", unit_with_percent_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_17(self, async_client: AsyncOrb) -> None: @@ -3781,7 +3781,7 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_17(self, async_client: AsyncOrb) -> None: @@ -3797,7 +3797,7 @@ async def test_raw_response_create_overload_17(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_17(self, async_client: AsyncOrb) -> None: @@ -3813,7 +3813,7 @@ async def test_streaming_response_create_overload_17(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3827,7 +3827,7 @@ async def test_method_create_overload_18(self, async_client: AsyncOrb) -> None: name="Annual fee", tiered_with_proration_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_18(self, async_client: AsyncOrb) -> None: @@ -3854,7 +3854,7 @@ async def test_method_create_with_all_params_overload_18(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_18(self, async_client: AsyncOrb) -> None: @@ -3870,7 +3870,7 @@ async def test_raw_response_create_overload_18(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_18(self, async_client: AsyncOrb) -> None: @@ -3886,7 +3886,7 @@ async def test_streaming_response_create_overload_18(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3900,7 +3900,7 @@ async def test_method_create_overload_19(self, async_client: AsyncOrb) -> None: name="Annual fee", unit_with_proration_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_19(self, async_client: AsyncOrb) -> None: @@ -3927,7 +3927,7 @@ async def test_method_create_with_all_params_overload_19(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_19(self, async_client: AsyncOrb) -> None: @@ -3943,7 +3943,7 @@ async def test_raw_response_create_overload_19(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_19(self, async_client: AsyncOrb) -> None: @@ -3959,7 +3959,7 @@ async def test_streaming_response_create_overload_19(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3973,7 +3973,7 @@ async def test_method_create_overload_20(self, async_client: AsyncOrb) -> None: model_type="grouped_allocation", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_20(self, async_client: AsyncOrb) -> None: @@ -4000,7 +4000,7 @@ async def test_method_create_with_all_params_overload_20(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_20(self, async_client: AsyncOrb) -> None: @@ -4016,7 +4016,7 @@ async def test_raw_response_create_overload_20(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_20(self, async_client: AsyncOrb) -> None: @@ -4032,7 +4032,7 @@ async def test_streaming_response_create_overload_20(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4046,7 +4046,7 @@ async def test_method_create_overload_21(self, async_client: AsyncOrb) -> None: model_type="grouped_with_prorated_minimum", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_21(self, async_client: AsyncOrb) -> None: @@ -4073,7 +4073,7 @@ async def test_method_create_with_all_params_overload_21(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_21(self, async_client: AsyncOrb) -> None: @@ -4089,7 +4089,7 @@ async def test_raw_response_create_overload_21(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_21(self, async_client: AsyncOrb) -> None: @@ -4105,7 +4105,7 @@ async def test_streaming_response_create_overload_21(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4119,7 +4119,7 @@ async def test_method_create_overload_22(self, async_client: AsyncOrb) -> None: model_type="grouped_with_metered_minimum", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_22(self, async_client: AsyncOrb) -> None: @@ -4146,7 +4146,7 @@ async def test_method_create_with_all_params_overload_22(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_22(self, async_client: AsyncOrb) -> None: @@ -4162,7 +4162,7 @@ async def test_raw_response_create_overload_22(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_22(self, async_client: AsyncOrb) -> None: @@ -4178,7 +4178,7 @@ async def test_streaming_response_create_overload_22(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4192,7 +4192,7 @@ async def test_method_create_overload_23(self, async_client: AsyncOrb) -> None: model_type="matrix_with_display_name", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_23(self, async_client: AsyncOrb) -> None: @@ -4219,7 +4219,7 @@ async def test_method_create_with_all_params_overload_23(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_23(self, async_client: AsyncOrb) -> None: @@ -4235,7 +4235,7 @@ async def test_raw_response_create_overload_23(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_23(self, async_client: AsyncOrb) -> None: @@ -4251,7 +4251,7 @@ async def test_streaming_response_create_overload_23(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4265,7 +4265,7 @@ async def test_method_create_overload_24(self, async_client: AsyncOrb) -> None: model_type="bulk_with_proration", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_24(self, async_client: AsyncOrb) -> None: @@ -4292,7 +4292,7 @@ async def test_method_create_with_all_params_overload_24(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_24(self, async_client: AsyncOrb) -> None: @@ -4308,7 +4308,7 @@ async def test_raw_response_create_overload_24(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_24(self, async_client: AsyncOrb) -> None: @@ -4324,7 +4324,7 @@ async def test_streaming_response_create_overload_24(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4338,7 +4338,7 @@ async def test_method_create_overload_25(self, async_client: AsyncOrb) -> None: model_type="grouped_tiered_package", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_25(self, async_client: AsyncOrb) -> None: @@ -4365,7 +4365,7 @@ async def test_method_create_with_all_params_overload_25(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_25(self, async_client: AsyncOrb) -> None: @@ -4381,7 +4381,7 @@ async def test_raw_response_create_overload_25(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_25(self, async_client: AsyncOrb) -> None: @@ -4397,7 +4397,7 @@ async def test_streaming_response_create_overload_25(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4411,7 +4411,7 @@ async def test_method_create_overload_26(self, async_client: AsyncOrb) -> None: name="Annual fee", scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_26(self, async_client: AsyncOrb) -> None: @@ -4438,7 +4438,7 @@ async def test_method_create_with_all_params_overload_26(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_26(self, async_client: AsyncOrb) -> None: @@ -4454,7 +4454,7 @@ async def test_raw_response_create_overload_26(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_26(self, async_client: AsyncOrb) -> None: @@ -4470,7 +4470,7 @@ async def test_streaming_response_create_overload_26(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4484,7 +4484,7 @@ async def test_method_create_overload_27(self, async_client: AsyncOrb) -> None: name="Annual fee", scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_27(self, async_client: AsyncOrb) -> None: @@ -4511,7 +4511,7 @@ async def test_method_create_with_all_params_overload_27(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_27(self, async_client: AsyncOrb) -> None: @@ -4527,7 +4527,7 @@ async def test_raw_response_create_overload_27(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_27(self, async_client: AsyncOrb) -> None: @@ -4543,7 +4543,7 @@ async def test_streaming_response_create_overload_27(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4557,7 +4557,7 @@ async def test_method_create_overload_28(self, async_client: AsyncOrb) -> None: model_type="cumulative_grouped_bulk", name="Annual fee", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_28(self, async_client: AsyncOrb) -> None: @@ -4584,7 +4584,7 @@ async def test_method_create_with_all_params_overload_28(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_create_overload_28(self, async_client: AsyncOrb) -> None: @@ -4600,7 +4600,7 @@ async def test_raw_response_create_overload_28(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_28(self, async_client: AsyncOrb) -> None: @@ -4616,7 +4616,7 @@ async def test_streaming_response_create_overload_28(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4625,7 +4625,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: price = await async_client.prices.update( price_id="price_id", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -4633,7 +4633,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No price_id="price_id", metadata={"foo": "string"}, ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -4644,7 +4644,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -4655,7 +4655,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4669,7 +4669,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: price = await async_client.prices.list() - assert_matches_type(AsyncPage[PriceModel], price, path=["response"]) + assert_matches_type(AsyncPage[Price], price, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -4677,7 +4677,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[PriceModel], price, path=["response"]) + assert_matches_type(AsyncPage[Price], price, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -4686,7 +4686,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(AsyncPage[PriceModel], price, path=["response"]) + assert_matches_type(AsyncPage[Price], price, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -4695,7 +4695,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(AsyncPage[PriceModel], price, path=["response"]) + assert_matches_type(AsyncPage[Price], price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4763,7 +4763,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: price = await async_client.prices.fetch( "price_id", ) - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -4774,7 +4774,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -4785,7 +4785,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(PriceModel, price, path=["response"]) + assert_matches_type(Price, price, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index 26b2292b..89ac2bab 100644 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -9,14 +9,24 @@ from orb import Orb, AsyncOrb from orb.types import ( + Subscription, SubscriptionUsage, + SubscriptionCancelResponse, + SubscriptionCreateResponse, SubscriptionFetchCostsResponse, + SubscriptionUpdateTrialResponse, + SubscriptionTriggerPhaseResponse, SubscriptionFetchScheduleResponse, + SubscriptionPriceIntervalsResponse, + SubscriptionSchedulePlanChangeResponse, + SubscriptionUnscheduleCancellationResponse, + SubscriptionUpdateFixedFeeQuantityResponse, + SubscriptionUnschedulePendingPlanChangesResponse, + SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, ) from orb._utils import parse_date, parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.shared import SubscriptionModel, MutatedSubscriptionModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -27,7 +37,7 @@ class TestSubscriptions: @parametrize def test_method_create(self, client: Orb) -> None: subscription = client.subscriptions.create() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -190,7 +200,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: trial_duration_days=999999, usage_customer_ids=["string"], ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -199,7 +209,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -208,7 +218,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -217,7 +227,7 @@ def test_method_update(self, client: Orb) -> None: subscription = client.subscriptions.update( subscription_id="subscription_id", ) - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -229,7 +239,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: metadata={"foo": "string"}, net_terms=0, ) - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -240,7 +250,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -251,7 +261,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -265,7 +275,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: subscription = client.subscriptions.list() - assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -280,7 +290,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: limit=1, status="active", ) - assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -289,7 +299,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -298,7 +308,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -308,7 +318,7 @@ def test_method_cancel(self, client: Orb) -> None: subscription_id="subscription_id", cancel_option="end_of_subscription_term", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) @parametrize def test_method_cancel_with_all_params(self, client: Orb) -> None: @@ -318,7 +328,7 @@ def test_method_cancel_with_all_params(self, client: Orb) -> None: allow_invoice_credit_or_void=True, cancellation_date=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) @parametrize def test_raw_response_cancel(self, client: Orb) -> None: @@ -330,7 +340,7 @@ def test_raw_response_cancel(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) @parametrize def test_streaming_response_cancel(self, client: Orb) -> None: @@ -342,7 +352,7 @@ def test_streaming_response_cancel(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -359,7 +369,7 @@ def test_method_fetch(self, client: Orb) -> None: subscription = client.subscriptions.fetch( "subscription_id", ) - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -370,7 +380,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -381,7 +391,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -558,7 +568,7 @@ def test_method_price_intervals(self, client: Orb) -> None: subscription = client.subscriptions.price_intervals( subscription_id="subscription_id", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -655,7 +665,7 @@ def test_method_price_intervals_with_all_params(self, client: Orb) -> None: } ], ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -667,7 +677,7 @@ def test_raw_response_price_intervals(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -679,7 +689,7 @@ def test_streaming_response_price_intervals(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -697,7 +707,7 @@ def test_method_schedule_plan_change(self, client: Orb) -> None: subscription_id="subscription_id", change_option="requested_date", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) @parametrize def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: @@ -856,7 +866,7 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: trial_duration_days=999999, usage_customer_ids=["string"], ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) @parametrize def test_raw_response_schedule_plan_change(self, client: Orb) -> None: @@ -868,7 +878,7 @@ def test_raw_response_schedule_plan_change(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) @parametrize def test_streaming_response_schedule_plan_change(self, client: Orb) -> None: @@ -880,7 +890,7 @@ def test_streaming_response_schedule_plan_change(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -897,7 +907,7 @@ def test_method_trigger_phase(self, client: Orb) -> None: subscription = client.subscriptions.trigger_phase( subscription_id="subscription_id", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) @parametrize def test_method_trigger_phase_with_all_params(self, client: Orb) -> None: @@ -906,7 +916,7 @@ def test_method_trigger_phase_with_all_params(self, client: Orb) -> None: allow_invoice_credit_or_void=True, effective_date=parse_date("2019-12-27"), ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) @parametrize def test_raw_response_trigger_phase(self, client: Orb) -> None: @@ -917,7 +927,7 @@ def test_raw_response_trigger_phase(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) @parametrize def test_streaming_response_trigger_phase(self, client: Orb) -> None: @@ -928,7 +938,7 @@ def test_streaming_response_trigger_phase(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -944,7 +954,7 @@ def test_method_unschedule_cancellation(self, client: Orb) -> None: subscription = client.subscriptions.unschedule_cancellation( "subscription_id", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnscheduleCancellationResponse, subscription, path=["response"]) @parametrize def test_raw_response_unschedule_cancellation(self, client: Orb) -> None: @@ -955,7 +965,7 @@ def test_raw_response_unschedule_cancellation(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnscheduleCancellationResponse, subscription, path=["response"]) @parametrize def test_streaming_response_unschedule_cancellation(self, client: Orb) -> None: @@ -966,7 +976,7 @@ def test_streaming_response_unschedule_cancellation(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnscheduleCancellationResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -983,7 +993,7 @@ def test_method_unschedule_fixed_fee_quantity_updates(self, client: Orb) -> None subscription_id="subscription_id", price_id="price_id", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, subscription, path=["response"]) @parametrize def test_raw_response_unschedule_fixed_fee_quantity_updates(self, client: Orb) -> None: @@ -995,7 +1005,7 @@ def test_raw_response_unschedule_fixed_fee_quantity_updates(self, client: Orb) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, subscription, path=["response"]) @parametrize def test_streaming_response_unschedule_fixed_fee_quantity_updates(self, client: Orb) -> None: @@ -1007,7 +1017,7 @@ def test_streaming_response_unschedule_fixed_fee_quantity_updates(self, client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1024,7 +1034,7 @@ def test_method_unschedule_pending_plan_changes(self, client: Orb) -> None: subscription = client.subscriptions.unschedule_pending_plan_changes( "subscription_id", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnschedulePendingPlanChangesResponse, subscription, path=["response"]) @parametrize def test_raw_response_unschedule_pending_plan_changes(self, client: Orb) -> None: @@ -1035,7 +1045,7 @@ def test_raw_response_unschedule_pending_plan_changes(self, client: Orb) -> None assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnschedulePendingPlanChangesResponse, subscription, path=["response"]) @parametrize def test_streaming_response_unschedule_pending_plan_changes(self, client: Orb) -> None: @@ -1046,7 +1056,7 @@ def test_streaming_response_unschedule_pending_plan_changes(self, client: Orb) - assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnschedulePendingPlanChangesResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1064,7 +1074,7 @@ def test_method_update_fixed_fee_quantity(self, client: Orb) -> None: price_id="price_id", quantity=0, ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) @parametrize def test_method_update_fixed_fee_quantity_with_all_params(self, client: Orb) -> None: @@ -1076,7 +1086,7 @@ def test_method_update_fixed_fee_quantity_with_all_params(self, client: Orb) -> change_option="immediate", effective_date=parse_date("2022-12-21"), ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) @parametrize def test_raw_response_update_fixed_fee_quantity(self, client: Orb) -> None: @@ -1089,7 +1099,7 @@ def test_raw_response_update_fixed_fee_quantity(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) @parametrize def test_streaming_response_update_fixed_fee_quantity(self, client: Orb) -> None: @@ -1102,7 +1112,7 @@ def test_streaming_response_update_fixed_fee_quantity(self, client: Orb) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1121,7 +1131,7 @@ def test_method_update_trial(self, client: Orb) -> None: subscription_id="subscription_id", trial_end_date=parse_datetime("2017-07-21T17:32:28Z"), ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) @parametrize def test_method_update_trial_with_all_params(self, client: Orb) -> None: @@ -1130,7 +1140,7 @@ def test_method_update_trial_with_all_params(self, client: Orb) -> None: trial_end_date=parse_datetime("2017-07-21T17:32:28Z"), shift=True, ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) @parametrize def test_raw_response_update_trial(self, client: Orb) -> None: @@ -1142,7 +1152,7 @@ def test_raw_response_update_trial(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) @parametrize def test_streaming_response_update_trial(self, client: Orb) -> None: @@ -1154,7 +1164,7 @@ def test_streaming_response_update_trial(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1173,7 +1183,7 @@ class TestAsyncSubscriptions: @parametrize async def test_method_create(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.create() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1336,7 +1346,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No trial_duration_days=999999, usage_customer_ids=["string"], ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -1345,7 +1355,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -1354,7 +1364,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1363,7 +1373,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.update( subscription_id="subscription_id", ) - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1375,7 +1385,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No metadata={"foo": "string"}, net_terms=0, ) - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -1386,7 +1396,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -1397,7 +1407,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1411,7 +1421,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.list() - assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1426,7 +1436,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None limit=1, status="active", ) - assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -1435,7 +1445,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -1444,7 +1454,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) + assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1454,7 +1464,7 @@ async def test_method_cancel(self, async_client: AsyncOrb) -> None: subscription_id="subscription_id", cancel_option="end_of_subscription_term", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) @parametrize async def test_method_cancel_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1464,7 +1474,7 @@ async def test_method_cancel_with_all_params(self, async_client: AsyncOrb) -> No allow_invoice_credit_or_void=True, cancellation_date=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) @parametrize async def test_raw_response_cancel(self, async_client: AsyncOrb) -> None: @@ -1476,7 +1486,7 @@ async def test_raw_response_cancel(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) @parametrize async def test_streaming_response_cancel(self, async_client: AsyncOrb) -> None: @@ -1488,7 +1498,7 @@ async def test_streaming_response_cancel(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1505,7 +1515,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.fetch( "subscription_id", ) - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -1516,7 +1526,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -1527,7 +1537,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionModel, subscription, path=["response"]) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1704,7 +1714,7 @@ async def test_method_price_intervals(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.price_intervals( subscription_id="subscription_id", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -1801,7 +1811,7 @@ async def test_method_price_intervals_with_all_params(self, async_client: AsyncO } ], ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -1813,7 +1823,7 @@ async def test_raw_response_price_intervals(self, async_client: AsyncOrb) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -1825,7 +1835,7 @@ async def test_streaming_response_price_intervals(self, async_client: AsyncOrb) assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1843,7 +1853,7 @@ async def test_method_schedule_plan_change(self, async_client: AsyncOrb) -> None subscription_id="subscription_id", change_option="requested_date", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) @parametrize async def test_method_schedule_plan_change_with_all_params(self, async_client: AsyncOrb) -> None: @@ -2002,7 +2012,7 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A trial_duration_days=999999, usage_customer_ids=["string"], ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) @parametrize async def test_raw_response_schedule_plan_change(self, async_client: AsyncOrb) -> None: @@ -2014,7 +2024,7 @@ async def test_raw_response_schedule_plan_change(self, async_client: AsyncOrb) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) @parametrize async def test_streaming_response_schedule_plan_change(self, async_client: AsyncOrb) -> None: @@ -2026,7 +2036,7 @@ async def test_streaming_response_schedule_plan_change(self, async_client: Async assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2043,7 +2053,7 @@ async def test_method_trigger_phase(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.trigger_phase( subscription_id="subscription_id", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) @parametrize async def test_method_trigger_phase_with_all_params(self, async_client: AsyncOrb) -> None: @@ -2052,7 +2062,7 @@ async def test_method_trigger_phase_with_all_params(self, async_client: AsyncOrb allow_invoice_credit_or_void=True, effective_date=parse_date("2019-12-27"), ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) @parametrize async def test_raw_response_trigger_phase(self, async_client: AsyncOrb) -> None: @@ -2063,7 +2073,7 @@ async def test_raw_response_trigger_phase(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) @parametrize async def test_streaming_response_trigger_phase(self, async_client: AsyncOrb) -> None: @@ -2074,7 +2084,7 @@ async def test_streaming_response_trigger_phase(self, async_client: AsyncOrb) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2090,7 +2100,7 @@ async def test_method_unschedule_cancellation(self, async_client: AsyncOrb) -> N subscription = await async_client.subscriptions.unschedule_cancellation( "subscription_id", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnscheduleCancellationResponse, subscription, path=["response"]) @parametrize async def test_raw_response_unschedule_cancellation(self, async_client: AsyncOrb) -> None: @@ -2101,7 +2111,7 @@ async def test_raw_response_unschedule_cancellation(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnscheduleCancellationResponse, subscription, path=["response"]) @parametrize async def test_streaming_response_unschedule_cancellation(self, async_client: AsyncOrb) -> None: @@ -2112,7 +2122,7 @@ async def test_streaming_response_unschedule_cancellation(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnscheduleCancellationResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2129,7 +2139,7 @@ async def test_method_unschedule_fixed_fee_quantity_updates(self, async_client: subscription_id="subscription_id", price_id="price_id", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, subscription, path=["response"]) @parametrize async def test_raw_response_unschedule_fixed_fee_quantity_updates(self, async_client: AsyncOrb) -> None: @@ -2141,7 +2151,7 @@ async def test_raw_response_unschedule_fixed_fee_quantity_updates(self, async_cl assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, subscription, path=["response"]) @parametrize async def test_streaming_response_unschedule_fixed_fee_quantity_updates(self, async_client: AsyncOrb) -> None: @@ -2153,7 +2163,7 @@ async def test_streaming_response_unschedule_fixed_fee_quantity_updates(self, as assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2170,7 +2180,7 @@ async def test_method_unschedule_pending_plan_changes(self, async_client: AsyncO subscription = await async_client.subscriptions.unschedule_pending_plan_changes( "subscription_id", ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnschedulePendingPlanChangesResponse, subscription, path=["response"]) @parametrize async def test_raw_response_unschedule_pending_plan_changes(self, async_client: AsyncOrb) -> None: @@ -2181,7 +2191,7 @@ async def test_raw_response_unschedule_pending_plan_changes(self, async_client: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnschedulePendingPlanChangesResponse, subscription, path=["response"]) @parametrize async def test_streaming_response_unschedule_pending_plan_changes(self, async_client: AsyncOrb) -> None: @@ -2192,7 +2202,7 @@ async def test_streaming_response_unschedule_pending_plan_changes(self, async_cl assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUnschedulePendingPlanChangesResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2210,7 +2220,7 @@ async def test_method_update_fixed_fee_quantity(self, async_client: AsyncOrb) -> price_id="price_id", quantity=0, ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) @parametrize async def test_method_update_fixed_fee_quantity_with_all_params(self, async_client: AsyncOrb) -> None: @@ -2222,7 +2232,7 @@ async def test_method_update_fixed_fee_quantity_with_all_params(self, async_clie change_option="immediate", effective_date=parse_date("2022-12-21"), ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) @parametrize async def test_raw_response_update_fixed_fee_quantity(self, async_client: AsyncOrb) -> None: @@ -2235,7 +2245,7 @@ async def test_raw_response_update_fixed_fee_quantity(self, async_client: AsyncO assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) @parametrize async def test_streaming_response_update_fixed_fee_quantity(self, async_client: AsyncOrb) -> None: @@ -2248,7 +2258,7 @@ async def test_streaming_response_update_fixed_fee_quantity(self, async_client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2267,7 +2277,7 @@ async def test_method_update_trial(self, async_client: AsyncOrb) -> None: subscription_id="subscription_id", trial_end_date=parse_datetime("2017-07-21T17:32:28Z"), ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) @parametrize async def test_method_update_trial_with_all_params(self, async_client: AsyncOrb) -> None: @@ -2276,7 +2286,7 @@ async def test_method_update_trial_with_all_params(self, async_client: AsyncOrb) trial_end_date=parse_datetime("2017-07-21T17:32:28Z"), shift=True, ) - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) @parametrize async def test_raw_response_update_trial(self, async_client: AsyncOrb) -> None: @@ -2288,7 +2298,7 @@ async def test_raw_response_update_trial(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) @parametrize async def test_streaming_response_update_trial(self, async_client: AsyncOrb) -> None: @@ -2300,7 +2310,7 @@ async def test_streaming_response_update_trial(self, async_client: AsyncOrb) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) + assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True