Skip to content

Commit 3761058

Browse files
feat(api): OpenAPI spec update via Stainless API (#371)
1 parent 377e7ec commit 3761058

File tree

7 files changed

+559
-1
lines changed

7 files changed

+559
-1
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 184 additions & 0 deletions
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,
@@ -3967,6 +4059,98 @@ async def create(
39674059
"""
39684060
...
39694061

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+
39704154
@overload
39714155
async def create(
39724156
self,

src/orb/types/plan_create_params.py

Lines changed: 86 additions & 0 deletions
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."""

src/orb/types/price_create_params.py

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@
7979
"NewFloatingGroupedAllocationPrice",
8080
"NewFloatingGroupedAllocationPriceBillingCycleConfiguration",
8181
"NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration",
82+
"NewFloatingGroupedWithProratedMinimumPrice",
83+
"NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration",
84+
"NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration",
8285
"NewFloatingBulkWithProrationPrice",
8386
"NewFloatingBulkWithProrationPriceBillingCycleConfiguration",
8487
"NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration",
@@ -1749,6 +1752,86 @@ class NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, to
17491752
"""The unit of billing period duration."""
17501753

17511754

1755+
class NewFloatingGroupedWithProratedMinimumPrice(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+
currency: Required[str]
1760+
"""An ISO 4217 currency string for which this price is billed in."""
1761+
1762+
grouped_with_prorated_minimum_config: Required[Dict[str, object]]
1763+
1764+
item_id: Required[str]
1765+
"""The id of the item the plan will be associated with."""
1766+
1767+
model_type: Required[Literal["grouped_with_prorated_minimum"]]
1768+
1769+
name: Required[str]
1770+
"""The name of the price."""
1771+
1772+
billable_metric_id: Optional[str]
1773+
"""The id of the billable metric for the price.
1774+
1775+
Only needed if the price is usage-based.
1776+
"""
1777+
1778+
billed_in_advance: Optional[bool]
1779+
"""
1780+
If the Price represents a fixed cost, the price will be billed in-advance if
1781+
this is true, and in-arrears if this is false.
1782+
"""
1783+
1784+
billing_cycle_configuration: Optional[NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration]
1785+
"""
1786+
For custom cadence: specifies the duration of the billing period in days or
1787+
months.
1788+
"""
1789+
1790+
conversion_rate: Optional[float]
1791+
"""The per unit conversion rate of the price currency to the invoicing currency."""
1792+
1793+
external_price_id: Optional[str]
1794+
"""An alias for the price."""
1795+
1796+
fixed_price_quantity: Optional[float]
1797+
"""
1798+
If the Price represents a fixed cost, this represents the quantity of units
1799+
applied.
1800+
"""
1801+
1802+
invoice_grouping_key: Optional[str]
1803+
"""The property used to group this price on an invoice"""
1804+
1805+
invoicing_cycle_configuration: Optional[NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration]
1806+
"""Within each billing cycle, specifies the cadence at which invoices are produced.
1807+
1808+
If unspecified, a single invoice is produced per billing cycle.
1809+
"""
1810+
1811+
metadata: Optional[Dict[str, Optional[str]]]
1812+
"""User-specified key/value pairs for the resource.
1813+
1814+
Individual keys can be removed by setting the value to `null`, and the entire
1815+
metadata mapping can be cleared by setting `metadata` to `null`.
1816+
"""
1817+
1818+
1819+
class NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False):
1820+
duration: Required[int]
1821+
"""The duration of the billing period."""
1822+
1823+
duration_unit: Required[Literal["day", "month"]]
1824+
"""The unit of billing period duration."""
1825+
1826+
1827+
class NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False):
1828+
duration: Required[int]
1829+
"""The duration of the billing period."""
1830+
1831+
duration_unit: Required[Literal["day", "month"]]
1832+
"""The unit of billing period duration."""
1833+
1834+
17521835
class NewFloatingBulkWithProrationPrice(TypedDict, total=False):
17531836
bulk_with_proration_config: Required[Dict[str, object]]
17541837

0 commit comments

Comments
 (0)