diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile old mode 100755 new mode 100644 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json old mode 100755 new mode 100644 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml old mode 100755 new mode 100644 diff --git a/.github/workflows/create_asana_task.yaml b/.github/workflows/create_asana_task.yaml old mode 100755 new mode 100644 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml old mode 100755 new mode 100644 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/.python-version b/.python-version old mode 100755 new mode 100644 diff --git a/.release-please-manifest.json b/.release-please-manifest.json old mode 100755 new mode 100644 index e6c39adb..0746cbe2 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.11.0" + ".": "2.12.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml old mode 100755 new mode 100644 index dbdbbcd7..0f0325a1 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 93 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-90a52a59bc88bb7c8ae95cd1f8d2e0d69e48320d5481068fe1fbc54f539fd8db.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4df283466fdce46e787565c6480138896b1d7ed98d68a79d5eb3438bed191276.yml diff --git a/Brewfile b/Brewfile old mode 100755 new mode 100644 diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100755 new mode 100644 index 18487972..85062e1c --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 2.12.0 (2024-11-06) + +Full Changelog: [v2.11.0...v2.12.0](https://github.com/orbcorp/orb-python/compare/v2.11.0...v2.12.0) + +### Features + +* **api:** OpenAPI spec update via Stainless API ([#371](https://github.com/orbcorp/orb-python/issues/371)) ([4068313](https://github.com/orbcorp/orb-python/commit/40683137ba62769372640c32c5cd9b618a23685d)) +* **api:** OpenAPI spec update via Stainless API ([#372](https://github.com/orbcorp/orb-python/issues/372)) ([478e200](https://github.com/orbcorp/orb-python/commit/478e2004d1ebc1d4c87871319f5d0d6a0f20be51)) + ## 2.11.0 (2024-11-06) Full Changelog: [v2.10.0...v2.11.0](https://github.com/orbcorp/orb-python/compare/v2.10.0...v2.11.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100755 new mode 100644 diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/SECURITY.md b/SECURITY.md old mode 100755 new mode 100644 diff --git a/api.md b/api.md old mode 100755 new mode 100644 diff --git a/bin/check-release-environment b/bin/check-release-environment old mode 100755 new mode 100644 diff --git a/bin/publish-pypi b/bin/publish-pypi old mode 100755 new mode 100644 diff --git a/codegen.log b/codegen.log old mode 100755 new mode 100644 diff --git a/examples/.keep b/examples/.keep old mode 100755 new mode 100644 diff --git a/mypy.ini b/mypy.ini old mode 100755 new mode 100644 diff --git a/noxfile.py b/noxfile.py old mode 100755 new mode 100644 diff --git a/pyproject.toml b/pyproject.toml old mode 100755 new mode 100644 index 250eee4e..4db5d067 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "2.11.0" +version = "2.12.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" @@ -15,7 +15,6 @@ dependencies = [ "distro>=1.7.0, <2", "sniffio", "cached-property; python_version < '3.8'", - ] requires-python = ">= 3.7" classifiers = [ @@ -36,8 +35,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License" ] - - [project.urls] Homepage = "https://github.com/orbcorp/orb-python" Repository = "https://github.com/orbcorp/orb-python" @@ -59,7 +56,6 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", - ] [tool.rye.scripts] diff --git a/release-please-config.json b/release-please-config.json old mode 100755 new mode 100644 diff --git a/requirements-dev.lock b/requirements-dev.lock old mode 100755 new mode 100644 diff --git a/requirements.lock b/requirements.lock old mode 100755 new mode 100644 diff --git a/scripts/test b/scripts/test old mode 100755 new mode 100644 diff --git a/scripts/utils/ruffen-docs.py b/scripts/utils/ruffen-docs.py old mode 100755 new mode 100644 diff --git a/src/orb/__init__.py b/src/orb/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/_base_client.py b/src/orb/_base_client.py old mode 100755 new mode 100644 diff --git a/src/orb/_client.py b/src/orb/_client.py old mode 100755 new mode 100644 diff --git a/src/orb/_compat.py b/src/orb/_compat.py old mode 100755 new mode 100644 diff --git a/src/orb/_constants.py b/src/orb/_constants.py old mode 100755 new mode 100644 diff --git a/src/orb/_exceptions.py b/src/orb/_exceptions.py old mode 100755 new mode 100644 diff --git a/src/orb/_files.py b/src/orb/_files.py old mode 100755 new mode 100644 diff --git a/src/orb/_legacy_response.py b/src/orb/_legacy_response.py old mode 100755 new mode 100644 diff --git a/src/orb/_models.py b/src/orb/_models.py old mode 100755 new mode 100644 diff --git a/src/orb/_qs.py b/src/orb/_qs.py old mode 100755 new mode 100644 diff --git a/src/orb/_resource.py b/src/orb/_resource.py old mode 100755 new mode 100644 diff --git a/src/orb/_response.py b/src/orb/_response.py old mode 100755 new mode 100644 diff --git a/src/orb/_streaming.py b/src/orb/_streaming.py old mode 100755 new mode 100644 diff --git a/src/orb/_types.py b/src/orb/_types.py old mode 100755 new mode 100644 diff --git a/src/orb/_utils/__init__.py b/src/orb/_utils/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/_utils/_logs.py b/src/orb/_utils/_logs.py old mode 100755 new mode 100644 diff --git a/src/orb/_utils/_proxy.py b/src/orb/_utils/_proxy.py old mode 100755 new mode 100644 diff --git a/src/orb/_utils/_reflection.py b/src/orb/_utils/_reflection.py old mode 100755 new mode 100644 diff --git a/src/orb/_utils/_streams.py b/src/orb/_utils/_streams.py old mode 100755 new mode 100644 diff --git a/src/orb/_utils/_sync.py b/src/orb/_utils/_sync.py old mode 100755 new mode 100644 diff --git a/src/orb/_utils/_transform.py b/src/orb/_utils/_transform.py old mode 100755 new mode 100644 diff --git a/src/orb/_utils/_typing.py b/src/orb/_utils/_typing.py old mode 100755 new mode 100644 diff --git a/src/orb/_utils/_utils.py b/src/orb/_utils/_utils.py old mode 100755 new mode 100644 diff --git a/src/orb/_version.py b/src/orb/_version.py old mode 100755 new mode 100644 index 86a80dcc..f613bb9f --- a/src/orb/_version.py +++ b/src/orb/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "orb" -__version__ = "2.11.0" # x-release-please-version +__version__ = "2.12.0" # x-release-please-version diff --git a/src/orb/lib/.keep b/src/orb/lib/.keep old mode 100755 new mode 100644 diff --git a/src/orb/pagination.py b/src/orb/pagination.py old mode 100755 new mode 100644 diff --git a/src/orb/py.typed b/src/orb/py.typed old mode 100755 new mode 100644 diff --git a/src/orb/resources/__init__.py b/src/orb/resources/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/alerts.py b/src/orb/resources/alerts.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/coupons/__init__.py b/src/orb/resources/coupons/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/coupons/coupons.py b/src/orb/resources/coupons/coupons.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/coupons/subscriptions.py b/src/orb/resources/coupons/subscriptions.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/credit_notes.py b/src/orb/resources/credit_notes.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/customers/__init__.py b/src/orb/resources/customers/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/customers/balance_transactions.py b/src/orb/resources/customers/balance_transactions.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/customers/costs.py b/src/orb/resources/customers/costs.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/customers/credits/__init__.py b/src/orb/resources/customers/credits/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/customers/credits/credits.py b/src/orb/resources/customers/credits/credits.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/customers/credits/ledger.py b/src/orb/resources/customers/credits/ledger.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/customers/credits/top_ups.py b/src/orb/resources/customers/credits/top_ups.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/customers/customers.py b/src/orb/resources/customers/customers.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/events/__init__.py b/src/orb/resources/events/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/events/backfills.py b/src/orb/resources/events/backfills.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/events/events.py b/src/orb/resources/events/events.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/invoice_line_items.py b/src/orb/resources/invoice_line_items.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/invoices.py b/src/orb/resources/invoices.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/items.py b/src/orb/resources/items.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/metrics.py b/src/orb/resources/metrics.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/plans/__init__.py b/src/orb/resources/plans/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/plans/external_plan_id.py b/src/orb/resources/plans/external_plan_id.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/plans/plans.py b/src/orb/resources/plans/plans.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/prices/__init__.py b/src/orb/resources/prices/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/prices/external_price_id.py b/src/orb/resources/prices/external_price_id.py old mode 100755 new mode 100644 diff --git a/src/orb/resources/prices/prices.py b/src/orb/resources/prices/prices.py old mode 100755 new mode 100644 index 02c29ae4..3adc451f --- a/src/orb/resources/prices/prices.py +++ b/src/orb/resources/prices/prices.py @@ -1766,6 +1766,98 @@ def create( """ ... + @overload + def create( + self, + *, + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + currency: str, + 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[ + 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[ + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Price: + """This endpoint is used to create a [price](../reference/price). + + A price created + using this endpoint is always an add-on, meaning that it’s not associated with a + specific plan and can instead be individually added to subscriptions, including + subscriptions on different plans. + + An `external_price_id` can be optionally specified as an alias to allow + ergonomic interaction with prices in the Orb API. + + See the [Price resource](../reference/price) for the specification of different + price model configurations possible in this endpoint. + + Args: + cadence: The cadence to bill for this price on. + + currency: An ISO 4217 currency string for which this price is billed in. + + item_id: The id of the item the plan will be associated with. + + name: The name of the price. + + billable_metric_id: The id of the billable metric for the price. Only needed if the price is + usage-based. + + billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. + + external_price_id: An alias for the price. + + fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units + applied. + + invoice_grouping_key: The property used to group this price on an invoice + + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + + metadata: 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`. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + ... + @overload def create( self, @@ -1878,6 +1970,7 @@ def create( ["cadence", "currency", "item_id", "model_type", "name", "tiered_with_proration_config"], ["cadence", "currency", "item_id", "model_type", "name", "unit_with_proration_config"], ["cadence", "currency", "grouped_allocation_config", "item_id", "model_type", "name"], + ["cadence", "currency", "grouped_with_prorated_minimum_config", "item_id", "model_type", "name"], ["bulk_with_proration_config", "cadence", "currency", "item_id", "model_type", "name"], ) def create( @@ -1905,6 +1998,7 @@ def create( | Literal["tiered_with_proration"] | Literal["unit_with_proration"] | Literal["grouped_allocation"] + | Literal["grouped_with_prorated_minimum"] | Literal["bulk_with_proration"], name: str, unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN, @@ -1938,6 +2032,7 @@ def create( 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, bulk_with_proration_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. @@ -1986,6 +2081,7 @@ def create( "tiered_with_proration_config": tiered_with_proration_config, "unit_with_proration_config": unit_with_proration_config, "grouped_allocation_config": grouped_allocation_config, + "grouped_with_prorated_minimum_config": grouped_with_prorated_minimum_config, "bulk_with_proration_config": bulk_with_proration_config, }, price_create_params.PriceCreateParams, @@ -3963,6 +4059,98 @@ async def create( """ ... + @overload + async def create( + self, + *, + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + currency: str, + 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[ + 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[ + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Price: + """This endpoint is used to create a [price](../reference/price). + + A price created + using this endpoint is always an add-on, meaning that it’s not associated with a + specific plan and can instead be individually added to subscriptions, including + subscriptions on different plans. + + An `external_price_id` can be optionally specified as an alias to allow + ergonomic interaction with prices in the Orb API. + + See the [Price resource](../reference/price) for the specification of different + price model configurations possible in this endpoint. + + Args: + cadence: The cadence to bill for this price on. + + currency: An ISO 4217 currency string for which this price is billed in. + + item_id: The id of the item the plan will be associated with. + + name: The name of the price. + + billable_metric_id: The id of the billable metric for the price. Only needed if the price is + usage-based. + + billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. + + external_price_id: An alias for the price. + + fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units + applied. + + invoice_grouping_key: The property used to group this price on an invoice + + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + + metadata: 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`. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + ... + @overload async def create( self, @@ -4075,6 +4263,7 @@ async def create( ["cadence", "currency", "item_id", "model_type", "name", "tiered_with_proration_config"], ["cadence", "currency", "item_id", "model_type", "name", "unit_with_proration_config"], ["cadence", "currency", "grouped_allocation_config", "item_id", "model_type", "name"], + ["cadence", "currency", "grouped_with_prorated_minimum_config", "item_id", "model_type", "name"], ["bulk_with_proration_config", "cadence", "currency", "item_id", "model_type", "name"], ) async def create( @@ -4102,6 +4291,7 @@ async def create( | Literal["tiered_with_proration"] | Literal["unit_with_proration"] | Literal["grouped_allocation"] + | Literal["grouped_with_prorated_minimum"] | Literal["bulk_with_proration"], name: str, unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN, @@ -4135,6 +4325,7 @@ async def create( 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, bulk_with_proration_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. @@ -4183,6 +4374,7 @@ async def create( "tiered_with_proration_config": tiered_with_proration_config, "unit_with_proration_config": unit_with_proration_config, "grouped_allocation_config": grouped_allocation_config, + "grouped_with_prorated_minimum_config": grouped_with_prorated_minimum_config, "bulk_with_proration_config": bulk_with_proration_config, }, price_create_params.PriceCreateParams, diff --git a/src/orb/resources/subscriptions.py b/src/orb/resources/subscriptions.py old mode 100755 new mode 100644 index b5af316b..4155f2de --- a/src/orb/resources/subscriptions.py +++ b/src/orb/resources/subscriptions.py @@ -477,13 +477,34 @@ def create( $10.00 for a subscription that invoices in USD. Args: + auto_collection: Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. If not specified, this + defaults to the behavior configured for this customer. + + coupon_redemption_code: Redemption code to be used for this subscription. If the coupon cannot be found + by its redemption code, or cannot be redeemed, an error response will be + returned and the subscription creation or plan change will not be scheduled. + + default_invoice_memo: Determines the default memo on this subscription's invoices. Note that if this + is not provided, it is determined by the plan configuration. + external_plan_id: The external_plan_id of the plan that the given subscription should be switched to. Note that either this property or `plan_id` must be specified. + initial_phase_order: The phase of the plan to start with + + invoicing_threshold: When this subscription's accrued usage reaches this threshold, an invoice will + be issued for the subscription. If not specified, invoices will only be issued + at the end of the billing period. + metadata: 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`. + net_terms: 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. If not provided, this defaults to the value specified in the plan. + plan_id: The plan that the given subscription should be switched to. Note that either this property or `external_plan_id` must be specified. @@ -1377,14 +1398,17 @@ def schedule_plan_change( *, change_option: Literal["requested_date", "end_of_subscription_term", "immediate"], align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN, + auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] | 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, + default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN, external_plan_id: Optional[str] | NotGiven = NOT_GIVEN, initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN, invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, + net_terms: Optional[int] | NotGiven = NOT_GIVEN, per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN, plan_id: Optional[str] | NotGiven = NOT_GIVEN, price_overrides: Optional[Iterable[subscription_schedule_plan_change_params.PriceOverride]] @@ -1448,6 +1472,10 @@ def schedule_plan_change( align_billing_with_plan_change_date: [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be aligned with the plan change's effective date. + auto_collection: Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. If not specified, this + defaults to the behavior configured for this customer. + billing_cycle_alignment: Reset billing periods to be aligned with the plan change's effective date or start of the month. Defaults to `unchanged` which keeps subscription's existing billing cycle alignment. @@ -1457,7 +1485,10 @@ def schedule_plan_change( coupon_redemption_code: Redemption code to be used for this subscription. If the coupon cannot be found by its redemption code, or cannot be redeemed, an error response will be - returned and the plan change will not be scheduled. + returned and the subscription creation or plan change will not be scheduled. + + default_invoice_memo: Determines the default memo on this subscription's invoices. Note that if this + is not provided, it is determined by the plan configuration. external_plan_id: The external_plan_id of the plan that the given subscription should be switched to. Note that either this property or `plan_id` must be specified. @@ -1468,6 +1499,10 @@ def schedule_plan_change( be issued for the subscription. If not specified, invoices will only be issued at the end of the billing period. + net_terms: 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. If not provided, this defaults to the value specified in the plan. + plan_id: The plan that the given subscription should be switched to. Note that either this property or `external_plan_id` must be specified. @@ -1491,13 +1526,16 @@ def schedule_plan_change( { "change_option": change_option, "align_billing_with_plan_change_date": align_billing_with_plan_change_date, + "auto_collection": auto_collection, "billing_cycle_alignment": billing_cycle_alignment, "change_date": change_date, "coupon_redemption_code": coupon_redemption_code, "credits_overage_rate": credits_overage_rate, + "default_invoice_memo": default_invoice_memo, "external_plan_id": external_plan_id, "initial_phase_order": initial_phase_order, "invoicing_threshold": invoicing_threshold, + "net_terms": net_terms, "per_credit_overage_amount": per_credit_overage_amount, "plan_id": plan_id, "price_overrides": price_overrides, @@ -2212,13 +2250,34 @@ async def create( $10.00 for a subscription that invoices in USD. Args: + auto_collection: Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. If not specified, this + defaults to the behavior configured for this customer. + + coupon_redemption_code: Redemption code to be used for this subscription. If the coupon cannot be found + by its redemption code, or cannot be redeemed, an error response will be + returned and the subscription creation or plan change will not be scheduled. + + default_invoice_memo: Determines the default memo on this subscription's invoices. Note that if this + is not provided, it is determined by the plan configuration. + external_plan_id: The external_plan_id of the plan that the given subscription should be switched to. Note that either this property or `plan_id` must be specified. + initial_phase_order: The phase of the plan to start with + + invoicing_threshold: When this subscription's accrued usage reaches this threshold, an invoice will + be issued for the subscription. If not specified, invoices will only be issued + at the end of the billing period. + metadata: 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`. + net_terms: 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. If not provided, this defaults to the value specified in the plan. + plan_id: The plan that the given subscription should be switched to. Note that either this property or `external_plan_id` must be specified. @@ -3112,14 +3171,17 @@ async def schedule_plan_change( *, change_option: Literal["requested_date", "end_of_subscription_term", "immediate"], align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN, + auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] | 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, + default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN, external_plan_id: Optional[str] | NotGiven = NOT_GIVEN, initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN, invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, + net_terms: Optional[int] | NotGiven = NOT_GIVEN, per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN, plan_id: Optional[str] | NotGiven = NOT_GIVEN, price_overrides: Optional[Iterable[subscription_schedule_plan_change_params.PriceOverride]] @@ -3183,6 +3245,10 @@ async def schedule_plan_change( align_billing_with_plan_change_date: [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be aligned with the plan change's effective date. + auto_collection: Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. If not specified, this + defaults to the behavior configured for this customer. + billing_cycle_alignment: Reset billing periods to be aligned with the plan change's effective date or start of the month. Defaults to `unchanged` which keeps subscription's existing billing cycle alignment. @@ -3192,7 +3258,10 @@ async def schedule_plan_change( coupon_redemption_code: Redemption code to be used for this subscription. If the coupon cannot be found by its redemption code, or cannot be redeemed, an error response will be - returned and the plan change will not be scheduled. + returned and the subscription creation or plan change will not be scheduled. + + default_invoice_memo: Determines the default memo on this subscription's invoices. Note that if this + is not provided, it is determined by the plan configuration. external_plan_id: The external_plan_id of the plan that the given subscription should be switched to. Note that either this property or `plan_id` must be specified. @@ -3203,6 +3272,10 @@ async def schedule_plan_change( be issued for the subscription. If not specified, invoices will only be issued at the end of the billing period. + net_terms: 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. If not provided, this defaults to the value specified in the plan. + plan_id: The plan that the given subscription should be switched to. Note that either this property or `external_plan_id` must be specified. @@ -3226,13 +3299,16 @@ async def schedule_plan_change( { "change_option": change_option, "align_billing_with_plan_change_date": align_billing_with_plan_change_date, + "auto_collection": auto_collection, "billing_cycle_alignment": billing_cycle_alignment, "change_date": change_date, "coupon_redemption_code": coupon_redemption_code, "credits_overage_rate": credits_overage_rate, + "default_invoice_memo": default_invoice_memo, "external_plan_id": external_plan_id, "initial_phase_order": initial_phase_order, "invoicing_threshold": invoicing_threshold, + "net_terms": net_terms, "per_credit_overage_amount": per_credit_overage_amount, "plan_id": plan_id, "price_overrides": price_overrides, diff --git a/src/orb/resources/top_level.py b/src/orb/resources/top_level.py old mode 100755 new mode 100644 diff --git a/src/orb/types/__init__.py b/src/orb/types/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/types/alert.py b/src/orb/types/alert.py old mode 100755 new mode 100644 diff --git a/src/orb/types/alert_create_for_customer_params.py b/src/orb/types/alert_create_for_customer_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/alert_create_for_external_customer_params.py b/src/orb/types/alert_create_for_external_customer_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/alert_create_for_subscription_params.py b/src/orb/types/alert_create_for_subscription_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/alert_list_params.py b/src/orb/types/alert_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/alert_update_params.py b/src/orb/types/alert_update_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/billable_metric.py b/src/orb/types/billable_metric.py old mode 100755 new mode 100644 diff --git a/src/orb/types/coupon.py b/src/orb/types/coupon.py old mode 100755 new mode 100644 diff --git a/src/orb/types/coupon_create_params.py b/src/orb/types/coupon_create_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/coupon_list_params.py b/src/orb/types/coupon_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/coupons/__init__.py b/src/orb/types/coupons/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/types/coupons/subscription_list_params.py b/src/orb/types/coupons/subscription_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/credit_note.py b/src/orb/types/credit_note.py old mode 100755 new mode 100644 diff --git a/src/orb/types/credit_note_list_params.py b/src/orb/types/credit_note_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customer.py b/src/orb/types/customer.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customer_create_params.py b/src/orb/types/customer_create_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customer_list_params.py b/src/orb/types/customer_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customer_update_by_external_id_params.py b/src/orb/types/customer_update_by_external_id_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customer_update_params.py b/src/orb/types/customer_update_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/__init__.py b/src/orb/types/customers/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/balance_transaction_create_params.py b/src/orb/types/customers/balance_transaction_create_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/balance_transaction_create_response.py b/src/orb/types/customers/balance_transaction_create_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/balance_transaction_list_params.py b/src/orb/types/customers/balance_transaction_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/balance_transaction_list_response.py b/src/orb/types/customers/balance_transaction_list_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/cost_list_by_external_id_params.py b/src/orb/types/customers/cost_list_by_external_id_params.py old mode 100755 new mode 100644 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 old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/cost_list_params.py b/src/orb/types/customers/cost_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/cost_list_response.py b/src/orb/types/customers/cost_list_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credit_list_by_external_id_params.py b/src/orb/types/customers/credit_list_by_external_id_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credit_list_by_external_id_response.py b/src/orb/types/customers/credit_list_by_external_id_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credit_list_params.py b/src/orb/types/customers/credit_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credit_list_response.py b/src/orb/types/customers/credit_list_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/__init__.py b/src/orb/types/customers/credits/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py old mode 100755 new mode 100644 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 old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/ledger_create_entry_params.py b/src/orb/types/customers/credits/ledger_create_entry_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/ledger_create_entry_response.py b/src/orb/types/customers/credits/ledger_create_entry_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/ledger_list_by_external_id_params.py b/src/orb/types/customers/credits/ledger_list_by_external_id_params.py old mode 100755 new mode 100644 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 old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/ledger_list_params.py b/src/orb/types/customers/credits/ledger_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/ledger_list_response.py b/src/orb/types/customers/credits/ledger_list_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/top_up_create_by_external_id_params.py b/src/orb/types/customers/credits/top_up_create_by_external_id_params.py old mode 100755 new mode 100644 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 old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/top_up_create_params.py b/src/orb/types/customers/credits/top_up_create_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/top_up_create_response.py b/src/orb/types/customers/credits/top_up_create_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/top_up_list_by_external_id_params.py b/src/orb/types/customers/credits/top_up_list_by_external_id_params.py old mode 100755 new mode 100644 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 old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/top_up_list_params.py b/src/orb/types/customers/credits/top_up_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/customers/credits/top_up_list_response.py b/src/orb/types/customers/credits/top_up_list_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/evaluate_price_group.py b/src/orb/types/evaluate_price_group.py old mode 100755 new mode 100644 diff --git a/src/orb/types/event_deprecate_response.py b/src/orb/types/event_deprecate_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/event_ingest_params.py b/src/orb/types/event_ingest_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/event_ingest_response.py b/src/orb/types/event_ingest_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/event_search_params.py b/src/orb/types/event_search_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/event_search_response.py b/src/orb/types/event_search_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/event_update_params.py b/src/orb/types/event_update_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/event_update_response.py b/src/orb/types/event_update_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/events/__init__.py b/src/orb/types/events/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/types/events/backfill_close_response.py b/src/orb/types/events/backfill_close_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/events/backfill_create_params.py b/src/orb/types/events/backfill_create_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/events/backfill_create_response.py b/src/orb/types/events/backfill_create_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/events/backfill_fetch_response.py b/src/orb/types/events/backfill_fetch_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/events/backfill_list_params.py b/src/orb/types/events/backfill_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/events/backfill_list_response.py b/src/orb/types/events/backfill_list_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/events/backfill_revert_response.py b/src/orb/types/events/backfill_revert_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/invoice.py b/src/orb/types/invoice.py old mode 100755 new mode 100644 diff --git a/src/orb/types/invoice_create_params.py b/src/orb/types/invoice_create_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/invoice_fetch_upcoming_params.py b/src/orb/types/invoice_fetch_upcoming_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/invoice_fetch_upcoming_response.py b/src/orb/types/invoice_fetch_upcoming_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/invoice_line_item_create_params.py b/src/orb/types/invoice_line_item_create_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/invoice_line_item_create_response.py b/src/orb/types/invoice_line_item_create_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/invoice_list_params.py b/src/orb/types/invoice_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/invoice_mark_paid_params.py b/src/orb/types/invoice_mark_paid_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/invoice_update_params.py b/src/orb/types/invoice_update_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/item.py b/src/orb/types/item.py old mode 100755 new mode 100644 diff --git a/src/orb/types/item_create_params.py b/src/orb/types/item_create_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/item_list_params.py b/src/orb/types/item_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/item_update_params.py b/src/orb/types/item_update_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/metric_create_params.py b/src/orb/types/metric_create_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/metric_list_params.py b/src/orb/types/metric_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/metric_update_params.py b/src/orb/types/metric_update_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/plan.py b/src/orb/types/plan.py old mode 100755 new mode 100644 diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py old mode 100755 new mode 100644 index 3709cfae..e1cf3c36 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -69,6 +69,9 @@ "PriceNewPlanGroupedAllocationPrice", "PriceNewPlanGroupedAllocationPriceBillingCycleConfiguration", "PriceNewPlanGroupedAllocationPriceInvoicingCycleConfiguration", + "PriceNewPlanGroupedWithProratedMinimumPrice", + "PriceNewPlanGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "PriceNewPlanGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", "PriceNewPlanBulkWithProrationPrice", "PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration", "PriceNewPlanBulkWithProrationPriceInvoicingCycleConfiguration", @@ -1564,6 +1567,89 @@ 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[Dict[str, object]] + + item_id: Required[str] + """The id of the item the plan 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[PriceNewPlanGroupedWithProratedMinimumPriceBillingCycleConfiguration] + """ + 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[PriceNewPlanGroupedWithProratedMinimumPriceInvoicingCycleConfiguration] + """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 PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): duration: Required[int] """The duration of the billing period.""" @@ -1664,5 +1750,6 @@ class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False): PriceNewPlanTierWithProrationPrice, PriceNewPlanUnitWithProrationPrice, PriceNewPlanGroupedAllocationPrice, + PriceNewPlanGroupedWithProratedMinimumPrice, PriceNewPlanBulkWithProrationPrice, ] diff --git a/src/orb/types/plan_list_params.py b/src/orb/types/plan_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/plan_update_params.py b/src/orb/types/plan_update_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/plans/__init__.py b/src/orb/types/plans/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/types/plans/external_plan_id_update_params.py b/src/orb/types/plans/external_plan_id_update_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/price.py b/src/orb/types/price.py old mode 100755 new mode 100644 index e4ea52e8..c20810d8 --- a/src/orb/types/price.py +++ b/src/orb/types/price.py @@ -179,6 +179,14 @@ "GroupedAllocationPriceItem", "GroupedAllocationPriceMaximum", "GroupedAllocationPriceMinimum", + "GroupedWithProratedMinimumPrice", + "GroupedWithProratedMinimumPriceBillableMetric", + "GroupedWithProratedMinimumPriceBillingCycleConfiguration", + "GroupedWithProratedMinimumPriceCreditAllocation", + "GroupedWithProratedMinimumPriceInvoicingCycleConfiguration", + "GroupedWithProratedMinimumPriceItem", + "GroupedWithProratedMinimumPriceMaximum", + "GroupedWithProratedMinimumPriceMinimum", "BulkWithProrationPrice", "BulkWithProrationPriceBillableMetric", "BulkWithProrationPriceBillingCycleConfiguration", @@ -2310,6 +2318,110 @@ class GroupedAllocationPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] +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 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"] + + class BulkWithProrationPriceBillableMetric(BaseModel): id: str @@ -2435,6 +2547,7 @@ class BulkWithProrationPrice(BaseModel): TieredWithProrationPrice, UnitWithProrationPrice, GroupedAllocationPrice, + GroupedWithProratedMinimumPrice, BulkWithProrationPrice, ], PropertyInfo(discriminator="price_model_type"), diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py old mode 100755 new mode 100644 index acdc2a58..bf7f194e --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -79,6 +79,9 @@ "NewFloatingGroupedAllocationPrice", "NewFloatingGroupedAllocationPriceBillingCycleConfiguration", "NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration", + "NewFloatingGroupedWithProratedMinimumPrice", + "NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", "NewFloatingBulkWithProrationPrice", "NewFloatingBulkWithProrationPriceBillingCycleConfiguration", "NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration", @@ -1749,6 +1752,86 @@ class NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, to """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.""" + + 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 plan 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[NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration] + """ + 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[NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration] + """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 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 NewFloatingBulkWithProrationPrice(TypedDict, total=False): bulk_with_proration_config: Required[Dict[str, object]] @@ -1849,5 +1932,6 @@ class NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, to NewFloatingTieredWithProrationPrice, NewFloatingUnitWithProrationPrice, NewFloatingGroupedAllocationPrice, + NewFloatingGroupedWithProratedMinimumPrice, NewFloatingBulkWithProrationPrice, ] diff --git a/src/orb/types/price_evaluate_params.py b/src/orb/types/price_evaluate_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/price_evaluate_response.py b/src/orb/types/price_evaluate_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/price_list_params.py b/src/orb/types/price_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/price_update_params.py b/src/orb/types/price_update_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/prices/__init__.py b/src/orb/types/prices/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/types/prices/external_price_id_update_params.py b/src/orb/types/prices/external_price_id_update_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/shared/__init__.py b/src/orb/types/shared/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/types/shared/billing_cycle_relative_date.py b/src/orb/types/shared/billing_cycle_relative_date.py old mode 100755 new mode 100644 diff --git a/src/orb/types/shared/discount.py b/src/orb/types/shared/discount.py old mode 100755 new mode 100644 diff --git a/src/orb/types/shared/pagination_metadata.py b/src/orb/types/shared/pagination_metadata.py old mode 100755 new mode 100644 diff --git a/src/orb/types/shared_params/__init__.py b/src/orb/types/shared_params/__init__.py old mode 100755 new mode 100644 diff --git a/src/orb/types/shared_params/billing_cycle_relative_date.py b/src/orb/types/shared_params/billing_cycle_relative_date.py old mode 100755 new mode 100644 diff --git a/src/orb/types/shared_params/discount.py b/src/orb/types/shared_params/discount.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription.py b/src/orb/types/subscription.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription_cancel_params.py b/src/orb/types/subscription_cancel_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription_create_params.py b/src/orb/types/subscription_create_params.py old mode 100755 new mode 100644 index 70278f13..f88e5e01 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -53,6 +53,8 @@ "PriceOverrideOverrideUnitWithPercentPriceDiscount", "PriceOverrideOverrideGroupedAllocationPrice", "PriceOverrideOverrideGroupedAllocationPriceDiscount", + "PriceOverrideOverrideGroupedWithProratedMinimumPrice", + "PriceOverrideOverrideGroupedWithProratedMinimumPriceDiscount", "PriceOverrideOverrideBulkWithProrationPrice", "PriceOverrideOverrideBulkWithProrationPriceDiscount", ] @@ -62,18 +64,33 @@ class SubscriptionCreateParams(TypedDict, total=False): align_billing_with_subscription_start_date: bool auto_collection: Optional[bool] + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. If not specified, this + defaults to the behavior configured for this customer. + """ aws_region: Optional[str] billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfiguration] coupon_redemption_code: Optional[str] + """Redemption code to be used for this subscription. + + If the coupon cannot be found by its redemption code, or cannot be redeemed, an + error response will be returned and the subscription creation or plan change + will not be scheduled. + """ credits_overage_rate: Optional[float] customer_id: Optional[str] default_invoice_memo: Optional[str] + """Determines the default memo on this subscription's invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] @@ -90,8 +107,14 @@ class SubscriptionCreateParams(TypedDict, total=False): """ initial_phase_order: Optional[int] + """The phase of the plan to start with""" invoicing_threshold: Optional[str] + """ + When this subscription's accrued usage reaches this threshold, an invoice will + be issued for the subscription. If not specified, invoices will only be issued + at the end of the billing period. + """ metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -101,6 +124,11 @@ class SubscriptionCreateParams(TypedDict, total=False): """ net_terms: Optional[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. If not provided, this defaults to the value specified in the plan. + """ per_credit_overage_amount: Optional[float] @@ -1056,6 +1084,63 @@ class PriceOverrideOverrideGroupedAllocationPrice(TypedDict, total=False): """The subscription's override minimum amount for the plan.""" +class PriceOverrideOverrideGroupedWithProratedMinimumPriceDiscount(TypedDict, total=False): + discount_type: Required[Literal["percentage", "trial", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: Optional[List[str]] + """List of price_ids that this discount applies to. + + For plan/plan phase discounts, this can be a subset of prices. + """ + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + trial_amount_discount: Optional[str] + """Only available if discount_type is `trial`""" + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class PriceOverrideOverrideGroupedWithProratedMinimumPrice(TypedDict, total=False): + id: Required[str] + + grouped_with_prorated_minimum_config: Required[Dict[str, object]] + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """The currency of the price. + + If not provided, the currency of the plan will be used. + """ + + discount: Optional[PriceOverrideOverrideGroupedWithProratedMinimumPriceDiscount] + """The subscription's override discount for the plan.""" + + fixed_price_quantity: Optional[float] + """The starting quantity of the price, if the price is a fixed price.""" + + maximum_amount: Optional[str] + """The subscription's override maximum amount for the plan.""" + + minimum_amount: Optional[str] + """The subscription's override minimum amount for the plan.""" + + class PriceOverrideOverrideBulkWithProrationPriceDiscount(TypedDict, total=False): discount_type: Required[Literal["percentage", "trial", "usage", "amount"]] @@ -1128,5 +1213,6 @@ class PriceOverrideOverrideBulkWithProrationPrice(TypedDict, total=False): PriceOverrideOverridePackageWithAllocationPrice, PriceOverrideOverrideUnitWithPercentPrice, PriceOverrideOverrideGroupedAllocationPrice, + PriceOverrideOverrideGroupedWithProratedMinimumPrice, PriceOverrideOverrideBulkWithProrationPrice, ] diff --git a/src/orb/types/subscription_fetch_costs_params.py b/src/orb/types/subscription_fetch_costs_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription_fetch_costs_response.py b/src/orb/types/subscription_fetch_costs_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription_fetch_schedule_params.py b/src/orb/types/subscription_fetch_schedule_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription_fetch_schedule_response.py b/src/orb/types/subscription_fetch_schedule_response.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription_fetch_usage_params.py b/src/orb/types/subscription_fetch_usage_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription_list_params.py b/src/orb/types/subscription_list_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py old mode 100755 new mode 100644 index f15230d1..1811ff2e --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -91,6 +91,9 @@ "AddPriceNewFloatingGroupedAllocationPrice", "AddPriceNewFloatingGroupedAllocationPriceBillingCycleConfiguration", "AddPriceNewFloatingGroupedAllocationPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingGroupedWithProratedMinimumPrice", + "AddPriceNewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "AddPriceNewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", "AddPriceNewFloatingBulkWithProrationPrice", "AddPriceNewFloatingBulkWithProrationPriceBillingCycleConfiguration", "AddPriceNewFloatingBulkWithProrationPriceInvoicingCycleConfiguration", @@ -1846,6 +1849,88 @@ class AddPriceNewFloatingGroupedAllocationPrice(TypedDict, total=False): """ +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 plan 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 AddPriceNewFloatingBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): duration: Required[int] """The duration of the billing period.""" @@ -1946,6 +2031,7 @@ class AddPriceNewFloatingBulkWithProrationPrice(TypedDict, total=False): AddPriceNewFloatingTieredWithProrationPrice, AddPriceNewFloatingUnitWithProrationPrice, AddPriceNewFloatingGroupedAllocationPrice, + AddPriceNewFloatingGroupedWithProratedMinimumPrice, AddPriceNewFloatingBulkWithProrationPrice, ] diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py old mode 100755 new mode 100644 index 4b2a090b..c7e06d4e --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -52,6 +52,8 @@ "PriceOverrideOverrideUnitWithPercentPriceDiscount", "PriceOverrideOverrideGroupedAllocationPrice", "PriceOverrideOverrideGroupedAllocationPriceDiscount", + "PriceOverrideOverrideGroupedWithProratedMinimumPrice", + "PriceOverrideOverrideGroupedWithProratedMinimumPriceDiscount", "PriceOverrideOverrideBulkWithProrationPrice", "PriceOverrideOverrideBulkWithProrationPriceDiscount", ] @@ -66,6 +68,13 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): Reset billing periods to be aligned with the plan change's effective date. """ + auto_collection: Optional[bool] + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. If not specified, this + defaults to the behavior configured for this customer. + """ + billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] """ Reset billing periods to be aligned with the plan change's effective date or @@ -83,11 +92,18 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): """Redemption code to be used for this subscription. If the coupon cannot be found by its redemption code, or cannot be redeemed, an - error response will be returned and the plan change will not be scheduled. + error response will be returned and the subscription creation or plan change + will not be scheduled. """ credits_overage_rate: Optional[float] + default_invoice_memo: Optional[str] + """Determines the default memo on this subscription's invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + external_plan_id: Optional[str] """ The external_plan_id of the plan that the given subscription should be switched @@ -104,6 +120,13 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): at the end of the billing period. """ + net_terms: Optional[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. If not provided, this defaults to the value specified in the plan. + """ + per_credit_overage_amount: Optional[float] plan_id: Optional[str] @@ -1032,6 +1055,63 @@ class PriceOverrideOverrideGroupedAllocationPrice(TypedDict, total=False): """The subscription's override minimum amount for the plan.""" +class PriceOverrideOverrideGroupedWithProratedMinimumPriceDiscount(TypedDict, total=False): + discount_type: Required[Literal["percentage", "trial", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: Optional[List[str]] + """List of price_ids that this discount applies to. + + For plan/plan phase discounts, this can be a subset of prices. + """ + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + trial_amount_discount: Optional[str] + """Only available if discount_type is `trial`""" + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class PriceOverrideOverrideGroupedWithProratedMinimumPrice(TypedDict, total=False): + id: Required[str] + + grouped_with_prorated_minimum_config: Required[Dict[str, object]] + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """The currency of the price. + + If not provided, the currency of the plan will be used. + """ + + discount: Optional[PriceOverrideOverrideGroupedWithProratedMinimumPriceDiscount] + """The subscription's override discount for the plan.""" + + fixed_price_quantity: Optional[float] + """The starting quantity of the price, if the price is a fixed price.""" + + maximum_amount: Optional[str] + """The subscription's override maximum amount for the plan.""" + + minimum_amount: Optional[str] + """The subscription's override minimum amount for the plan.""" + + class PriceOverrideOverrideBulkWithProrationPriceDiscount(TypedDict, total=False): discount_type: Required[Literal["percentage", "trial", "usage", "amount"]] @@ -1104,5 +1184,6 @@ class PriceOverrideOverrideBulkWithProrationPrice(TypedDict, total=False): PriceOverrideOverridePackageWithAllocationPrice, PriceOverrideOverrideUnitWithPercentPrice, PriceOverrideOverrideGroupedAllocationPrice, + PriceOverrideOverrideGroupedWithProratedMinimumPrice, PriceOverrideOverrideBulkWithProrationPrice, ] diff --git a/src/orb/types/subscription_trigger_phase_params.py b/src/orb/types/subscription_trigger_phase_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_params.py b/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription_update_fixed_fee_quantity_params.py b/src/orb/types/subscription_update_fixed_fee_quantity_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription_update_params.py b/src/orb/types/subscription_update_params.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscription_usage.py b/src/orb/types/subscription_usage.py old mode 100755 new mode 100644 diff --git a/src/orb/types/subscriptions.py b/src/orb/types/subscriptions.py old mode 100755 new mode 100644 diff --git a/src/orb/types/top_level_ping_response.py b/src/orb/types/top_level_ping_response.py old mode 100755 new mode 100644 diff --git a/tests/__init__.py b/tests/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/__init__.py b/tests/api_resources/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/coupons/__init__.py b/tests/api_resources/coupons/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/coupons/test_subscriptions.py b/tests/api_resources/coupons/test_subscriptions.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/customers/__init__.py b/tests/api_resources/customers/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/customers/credits/__init__.py b/tests/api_resources/customers/credits/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/customers/credits/test_ledger.py b/tests/api_resources/customers/credits/test_ledger.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/customers/credits/test_top_ups.py b/tests/api_resources/customers/credits/test_top_ups.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/customers/test_balance_transactions.py b/tests/api_resources/customers/test_balance_transactions.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/customers/test_costs.py b/tests/api_resources/customers/test_costs.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/customers/test_credits.py b/tests/api_resources/customers/test_credits.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/events/__init__.py b/tests/api_resources/events/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/events/test_backfills.py b/tests/api_resources/events/test_backfills.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/plans/__init__.py b/tests/api_resources/plans/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/plans/test_external_plan_id.py b/tests/api_resources/plans/test_external_plan_id.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/prices/__init__.py b/tests/api_resources/prices/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/prices/test_external_price_id.py b/tests/api_resources/prices/test_external_price_id.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_alerts.py b/tests/api_resources/test_alerts.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_coupons.py b/tests/api_resources/test_coupons.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_credit_notes.py b/tests/api_resources/test_credit_notes.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_invoice_line_items.py b/tests/api_resources/test_invoice_line_items.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_items.py b/tests/api_resources/test_items.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_metrics.py b/tests/api_resources/test_metrics.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_plans.py b/tests/api_resources/test_plans.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py old mode 100755 new mode 100644 index 9ea8a7f4..dbfd062f --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -1746,6 +1746,79 @@ def test_streaming_response_create_overload_19(self, client: Orb) -> None: @parametrize def test_method_create_overload_20(self, client: Orb) -> None: + price = client.prices.create( + cadence="annual", + currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_with_prorated_minimum", + name="Annual fee", + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: + price = client.prices.create( + cadence="annual", + currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_with_prorated_minimum", + name="Annual fee", + billable_metric_id="billable_metric_id", + billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, + conversion_rate=0, + external_price_id="external_price_id", + fixed_price_quantity=0, + invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, + metadata={"foo": "string"}, + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + def test_raw_response_create_overload_20(self, client: Orb) -> None: + response = client.prices.with_raw_response.create( + cadence="annual", + currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_with_prorated_minimum", + name="Annual fee", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_20(self, client: Orb) -> None: + with client.prices.with_streaming_response.create( + cadence="annual", + currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_with_prorated_minimum", + name="Annual fee", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_overload_21(self, client: Orb) -> None: price = client.prices.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -1757,7 +1830,7 @@ def test_method_create_overload_20(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_21(self, client: Orb) -> None: price = client.prices.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -1784,7 +1857,7 @@ def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_20(self, client: Orb) -> None: + def test_raw_response_create_overload_21(self, client: Orb) -> None: response = client.prices.with_raw_response.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -1800,7 +1873,7 @@ def test_raw_response_create_overload_20(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_20(self, client: Orb) -> None: + def test_streaming_response_create_overload_21(self, client: Orb) -> None: with client.prices.with_streaming_response.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -3721,6 +3794,79 @@ async def test_streaming_response_create_overload_19(self, async_client: AsyncOr @parametrize async def test_method_create_overload_20(self, async_client: AsyncOrb) -> None: + price = await async_client.prices.create( + cadence="annual", + currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_with_prorated_minimum", + name="Annual fee", + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_20(self, async_client: AsyncOrb) -> None: + price = await async_client.prices.create( + cadence="annual", + currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_with_prorated_minimum", + name="Annual fee", + billable_metric_id="billable_metric_id", + billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, + conversion_rate=0, + external_price_id="external_price_id", + fixed_price_quantity=0, + invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, + metadata={"foo": "string"}, + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_20(self, async_client: AsyncOrb) -> None: + response = await async_client.prices.with_raw_response.create( + cadence="annual", + currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_with_prorated_minimum", + name="Annual fee", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_20(self, async_client: AsyncOrb) -> None: + async with async_client.prices.with_streaming_response.create( + cadence="annual", + currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_with_prorated_minimum", + name="Annual fee", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = await response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_21(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -3732,7 +3878,7 @@ async def test_method_create_overload_20(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_20(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_21(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -3759,7 +3905,7 @@ async def test_method_create_with_all_params_overload_20(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_20(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_21(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -3775,7 +3921,7 @@ async def test_raw_response_create_overload_20(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_20(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_21(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py old mode 100755 new mode 100644 index 1a2d6603..61fcc04f --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -49,8 +49,8 @@ def test_method_create_with_all_params(self, client: Orb) -> None: external_marketplace="google", external_marketplace_reporting_id="external_marketplace_reporting_id", external_plan_id="ZMwNQefe7J3ecf7W", - initial_phase_order=0, - invoicing_threshold="invoicing_threshold", + initial_phase_order=2, + invoicing_threshold="10.00", metadata={"foo": "string"}, net_terms=0, per_credit_overage_amount=0, @@ -843,13 +843,16 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: subscription_id="subscription_id", change_option="requested_date", align_billing_with_plan_change_date=True, + auto_collection=True, billing_cycle_alignment="unchanged", change_date=parse_datetime("2017-07-21T17:32:28Z"), coupon_redemption_code="coupon_redemption_code", credits_overage_rate=0, + default_invoice_memo="default_invoice_memo", external_plan_id="ZMwNQefe7J3ecf7W", initial_phase_order=2, invoicing_threshold="10.00", + net_terms=0, per_credit_overage_amount=0, plan_id="ZMwNQefe7J3ecf7W", price_overrides=[ @@ -1195,8 +1198,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No external_marketplace="google", external_marketplace_reporting_id="external_marketplace_reporting_id", external_plan_id="ZMwNQefe7J3ecf7W", - initial_phase_order=0, - invoicing_threshold="invoicing_threshold", + initial_phase_order=2, + invoicing_threshold="10.00", metadata={"foo": "string"}, net_terms=0, per_credit_overage_amount=0, @@ -1989,13 +1992,16 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A subscription_id="subscription_id", change_option="requested_date", align_billing_with_plan_change_date=True, + auto_collection=True, billing_cycle_alignment="unchanged", change_date=parse_datetime("2017-07-21T17:32:28Z"), coupon_redemption_code="coupon_redemption_code", credits_overage_rate=0, + default_invoice_memo="default_invoice_memo", external_plan_id="ZMwNQefe7J3ecf7W", initial_phase_order=2, invoicing_threshold="10.00", + net_terms=0, per_credit_overage_amount=0, plan_id="ZMwNQefe7J3ecf7W", price_overrides=[ diff --git a/tests/api_resources/test_top_level.py b/tests/api_resources/test_top_level.py old mode 100755 new mode 100644 diff --git a/tests/conftest.py b/tests/conftest.py old mode 100755 new mode 100644 diff --git a/tests/sample_file.txt b/tests/sample_file.txt old mode 100755 new mode 100644 diff --git a/tests/test_client.py b/tests/test_client.py old mode 100755 new mode 100644 diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py old mode 100755 new mode 100644 diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py old mode 100755 new mode 100644 diff --git a/tests/test_files.py b/tests/test_files.py old mode 100755 new mode 100644 diff --git a/tests/test_legacy_response.py b/tests/test_legacy_response.py old mode 100755 new mode 100644 diff --git a/tests/test_models.py b/tests/test_models.py old mode 100755 new mode 100644 diff --git a/tests/test_qs.py b/tests/test_qs.py old mode 100755 new mode 100644 diff --git a/tests/test_required_args.py b/tests/test_required_args.py old mode 100755 new mode 100644 diff --git a/tests/test_response.py b/tests/test_response.py old mode 100755 new mode 100644 diff --git a/tests/test_streaming.py b/tests/test_streaming.py old mode 100755 new mode 100644 diff --git a/tests/test_transform.py b/tests/test_transform.py old mode 100755 new mode 100644 diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py old mode 100755 new mode 100644 diff --git a/tests/test_utils/test_typing.py b/tests/test_utils/test_typing.py old mode 100755 new mode 100644 diff --git a/tests/utils.py b/tests/utils.py old mode 100755 new mode 100644