Skip to content

Commit 4068313

Browse files
stainless-app[bot]Stainless Bot
authored and
Stainless Bot
committed
feat(api): OpenAPI spec update via Stainless API (#371)
1 parent ce1e415 commit 4068313

9 files changed

+835
-7
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 93
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-90a52a59bc88bb7c8ae95cd1f8d2e0d69e48320d5481068fe1fbc54f539fd8db.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-3a9214e6a8bf5952997fd2a3b6521804ab82d2cff40ed2ecb3b3cb512fe3bf35.yml

src/orb/resources/prices/prices.py

+192
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,98 @@ def create(
17661766
"""
17671767
...
17681768

1769+
@overload
1770+
def create(
1771+
self,
1772+
*,
1773+
cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"],
1774+
currency: str,
1775+
grouped_with_prorated_minimum_config: Dict[str, object],
1776+
item_id: str,
1777+
model_type: Literal["grouped_with_prorated_minimum"],
1778+
name: str,
1779+
billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN,
1780+
billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN,
1781+
billing_cycle_configuration: Optional[
1782+
price_create_params.NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration
1783+
]
1784+
| NotGiven = NOT_GIVEN,
1785+
conversion_rate: Optional[float] | NotGiven = NOT_GIVEN,
1786+
external_price_id: Optional[str] | NotGiven = NOT_GIVEN,
1787+
fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN,
1788+
invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN,
1789+
invoicing_cycle_configuration: Optional[
1790+
price_create_params.NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration
1791+
]
1792+
| NotGiven = NOT_GIVEN,
1793+
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
1794+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1795+
# The extra values given here take precedence over values defined on the client or passed to this method.
1796+
extra_headers: Headers | None = None,
1797+
extra_query: Query | None = None,
1798+
extra_body: Body | None = None,
1799+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1800+
idempotency_key: str | None = None,
1801+
) -> Price:
1802+
"""This endpoint is used to create a [price](../reference/price).
1803+
1804+
A price created
1805+
using this endpoint is always an add-on, meaning that it’s not associated with a
1806+
specific plan and can instead be individually added to subscriptions, including
1807+
subscriptions on different plans.
1808+
1809+
An `external_price_id` can be optionally specified as an alias to allow
1810+
ergonomic interaction with prices in the Orb API.
1811+
1812+
See the [Price resource](../reference/price) for the specification of different
1813+
price model configurations possible in this endpoint.
1814+
1815+
Args:
1816+
cadence: The cadence to bill for this price on.
1817+
1818+
currency: An ISO 4217 currency string for which this price is billed in.
1819+
1820+
item_id: The id of the item the plan will be associated with.
1821+
1822+
name: The name of the price.
1823+
1824+
billable_metric_id: The id of the billable metric for the price. Only needed if the price is
1825+
usage-based.
1826+
1827+
billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if
1828+
this is true, and in-arrears if this is false.
1829+
1830+
billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or
1831+
months.
1832+
1833+
conversion_rate: The per unit conversion rate of the price currency to the invoicing currency.
1834+
1835+
external_price_id: An alias for the price.
1836+
1837+
fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units
1838+
applied.
1839+
1840+
invoice_grouping_key: The property used to group this price on an invoice
1841+
1842+
invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced.
1843+
If unspecified, a single invoice is produced per billing cycle.
1844+
1845+
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
1846+
by setting the value to `null`, and the entire metadata mapping can be cleared
1847+
by setting `metadata` to `null`.
1848+
1849+
extra_headers: Send extra headers
1850+
1851+
extra_query: Add additional query parameters to the request
1852+
1853+
extra_body: Add additional JSON properties to the request
1854+
1855+
timeout: Override the client-level default timeout for this request, in seconds
1856+
1857+
idempotency_key: Specify a custom idempotency key for this request
1858+
"""
1859+
...
1860+
17691861
@overload
17701862
def create(
17711863
self,
@@ -1878,6 +1970,7 @@ def create(
18781970
["cadence", "currency", "item_id", "model_type", "name", "tiered_with_proration_config"],
18791971
["cadence", "currency", "item_id", "model_type", "name", "unit_with_proration_config"],
18801972
["cadence", "currency", "grouped_allocation_config", "item_id", "model_type", "name"],
1973+
["cadence", "currency", "grouped_with_prorated_minimum_config", "item_id", "model_type", "name"],
18811974
["bulk_with_proration_config", "cadence", "currency", "item_id", "model_type", "name"],
18821975
)
18831976
def create(
@@ -1905,6 +1998,7 @@ def create(
19051998
| Literal["tiered_with_proration"]
19061999
| Literal["unit_with_proration"]
19072000
| Literal["grouped_allocation"]
2001+
| Literal["grouped_with_prorated_minimum"]
19082002
| Literal["bulk_with_proration"],
19092003
name: str,
19102004
unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN,
@@ -1938,6 +2032,7 @@ def create(
19382032
tiered_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN,
19392033
unit_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN,
19402034
grouped_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN,
2035+
grouped_with_prorated_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN,
19412036
bulk_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN,
19422037
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
19432038
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1986,6 +2081,7 @@ def create(
19862081
"tiered_with_proration_config": tiered_with_proration_config,
19872082
"unit_with_proration_config": unit_with_proration_config,
19882083
"grouped_allocation_config": grouped_allocation_config,
2084+
"grouped_with_prorated_minimum_config": grouped_with_prorated_minimum_config,
19892085
"bulk_with_proration_config": bulk_with_proration_config,
19902086
},
19912087
price_create_params.PriceCreateParams,
@@ -3963,6 +4059,98 @@ async def create(
39634059
"""
39644060
...
39654061

4062+
@overload
4063+
async def create(
4064+
self,
4065+
*,
4066+
cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"],
4067+
currency: str,
4068+
grouped_with_prorated_minimum_config: Dict[str, object],
4069+
item_id: str,
4070+
model_type: Literal["grouped_with_prorated_minimum"],
4071+
name: str,
4072+
billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN,
4073+
billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN,
4074+
billing_cycle_configuration: Optional[
4075+
price_create_params.NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration
4076+
]
4077+
| NotGiven = NOT_GIVEN,
4078+
conversion_rate: Optional[float] | NotGiven = NOT_GIVEN,
4079+
external_price_id: Optional[str] | NotGiven = NOT_GIVEN,
4080+
fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN,
4081+
invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN,
4082+
invoicing_cycle_configuration: Optional[
4083+
price_create_params.NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration
4084+
]
4085+
| NotGiven = NOT_GIVEN,
4086+
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
4087+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4088+
# The extra values given here take precedence over values defined on the client or passed to this method.
4089+
extra_headers: Headers | None = None,
4090+
extra_query: Query | None = None,
4091+
extra_body: Body | None = None,
4092+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
4093+
idempotency_key: str | None = None,
4094+
) -> Price:
4095+
"""This endpoint is used to create a [price](../reference/price).
4096+
4097+
A price created
4098+
using this endpoint is always an add-on, meaning that it’s not associated with a
4099+
specific plan and can instead be individually added to subscriptions, including
4100+
subscriptions on different plans.
4101+
4102+
An `external_price_id` can be optionally specified as an alias to allow
4103+
ergonomic interaction with prices in the Orb API.
4104+
4105+
See the [Price resource](../reference/price) for the specification of different
4106+
price model configurations possible in this endpoint.
4107+
4108+
Args:
4109+
cadence: The cadence to bill for this price on.
4110+
4111+
currency: An ISO 4217 currency string for which this price is billed in.
4112+
4113+
item_id: The id of the item the plan will be associated with.
4114+
4115+
name: The name of the price.
4116+
4117+
billable_metric_id: The id of the billable metric for the price. Only needed if the price is
4118+
usage-based.
4119+
4120+
billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if
4121+
this is true, and in-arrears if this is false.
4122+
4123+
billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or
4124+
months.
4125+
4126+
conversion_rate: The per unit conversion rate of the price currency to the invoicing currency.
4127+
4128+
external_price_id: An alias for the price.
4129+
4130+
fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units
4131+
applied.
4132+
4133+
invoice_grouping_key: The property used to group this price on an invoice
4134+
4135+
invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced.
4136+
If unspecified, a single invoice is produced per billing cycle.
4137+
4138+
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
4139+
by setting the value to `null`, and the entire metadata mapping can be cleared
4140+
by setting `metadata` to `null`.
4141+
4142+
extra_headers: Send extra headers
4143+
4144+
extra_query: Add additional query parameters to the request
4145+
4146+
extra_body: Add additional JSON properties to the request
4147+
4148+
timeout: Override the client-level default timeout for this request, in seconds
4149+
4150+
idempotency_key: Specify a custom idempotency key for this request
4151+
"""
4152+
...
4153+
39664154
@overload
39674155
async def create(
39684156
self,
@@ -4075,6 +4263,7 @@ async def create(
40754263
["cadence", "currency", "item_id", "model_type", "name", "tiered_with_proration_config"],
40764264
["cadence", "currency", "item_id", "model_type", "name", "unit_with_proration_config"],
40774265
["cadence", "currency", "grouped_allocation_config", "item_id", "model_type", "name"],
4266+
["cadence", "currency", "grouped_with_prorated_minimum_config", "item_id", "model_type", "name"],
40784267
["bulk_with_proration_config", "cadence", "currency", "item_id", "model_type", "name"],
40794268
)
40804269
async def create(
@@ -4102,6 +4291,7 @@ async def create(
41024291
| Literal["tiered_with_proration"]
41034292
| Literal["unit_with_proration"]
41044293
| Literal["grouped_allocation"]
4294+
| Literal["grouped_with_prorated_minimum"]
41054295
| Literal["bulk_with_proration"],
41064296
name: str,
41074297
unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN,
@@ -4135,6 +4325,7 @@ async def create(
41354325
tiered_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN,
41364326
unit_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN,
41374327
grouped_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN,
4328+
grouped_with_prorated_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN,
41384329
bulk_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN,
41394330
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
41404331
# 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(
41834374
"tiered_with_proration_config": tiered_with_proration_config,
41844375
"unit_with_proration_config": unit_with_proration_config,
41854376
"grouped_allocation_config": grouped_allocation_config,
4377+
"grouped_with_prorated_minimum_config": grouped_with_prorated_minimum_config,
41864378
"bulk_with_proration_config": bulk_with_proration_config,
41874379
},
41884380
price_create_params.PriceCreateParams,

src/orb/types/plan_create_params.py

+87
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
"PriceNewPlanGroupedAllocationPrice",
7070
"PriceNewPlanGroupedAllocationPriceBillingCycleConfiguration",
7171
"PriceNewPlanGroupedAllocationPriceInvoicingCycleConfiguration",
72+
"PriceNewPlanGroupedWithProratedMinimumPrice",
73+
"PriceNewPlanGroupedWithProratedMinimumPriceBillingCycleConfiguration",
74+
"PriceNewPlanGroupedWithProratedMinimumPriceInvoicingCycleConfiguration",
7275
"PriceNewPlanBulkWithProrationPrice",
7376
"PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration",
7477
"PriceNewPlanBulkWithProrationPriceInvoicingCycleConfiguration",
@@ -1564,6 +1567,89 @@ class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False):
15641567
"""
15651568

15661569

1570+
class PriceNewPlanGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False):
1571+
duration: Required[int]
1572+
"""The duration of the billing period."""
1573+
1574+
duration_unit: Required[Literal["day", "month"]]
1575+
"""The unit of billing period duration."""
1576+
1577+
1578+
class PriceNewPlanGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False):
1579+
duration: Required[int]
1580+
"""The duration of the billing period."""
1581+
1582+
duration_unit: Required[Literal["day", "month"]]
1583+
"""The unit of billing period duration."""
1584+
1585+
1586+
class PriceNewPlanGroupedWithProratedMinimumPrice(TypedDict, total=False):
1587+
cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]]
1588+
"""The cadence to bill for this price on."""
1589+
1590+
grouped_with_prorated_minimum_config: Required[Dict[str, object]]
1591+
1592+
item_id: Required[str]
1593+
"""The id of the item the plan will be associated with."""
1594+
1595+
model_type: Required[Literal["grouped_with_prorated_minimum"]]
1596+
1597+
name: Required[str]
1598+
"""The name of the price."""
1599+
1600+
billable_metric_id: Optional[str]
1601+
"""The id of the billable metric for the price.
1602+
1603+
Only needed if the price is usage-based.
1604+
"""
1605+
1606+
billed_in_advance: Optional[bool]
1607+
"""
1608+
If the Price represents a fixed cost, the price will be billed in-advance if
1609+
this is true, and in-arrears if this is false.
1610+
"""
1611+
1612+
billing_cycle_configuration: Optional[PriceNewPlanGroupedWithProratedMinimumPriceBillingCycleConfiguration]
1613+
"""
1614+
For custom cadence: specifies the duration of the billing period in days or
1615+
months.
1616+
"""
1617+
1618+
conversion_rate: Optional[float]
1619+
"""The per unit conversion rate of the price currency to the invoicing currency."""
1620+
1621+
currency: Optional[str]
1622+
"""
1623+
An ISO 4217 currency string, or custom pricing unit identifier, in which this
1624+
price is billed.
1625+
"""
1626+
1627+
external_price_id: Optional[str]
1628+
"""An alias for the price."""
1629+
1630+
fixed_price_quantity: Optional[float]
1631+
"""
1632+
If the Price represents a fixed cost, this represents the quantity of units
1633+
applied.
1634+
"""
1635+
1636+
invoice_grouping_key: Optional[str]
1637+
"""The property used to group this price on an invoice"""
1638+
1639+
invoicing_cycle_configuration: Optional[PriceNewPlanGroupedWithProratedMinimumPriceInvoicingCycleConfiguration]
1640+
"""Within each billing cycle, specifies the cadence at which invoices are produced.
1641+
1642+
If unspecified, a single invoice is produced per billing cycle.
1643+
"""
1644+
1645+
metadata: Optional[Dict[str, Optional[str]]]
1646+
"""User-specified key/value pairs for the resource.
1647+
1648+
Individual keys can be removed by setting the value to `null`, and the entire
1649+
metadata mapping can be cleared by setting `metadata` to `null`.
1650+
"""
1651+
1652+
15671653
class PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False):
15681654
duration: Required[int]
15691655
"""The duration of the billing period."""
@@ -1664,5 +1750,6 @@ class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False):
16641750
PriceNewPlanTierWithProrationPrice,
16651751
PriceNewPlanUnitWithProrationPrice,
16661752
PriceNewPlanGroupedAllocationPrice,
1753+
PriceNewPlanGroupedWithProratedMinimumPrice,
16671754
PriceNewPlanBulkWithProrationPrice,
16681755
]

0 commit comments

Comments
 (0)