Skip to content

Commit 1fa5e75

Browse files
author
Stainless Bot
committed
feat(api): api update (#423)
1 parent dccc28e commit 1fa5e75

File tree

7 files changed

+714
-4
lines changed

7 files changed

+714
-4
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 93
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4df283466fdce46e787565c6480138896b1d7ed98d68a79d5eb3438bed191276.yml
1+
configured_endpoints: 96
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-1345a8e288e34d5477b0e189877225f83939a59078c22fbb5367712e376c5d19.yml

src/orb/resources/prices/prices.py

+198-2
Original file line numberDiff line numberDiff line change
@@ -1950,6 +1950,98 @@ def create(
19501950
"""
19511951
...
19521952

1953+
@overload
1954+
def create(
1955+
self,
1956+
*,
1957+
cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"],
1958+
currency: str,
1959+
grouped_tiered_package_config: Dict[str, object],
1960+
item_id: str,
1961+
model_type: Literal["grouped_tiered_package"],
1962+
name: str,
1963+
billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN,
1964+
billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN,
1965+
billing_cycle_configuration: Optional[
1966+
price_create_params.NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration
1967+
]
1968+
| NotGiven = NOT_GIVEN,
1969+
conversion_rate: Optional[float] | NotGiven = NOT_GIVEN,
1970+
external_price_id: Optional[str] | NotGiven = NOT_GIVEN,
1971+
fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN,
1972+
invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN,
1973+
invoicing_cycle_configuration: Optional[
1974+
price_create_params.NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration
1975+
]
1976+
| NotGiven = NOT_GIVEN,
1977+
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
1978+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1979+
# The extra values given here take precedence over values defined on the client or passed to this method.
1980+
extra_headers: Headers | None = None,
1981+
extra_query: Query | None = None,
1982+
extra_body: Body | None = None,
1983+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1984+
idempotency_key: str | None = None,
1985+
) -> Price:
1986+
"""This endpoint is used to create a [price](../reference/price).
1987+
1988+
A price created
1989+
using this endpoint is always an add-on, meaning that it’s not associated with a
1990+
specific plan and can instead be individually added to subscriptions, including
1991+
subscriptions on different plans.
1992+
1993+
An `external_price_id` can be optionally specified as an alias to allow
1994+
ergonomic interaction with prices in the Orb API.
1995+
1996+
See the [Price resource](../reference/price) for the specification of different
1997+
price model configurations possible in this endpoint.
1998+
1999+
Args:
2000+
cadence: The cadence to bill for this price on.
2001+
2002+
currency: An ISO 4217 currency string for which this price is billed in.
2003+
2004+
item_id: The id of the item the plan will be associated with.
2005+
2006+
name: The name of the price.
2007+
2008+
billable_metric_id: The id of the billable metric for the price. Only needed if the price is
2009+
usage-based.
2010+
2011+
billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if
2012+
this is true, and in-arrears if this is false.
2013+
2014+
billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or
2015+
months.
2016+
2017+
conversion_rate: The per unit conversion rate of the price currency to the invoicing currency.
2018+
2019+
external_price_id: An alias for the price.
2020+
2021+
fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units
2022+
applied.
2023+
2024+
invoice_grouping_key: The property used to group this price on an invoice
2025+
2026+
invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced.
2027+
If unspecified, a single invoice is produced per billing cycle.
2028+
2029+
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
2030+
by setting the value to `null`, and the entire metadata mapping can be cleared
2031+
by setting `metadata` to `null`.
2032+
2033+
extra_headers: Send extra headers
2034+
2035+
extra_query: Add additional query parameters to the request
2036+
2037+
extra_body: Add additional JSON properties to the request
2038+
2039+
timeout: Override the client-level default timeout for this request, in seconds
2040+
2041+
idempotency_key: Specify a custom idempotency key for this request
2042+
"""
2043+
...
2044+
19532045
@required_args(
19542046
["cadence", "currency", "item_id", "model_type", "name", "unit_config"],
19552047
["cadence", "currency", "item_id", "model_type", "name", "package_config"],
@@ -1972,6 +2064,7 @@ def create(
19722064
["cadence", "currency", "grouped_allocation_config", "item_id", "model_type", "name"],
19732065
["cadence", "currency", "grouped_with_prorated_minimum_config", "item_id", "model_type", "name"],
19742066
["bulk_with_proration_config", "cadence", "currency", "item_id", "model_type", "name"],
2067+
["cadence", "currency", "grouped_tiered_package_config", "item_id", "model_type", "name"],
19752068
)
19762069
def create(
19772070
self,
@@ -1999,7 +2092,10 @@ def create(
19992092
| Literal["unit_with_proration"]
20002093
| Literal["grouped_allocation"]
20012094
| Literal["grouped_with_prorated_minimum"]
2002-
| Literal["bulk_with_proration"],
2095+
| Literal["grouped_with_metered_minimum"]
2096+
| Literal["matrix_with_display_name"]
2097+
| Literal["bulk_with_proration"]
2098+
| Literal["grouped_tiered_package"],
20032099
name: str,
20042100
unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN,
20052101
billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN,
@@ -2034,6 +2130,7 @@ def create(
20342130
grouped_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN,
20352131
grouped_with_prorated_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN,
20362132
bulk_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN,
2133+
grouped_tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN,
20372134
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
20382135
# The extra values given here take precedence over values defined on the client or passed to this method.
20392136
extra_headers: Headers | None = None,
@@ -2083,6 +2180,7 @@ def create(
20832180
"grouped_allocation_config": grouped_allocation_config,
20842181
"grouped_with_prorated_minimum_config": grouped_with_prorated_minimum_config,
20852182
"bulk_with_proration_config": bulk_with_proration_config,
2183+
"grouped_tiered_package_config": grouped_tiered_package_config,
20862184
},
20872185
price_create_params.PriceCreateParams,
20882186
),
@@ -4243,6 +4341,98 @@ async def create(
42434341
"""
42444342
...
42454343

4344+
@overload
4345+
async def create(
4346+
self,
4347+
*,
4348+
cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"],
4349+
currency: str,
4350+
grouped_tiered_package_config: Dict[str, object],
4351+
item_id: str,
4352+
model_type: Literal["grouped_tiered_package"],
4353+
name: str,
4354+
billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN,
4355+
billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN,
4356+
billing_cycle_configuration: Optional[
4357+
price_create_params.NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration
4358+
]
4359+
| NotGiven = NOT_GIVEN,
4360+
conversion_rate: Optional[float] | NotGiven = NOT_GIVEN,
4361+
external_price_id: Optional[str] | NotGiven = NOT_GIVEN,
4362+
fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN,
4363+
invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN,
4364+
invoicing_cycle_configuration: Optional[
4365+
price_create_params.NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration
4366+
]
4367+
| NotGiven = NOT_GIVEN,
4368+
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
4369+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4370+
# The extra values given here take precedence over values defined on the client or passed to this method.
4371+
extra_headers: Headers | None = None,
4372+
extra_query: Query | None = None,
4373+
extra_body: Body | None = None,
4374+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
4375+
idempotency_key: str | None = None,
4376+
) -> Price:
4377+
"""This endpoint is used to create a [price](../reference/price).
4378+
4379+
A price created
4380+
using this endpoint is always an add-on, meaning that it’s not associated with a
4381+
specific plan and can instead be individually added to subscriptions, including
4382+
subscriptions on different plans.
4383+
4384+
An `external_price_id` can be optionally specified as an alias to allow
4385+
ergonomic interaction with prices in the Orb API.
4386+
4387+
See the [Price resource](../reference/price) for the specification of different
4388+
price model configurations possible in this endpoint.
4389+
4390+
Args:
4391+
cadence: The cadence to bill for this price on.
4392+
4393+
currency: An ISO 4217 currency string for which this price is billed in.
4394+
4395+
item_id: The id of the item the plan will be associated with.
4396+
4397+
name: The name of the price.
4398+
4399+
billable_metric_id: The id of the billable metric for the price. Only needed if the price is
4400+
usage-based.
4401+
4402+
billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if
4403+
this is true, and in-arrears if this is false.
4404+
4405+
billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or
4406+
months.
4407+
4408+
conversion_rate: The per unit conversion rate of the price currency to the invoicing currency.
4409+
4410+
external_price_id: An alias for the price.
4411+
4412+
fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units
4413+
applied.
4414+
4415+
invoice_grouping_key: The property used to group this price on an invoice
4416+
4417+
invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced.
4418+
If unspecified, a single invoice is produced per billing cycle.
4419+
4420+
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
4421+
by setting the value to `null`, and the entire metadata mapping can be cleared
4422+
by setting `metadata` to `null`.
4423+
4424+
extra_headers: Send extra headers
4425+
4426+
extra_query: Add additional query parameters to the request
4427+
4428+
extra_body: Add additional JSON properties to the request
4429+
4430+
timeout: Override the client-level default timeout for this request, in seconds
4431+
4432+
idempotency_key: Specify a custom idempotency key for this request
4433+
"""
4434+
...
4435+
42464436
@required_args(
42474437
["cadence", "currency", "item_id", "model_type", "name", "unit_config"],
42484438
["cadence", "currency", "item_id", "model_type", "name", "package_config"],
@@ -4265,6 +4455,7 @@ async def create(
42654455
["cadence", "currency", "grouped_allocation_config", "item_id", "model_type", "name"],
42664456
["cadence", "currency", "grouped_with_prorated_minimum_config", "item_id", "model_type", "name"],
42674457
["bulk_with_proration_config", "cadence", "currency", "item_id", "model_type", "name"],
4458+
["cadence", "currency", "grouped_tiered_package_config", "item_id", "model_type", "name"],
42684459
)
42694460
async def create(
42704461
self,
@@ -4292,7 +4483,10 @@ async def create(
42924483
| Literal["unit_with_proration"]
42934484
| Literal["grouped_allocation"]
42944485
| Literal["grouped_with_prorated_minimum"]
4295-
| Literal["bulk_with_proration"],
4486+
| Literal["grouped_with_metered_minimum"]
4487+
| Literal["matrix_with_display_name"]
4488+
| Literal["bulk_with_proration"]
4489+
| Literal["grouped_tiered_package"],
42964490
name: str,
42974491
unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN,
42984492
billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN,
@@ -4327,6 +4521,7 @@ async def create(
43274521
grouped_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN,
43284522
grouped_with_prorated_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN,
43294523
bulk_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN,
4524+
grouped_tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN,
43304525
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
43314526
# The extra values given here take precedence over values defined on the client or passed to this method.
43324527
extra_headers: Headers | None = None,
@@ -4376,6 +4571,7 @@ async def create(
43764571
"grouped_allocation_config": grouped_allocation_config,
43774572
"grouped_with_prorated_minimum_config": grouped_with_prorated_minimum_config,
43784573
"bulk_with_proration_config": bulk_with_proration_config,
4574+
"grouped_tiered_package_config": grouped_tiered_package_config,
43794575
},
43804576
price_create_params.PriceCreateParams,
43814577
),

src/orb/types/plan_create_params.py

+87
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
"PriceNewPlanBulkWithProrationPrice",
7676
"PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration",
7777
"PriceNewPlanBulkWithProrationPriceInvoicingCycleConfiguration",
78+
"PriceNewPlanGroupedTieredPackagePrice",
79+
"PriceNewPlanGroupedTieredPackagePriceBillingCycleConfiguration",
80+
"PriceNewPlanGroupedTieredPackagePriceInvoicingCycleConfiguration",
7881
]
7982

8083

@@ -1733,6 +1736,89 @@ class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False):
17331736
"""
17341737

17351738

1739+
class PriceNewPlanGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False):
1740+
duration: Required[int]
1741+
"""The duration of the billing period."""
1742+
1743+
duration_unit: Required[Literal["day", "month"]]
1744+
"""The unit of billing period duration."""
1745+
1746+
1747+
class PriceNewPlanGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False):
1748+
duration: Required[int]
1749+
"""The duration of the billing period."""
1750+
1751+
duration_unit: Required[Literal["day", "month"]]
1752+
"""The unit of billing period duration."""
1753+
1754+
1755+
class PriceNewPlanGroupedTieredPackagePrice(TypedDict, total=False):
1756+
cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]]
1757+
"""The cadence to bill for this price on."""
1758+
1759+
grouped_tiered_package_config: Required[Dict[str, object]]
1760+
1761+
item_id: Required[str]
1762+
"""The id of the item the plan will be associated with."""
1763+
1764+
model_type: Required[Literal["grouped_tiered_package"]]
1765+
1766+
name: Required[str]
1767+
"""The name of the price."""
1768+
1769+
billable_metric_id: Optional[str]
1770+
"""The id of the billable metric for the price.
1771+
1772+
Only needed if the price is usage-based.
1773+
"""
1774+
1775+
billed_in_advance: Optional[bool]
1776+
"""
1777+
If the Price represents a fixed cost, the price will be billed in-advance if
1778+
this is true, and in-arrears if this is false.
1779+
"""
1780+
1781+
billing_cycle_configuration: Optional[PriceNewPlanGroupedTieredPackagePriceBillingCycleConfiguration]
1782+
"""
1783+
For custom cadence: specifies the duration of the billing period in days or
1784+
months.
1785+
"""
1786+
1787+
conversion_rate: Optional[float]
1788+
"""The per unit conversion rate of the price currency to the invoicing currency."""
1789+
1790+
currency: Optional[str]
1791+
"""
1792+
An ISO 4217 currency string, or custom pricing unit identifier, in which this
1793+
price is billed.
1794+
"""
1795+
1796+
external_price_id: Optional[str]
1797+
"""An alias for the price."""
1798+
1799+
fixed_price_quantity: Optional[float]
1800+
"""
1801+
If the Price represents a fixed cost, this represents the quantity of units
1802+
applied.
1803+
"""
1804+
1805+
invoice_grouping_key: Optional[str]
1806+
"""The property used to group this price on an invoice"""
1807+
1808+
invoicing_cycle_configuration: Optional[PriceNewPlanGroupedTieredPackagePriceInvoicingCycleConfiguration]
1809+
"""Within each billing cycle, specifies the cadence at which invoices are produced.
1810+
1811+
If unspecified, a single invoice is produced per billing cycle.
1812+
"""
1813+
1814+
metadata: Optional[Dict[str, Optional[str]]]
1815+
"""User-specified key/value pairs for the resource.
1816+
1817+
Individual keys can be removed by setting the value to `null`, and the entire
1818+
metadata mapping can be cleared by setting `metadata` to `null`.
1819+
"""
1820+
1821+
17361822
Price: TypeAlias = Union[
17371823
PriceNewPlanUnitPrice,
17381824
PriceNewPlanPackagePrice,
@@ -1752,4 +1838,5 @@ class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False):
17521838
PriceNewPlanGroupedAllocationPrice,
17531839
PriceNewPlanGroupedWithProratedMinimumPrice,
17541840
PriceNewPlanBulkWithProrationPrice,
1841+
PriceNewPlanGroupedTieredPackagePrice,
17551842
]

0 commit comments

Comments
 (0)