Skip to content

Commit 4e4268c

Browse files
feat(api): api update (#507)
1 parent dccab56 commit 4e4268c

11 files changed

+814
-102
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 101
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e480186cdd0e2cc631befa7e2c6ba5f2d7ae52052f0e79a748214f3ade8a98ee.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-7fca89ba5a0b4997358c25e6cdfb616a1d8b93a6820e25078f3fa5f61110bfe6.yml

src/orb/resources/customers/customers.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,9 @@ def delete(
616616
provided the customer does not have any issued invoices. Customers with issued
617617
invoices cannot be deleted. This operation is irreversible. Note that this is a
618618
_soft_ deletion, but the data will be inaccessible through the API and Orb
619-
dashboard. For a hard-deletion, please reach out to the Orb team directly.
619+
dashboard.
620+
621+
For a hard-deletion, please reach out to the Orb team directly.
620622
621623
**Note**: This operation happens asynchronously and can be expected to take a
622624
few minutes to propagate to related resources. However, querying for the
@@ -1514,7 +1516,9 @@ async def delete(
15141516
provided the customer does not have any issued invoices. Customers with issued
15151517
invoices cannot be deleted. This operation is irreversible. Note that this is a
15161518
_soft_ deletion, but the data will be inaccessible through the API and Orb
1517-
dashboard. For a hard-deletion, please reach out to the Orb team directly.
1519+
dashboard.
1520+
1521+
For a hard-deletion, please reach out to the Orb team directly.
15181522
15191523
**Note**: This operation happens asynchronously and can be expected to take a
15201524
few minutes to propagate to related resources. However, querying for the

src/orb/resources/events/backfills.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def create(
9898
affect all customers.
9999
100100
When `replace_existing_events` is `true`, this indicates that existing events in
101-
the timeframe should no longer be counter towards invoiced usage. In this
101+
the timeframe should no longer be counted towards invoiced usage. In this
102102
scenario, the parameter `filter` can be optionally added which enables filtering
103103
using
104104
[computed properties](/extensibility/advanced-metrics#computed-properties). The
@@ -410,7 +410,7 @@ async def create(
410410
affect all customers.
411411
412412
When `replace_existing_events` is `true`, this indicates that existing events in
413-
the timeframe should no longer be counter towards invoiced usage. In this
413+
the timeframe should no longer be counted towards invoiced usage. In this
414414
scenario, the parameter `filter` can be optionally added which enables filtering
415415
using
416416
[computed properties](/extensibility/advanced-metrics#computed-properties). The

src/orb/resources/prices/prices.py

+190
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,97 @@ def create(
11211121
"""
11221122
...
11231123

1124+
@overload
1125+
def create(
1126+
self,
1127+
*,
1128+
cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"],
1129+
currency: str,
1130+
item_id: str,
1131+
max_group_tiered_config: Dict[str, object],
1132+
model_type: Literal["max_group_tiered"],
1133+
name: str,
1134+
billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN,
1135+
billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN,
1136+
billing_cycle_configuration: Optional[
1137+
price_create_params.NewFloatingMaxGroupTieredPriceBillingCycleConfiguration
1138+
]
1139+
| NotGiven = NOT_GIVEN,
1140+
conversion_rate: Optional[float] | NotGiven = NOT_GIVEN,
1141+
external_price_id: Optional[str] | NotGiven = NOT_GIVEN,
1142+
fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN,
1143+
invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN,
1144+
invoicing_cycle_configuration: Optional[
1145+
price_create_params.NewFloatingMaxGroupTieredPriceInvoicingCycleConfiguration
1146+
]
1147+
| NotGiven = NOT_GIVEN,
1148+
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
1149+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1150+
# The extra values given here take precedence over values defined on the client or passed to this method.
1151+
extra_headers: Headers | None = None,
1152+
extra_query: Query | None = None,
1153+
extra_body: Body | None = None,
1154+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1155+
idempotency_key: str | None = None,
1156+
) -> Price:
1157+
"""
1158+
This endpoint is used to create a [price](/product-catalog/price-configuration).
1159+
A price created using this endpoint is always an add-on, meaning that it’s not
1160+
associated with a specific plan and can instead be individually added to
1161+
subscriptions, including subscriptions on different plans.
1162+
1163+
An `external_price_id` can be optionally specified as an alias to allow
1164+
ergonomic interaction with prices in the Orb API.
1165+
1166+
See the [Price resource](/product-catalog/price-configuration) for the
1167+
specification of different price model configurations possible in this endpoint.
1168+
1169+
Args:
1170+
cadence: The cadence to bill for this price on.
1171+
1172+
currency: An ISO 4217 currency string for which this price is billed in.
1173+
1174+
item_id: The id of the item the plan will be associated with.
1175+
1176+
name: The name of the price.
1177+
1178+
billable_metric_id: The id of the billable metric for the price. Only needed if the price is
1179+
usage-based.
1180+
1181+
billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if
1182+
this is true, and in-arrears if this is false.
1183+
1184+
billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or
1185+
months.
1186+
1187+
conversion_rate: The per unit conversion rate of the price currency to the invoicing currency.
1188+
1189+
external_price_id: An alias for the price.
1190+
1191+
fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units
1192+
applied.
1193+
1194+
invoice_grouping_key: The property used to group this price on an invoice
1195+
1196+
invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced.
1197+
If unspecified, a single invoice is produced per billing cycle.
1198+
1199+
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
1200+
by setting the value to `null`, and the entire metadata mapping can be cleared
1201+
by setting `metadata` to `null`.
1202+
1203+
extra_headers: Send extra headers
1204+
1205+
extra_query: Add additional query parameters to the request
1206+
1207+
extra_body: Add additional JSON properties to the request
1208+
1209+
timeout: Override the client-level default timeout for this request, in seconds
1210+
1211+
idempotency_key: Specify a custom idempotency key for this request
1212+
"""
1213+
...
1214+
11241215
@overload
11251216
def create(
11261217
self,
@@ -2226,6 +2317,7 @@ def create(
22262317
["cadence", "currency", "item_id", "model_type", "name", "threshold_total_amount_config"],
22272318
["cadence", "currency", "item_id", "model_type", "name", "tiered_package_config"],
22282319
["cadence", "currency", "grouped_tiered_config", "item_id", "model_type", "name"],
2320+
["cadence", "currency", "item_id", "max_group_tiered_config", "model_type", "name"],
22292321
["cadence", "currency", "item_id", "model_type", "name", "tiered_with_minimum_config"],
22302322
["cadence", "currency", "item_id", "model_type", "name", "package_with_allocation_config"],
22312323
["cadence", "currency", "item_id", "model_type", "name", "tiered_package_with_minimum_config"],
@@ -2257,6 +2349,7 @@ def create(
22572349
| Literal["threshold_total_amount"]
22582350
| Literal["tiered_package"]
22592351
| Literal["grouped_tiered"]
2352+
| Literal["max_group_tiered"]
22602353
| Literal["tiered_with_minimum"]
22612354
| Literal["package_with_allocation"]
22622355
| Literal["tiered_package_with_minimum"]
@@ -2294,6 +2387,7 @@ def create(
22942387
threshold_total_amount_config: Dict[str, object] | NotGiven = NOT_GIVEN,
22952388
tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN,
22962389
grouped_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN,
2390+
max_group_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN,
22972391
tiered_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN,
22982392
package_with_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN,
22992393
tiered_package_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN,
@@ -2346,6 +2440,7 @@ def create(
23462440
"threshold_total_amount_config": threshold_total_amount_config,
23472441
"tiered_package_config": tiered_package_config,
23482442
"grouped_tiered_config": grouped_tiered_config,
2443+
"max_group_tiered_config": max_group_tiered_config,
23492444
"tiered_with_minimum_config": tiered_with_minimum_config,
23502445
"package_with_allocation_config": package_with_allocation_config,
23512446
"tiered_package_with_minimum_config": tiered_package_with_minimum_config,
@@ -3689,6 +3784,97 @@ async def create(
36893784
"""
36903785
...
36913786

3787+
@overload
3788+
async def create(
3789+
self,
3790+
*,
3791+
cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"],
3792+
currency: str,
3793+
item_id: str,
3794+
max_group_tiered_config: Dict[str, object],
3795+
model_type: Literal["max_group_tiered"],
3796+
name: str,
3797+
billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN,
3798+
billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN,
3799+
billing_cycle_configuration: Optional[
3800+
price_create_params.NewFloatingMaxGroupTieredPriceBillingCycleConfiguration
3801+
]
3802+
| NotGiven = NOT_GIVEN,
3803+
conversion_rate: Optional[float] | NotGiven = NOT_GIVEN,
3804+
external_price_id: Optional[str] | NotGiven = NOT_GIVEN,
3805+
fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN,
3806+
invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN,
3807+
invoicing_cycle_configuration: Optional[
3808+
price_create_params.NewFloatingMaxGroupTieredPriceInvoicingCycleConfiguration
3809+
]
3810+
| NotGiven = NOT_GIVEN,
3811+
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
3812+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
3813+
# The extra values given here take precedence over values defined on the client or passed to this method.
3814+
extra_headers: Headers | None = None,
3815+
extra_query: Query | None = None,
3816+
extra_body: Body | None = None,
3817+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
3818+
idempotency_key: str | None = None,
3819+
) -> Price:
3820+
"""
3821+
This endpoint is used to create a [price](/product-catalog/price-configuration).
3822+
A price created using this endpoint is always an add-on, meaning that it’s not
3823+
associated with a specific plan and can instead be individually added to
3824+
subscriptions, including subscriptions on different plans.
3825+
3826+
An `external_price_id` can be optionally specified as an alias to allow
3827+
ergonomic interaction with prices in the Orb API.
3828+
3829+
See the [Price resource](/product-catalog/price-configuration) for the
3830+
specification of different price model configurations possible in this endpoint.
3831+
3832+
Args:
3833+
cadence: The cadence to bill for this price on.
3834+
3835+
currency: An ISO 4217 currency string for which this price is billed in.
3836+
3837+
item_id: The id of the item the plan will be associated with.
3838+
3839+
name: The name of the price.
3840+
3841+
billable_metric_id: The id of the billable metric for the price. Only needed if the price is
3842+
usage-based.
3843+
3844+
billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if
3845+
this is true, and in-arrears if this is false.
3846+
3847+
billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or
3848+
months.
3849+
3850+
conversion_rate: The per unit conversion rate of the price currency to the invoicing currency.
3851+
3852+
external_price_id: An alias for the price.
3853+
3854+
fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units
3855+
applied.
3856+
3857+
invoice_grouping_key: The property used to group this price on an invoice
3858+
3859+
invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced.
3860+
If unspecified, a single invoice is produced per billing cycle.
3861+
3862+
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
3863+
by setting the value to `null`, and the entire metadata mapping can be cleared
3864+
by setting `metadata` to `null`.
3865+
3866+
extra_headers: Send extra headers
3867+
3868+
extra_query: Add additional query parameters to the request
3869+
3870+
extra_body: Add additional JSON properties to the request
3871+
3872+
timeout: Override the client-level default timeout for this request, in seconds
3873+
3874+
idempotency_key: Specify a custom idempotency key for this request
3875+
"""
3876+
...
3877+
36923878
@overload
36933879
async def create(
36943880
self,
@@ -4794,6 +4980,7 @@ async def create(
47944980
["cadence", "currency", "item_id", "model_type", "name", "threshold_total_amount_config"],
47954981
["cadence", "currency", "item_id", "model_type", "name", "tiered_package_config"],
47964982
["cadence", "currency", "grouped_tiered_config", "item_id", "model_type", "name"],
4983+
["cadence", "currency", "item_id", "max_group_tiered_config", "model_type", "name"],
47974984
["cadence", "currency", "item_id", "model_type", "name", "tiered_with_minimum_config"],
47984985
["cadence", "currency", "item_id", "model_type", "name", "package_with_allocation_config"],
47994986
["cadence", "currency", "item_id", "model_type", "name", "tiered_package_with_minimum_config"],
@@ -4825,6 +5012,7 @@ async def create(
48255012
| Literal["threshold_total_amount"]
48265013
| Literal["tiered_package"]
48275014
| Literal["grouped_tiered"]
5015+
| Literal["max_group_tiered"]
48285016
| Literal["tiered_with_minimum"]
48295017
| Literal["package_with_allocation"]
48305018
| Literal["tiered_package_with_minimum"]
@@ -4862,6 +5050,7 @@ async def create(
48625050
threshold_total_amount_config: Dict[str, object] | NotGiven = NOT_GIVEN,
48635051
tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN,
48645052
grouped_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN,
5053+
max_group_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN,
48655054
tiered_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN,
48665055
package_with_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN,
48675056
tiered_package_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN,
@@ -4914,6 +5103,7 @@ async def create(
49145103
"threshold_total_amount_config": threshold_total_amount_config,
49155104
"tiered_package_config": tiered_package_config,
49165105
"grouped_tiered_config": grouped_tiered_config,
5106+
"max_group_tiered_config": max_group_tiered_config,
49175107
"tiered_with_minimum_config": tiered_with_minimum_config,
49185108
"package_with_allocation_config": package_with_allocation_config,
49195109
"tiered_package_with_minimum_config": tiered_package_with_minimum_config,

src/orb/resources/subscriptions.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,8 @@ def schedule_plan_change(
15821582
billing cycle alignment.
15831583
15841584
change_date: The date that the plan change should take effect. This parameter can only be
1585-
passed if the `change_option` is `requested_date`.
1585+
passed if the `change_option` is `requested_date`. If a date with no time is
1586+
passed, the plan change will happen at midnight in the customer's timezone.
15861587
15871588
coupon_redemption_code: Redemption code to be used for this subscription. If the coupon cannot be found
15881589
by its redemption code, or cannot be redeemed, an error response will be
@@ -3549,7 +3550,8 @@ async def schedule_plan_change(
35493550
billing cycle alignment.
35503551
35513552
change_date: The date that the plan change should take effect. This parameter can only be
3552-
passed if the `change_option` is `requested_date`.
3553+
passed if the `change_option` is `requested_date`. If a date with no time is
3554+
passed, the plan change will happen at midnight in the customer's timezone.
35533555
35543556
coupon_redemption_code: Redemption code to be used for this subscription. If the coupon cannot be found
35553557
by its redemption code, or cannot be redeemed, an error response will be

0 commit comments

Comments
 (0)