diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e6eadb43..58682893 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.13.0" + ".": "2.14.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 7bc0179f..0f0325a1 100644 --- 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-43ca3ef2601cc2b4dc4c5cfe217ed0b3e9a8fda04c3cd777ce8431427c5eb45a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4df283466fdce46e787565c6480138896b1d7ed98d68a79d5eb3438bed191276.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dc943f7..b051f17c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 2.14.0 (2024-11-06) + +Full Changelog: [v2.13.0...v2.14.0](https://github.com/orbcorp/orb-python/compare/v2.13.0...v2.14.0) + +### Features + +* **api:** OpenAPI spec update via Stainless API ([#369](https://github.com/orbcorp/orb-python/issues/369)) ([f09762a](https://github.com/orbcorp/orb-python/commit/f09762a6261fc5b351043411d0a334f206931cba)) +* **api:** OpenAPI spec update via Stainless API ([#370](https://github.com/orbcorp/orb-python/issues/370)) ([a8b582c](https://github.com/orbcorp/orb-python/commit/a8b582cfab2e2875ed402067510269b80429d828)) + ## 2.13.0 (2024-11-06) Full Changelog: [v2.12.0...v2.13.0](https://github.com/orbcorp/orb-python/compare/v2.12.0...v2.13.0) diff --git a/pyproject.toml b/pyproject.toml index 19271a93..5a37ce23 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "2.13.0" +version = "2.14.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/orb/_version.py b/src/orb/_version.py index 52b7b102..97f56a9d 100644 --- 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.13.0" # x-release-please-version +__version__ = "2.14.0" # x-release-please-version diff --git a/src/orb/resources/prices/prices.py b/src/orb/resources/prices/prices.py index 48505083..3adc451f 100644 --- 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, @@ -3967,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, diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index 33b04eab..e1cf3c36 100644 --- 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.""" diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index 5be83979..bf7f194e 100644 --- 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]] diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index 8c771760..1811ff2e 100644 --- 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."""