Skip to content

Commit 091fd4c

Browse files
feat(api): api update (#528)
1 parent d9589fe commit 091fd4c

8 files changed

+149
-1
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 103
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-43a4d1d907fd25faa99fef58ba7afb3dd39fae36f955b29bfe27b4bfdaa0ee54.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-2824cb456b8e3a7ce1ea34aa37a2c8e63d5b70425a5863502ffe1e1b1ef7efaf.yml

src/orb/types/customers/balance_transaction_create_response.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class BalanceTransactionCreateResponse(BaseModel):
3232
"credit_note_applied",
3333
"credit_note_voided",
3434
"overpayment_refund",
35+
"external_payment",
3536
]
3637

3738
amount: str

src/orb/types/customers/balance_transaction_list_response.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class BalanceTransactionListResponse(BaseModel):
3232
"credit_note_applied",
3333
"credit_note_voided",
3434
"overpayment_refund",
35+
"external_payment",
3536
]
3637

3738
amount: str

src/orb/types/invoice.py

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class CustomerBalanceTransaction(BaseModel):
136136
"credit_note_applied",
137137
"credit_note_voided",
138138
"overpayment_refund",
139+
"external_payment",
139140
]
140141

141142
amount: str

src/orb/types/invoice_fetch_upcoming_response.py

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class CustomerBalanceTransaction(BaseModel):
136136
"credit_note_applied",
137137
"credit_note_voided",
138138
"overpayment_refund",
139+
"external_payment",
139140
]
140141

141142
amount: str

src/orb/types/subscription_create_params.py

+48
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"AddAdjustmentAdjustmentNewMinimum",
1919
"AddAdjustmentAdjustmentNewMaximum",
2020
"AddPrice",
21+
"AddPriceAllocationPrice",
2122
"AddPriceDiscount",
2223
"AddPricePrice",
2324
"AddPricePriceNewSubscriptionUnitPrice",
@@ -98,6 +99,7 @@
9899
"ReplaceAdjustmentAdjustmentNewMinimum",
99100
"ReplaceAdjustmentAdjustmentNewMaximum",
100101
"ReplacePrice",
102+
"ReplacePriceAllocationPrice",
101103
"ReplacePriceDiscount",
102104
"ReplacePricePrice",
103105
"ReplacePricePriceNewSubscriptionUnitPrice",
@@ -427,6 +429,26 @@ class AddAdjustment(TypedDict, total=False):
427429
"""
428430

429431

432+
class AddPriceAllocationPrice(TypedDict, total=False):
433+
amount: Required[str]
434+
"""An amount of the currency to allocate to the customer at the specified cadence."""
435+
436+
cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]]
437+
"""The cadence at which to allocate the amount to the customer."""
438+
439+
currency: Required[str]
440+
"""
441+
An ISO 4217 currency string or a custom pricing unit identifier in which to bill
442+
this price.
443+
"""
444+
445+
expires_at_end_of_cadence: Required[bool]
446+
"""
447+
Whether the allocated amount should expire at the end of the cadence or roll
448+
over to the next period.
449+
"""
450+
451+
430452
class AddPriceDiscount(TypedDict, total=False):
431453
discount_type: Required[Literal["percentage", "usage", "amount"]]
432454

@@ -2211,6 +2233,9 @@ class AddPricePriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False)
22112233

22122234

22132235
class AddPrice(TypedDict, total=False):
2236+
allocation_price: Optional[AddPriceAllocationPrice]
2237+
"""The definition of a new allocation price to create and add to the subscription."""
2238+
22142239
discounts: Optional[Iterable[AddPriceDiscount]]
22152240
"""[DEPRECATED] Use add_adjustments instead.
22162241
@@ -2388,6 +2413,26 @@ class ReplaceAdjustment(TypedDict, total=False):
23882413
"""The id of the adjustment on the plan to replace in the subscription."""
23892414

23902415

2416+
class ReplacePriceAllocationPrice(TypedDict, total=False):
2417+
amount: Required[str]
2418+
"""An amount of the currency to allocate to the customer at the specified cadence."""
2419+
2420+
cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]]
2421+
"""The cadence at which to allocate the amount to the customer."""
2422+
2423+
currency: Required[str]
2424+
"""
2425+
An ISO 4217 currency string or a custom pricing unit identifier in which to bill
2426+
this price.
2427+
"""
2428+
2429+
expires_at_end_of_cadence: Required[bool]
2430+
"""
2431+
Whether the allocated amount should expire at the end of the cadence or roll
2432+
over to the next period.
2433+
"""
2434+
2435+
23912436
class ReplacePriceDiscount(TypedDict, total=False):
23922437
discount_type: Required[Literal["percentage", "usage", "amount"]]
23932438

@@ -4191,6 +4236,9 @@ class ReplacePrice(TypedDict, total=False):
41914236
replaces_price_id: Required[str]
41924237
"""The id of the price on the plan to replace in the subscription."""
41934238

4239+
allocation_price: Optional[ReplacePriceAllocationPrice]
4240+
"""The definition of a new allocation price to create and add to the subscription."""
4241+
41944242
discounts: Optional[Iterable[ReplacePriceDiscount]]
41954243
"""[DEPRECATED] Use add_adjustments instead.
41964244

src/orb/types/subscription_schedule_plan_change_params.py

+48
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"AddAdjustmentAdjustmentNewMinimum",
1919
"AddAdjustmentAdjustmentNewMaximum",
2020
"AddPrice",
21+
"AddPriceAllocationPrice",
2122
"AddPriceDiscount",
2223
"AddPricePrice",
2324
"AddPricePriceNewSubscriptionUnitPrice",
@@ -98,6 +99,7 @@
9899
"ReplaceAdjustmentAdjustmentNewMinimum",
99100
"ReplaceAdjustmentAdjustmentNewMaximum",
100101
"ReplacePrice",
102+
"ReplacePriceAllocationPrice",
101103
"ReplacePriceDiscount",
102104
"ReplacePricePrice",
103105
"ReplacePricePriceNewSubscriptionUnitPrice",
@@ -427,6 +429,26 @@ class AddAdjustment(TypedDict, total=False):
427429
"""
428430

429431

432+
class AddPriceAllocationPrice(TypedDict, total=False):
433+
amount: Required[str]
434+
"""An amount of the currency to allocate to the customer at the specified cadence."""
435+
436+
cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]]
437+
"""The cadence at which to allocate the amount to the customer."""
438+
439+
currency: Required[str]
440+
"""
441+
An ISO 4217 currency string or a custom pricing unit identifier in which to bill
442+
this price.
443+
"""
444+
445+
expires_at_end_of_cadence: Required[bool]
446+
"""
447+
Whether the allocated amount should expire at the end of the cadence or roll
448+
over to the next period.
449+
"""
450+
451+
430452
class AddPriceDiscount(TypedDict, total=False):
431453
discount_type: Required[Literal["percentage", "usage", "amount"]]
432454

@@ -2211,6 +2233,9 @@ class AddPricePriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False)
22112233

22122234

22132235
class AddPrice(TypedDict, total=False):
2236+
allocation_price: Optional[AddPriceAllocationPrice]
2237+
"""The definition of a new allocation price to create and add to the subscription."""
2238+
22142239
discounts: Optional[Iterable[AddPriceDiscount]]
22152240
"""[DEPRECATED] Use add_adjustments instead.
22162241
@@ -2388,6 +2413,26 @@ class ReplaceAdjustment(TypedDict, total=False):
23882413
"""The id of the adjustment on the plan to replace in the subscription."""
23892414

23902415

2416+
class ReplacePriceAllocationPrice(TypedDict, total=False):
2417+
amount: Required[str]
2418+
"""An amount of the currency to allocate to the customer at the specified cadence."""
2419+
2420+
cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]]
2421+
"""The cadence at which to allocate the amount to the customer."""
2422+
2423+
currency: Required[str]
2424+
"""
2425+
An ISO 4217 currency string or a custom pricing unit identifier in which to bill
2426+
this price.
2427+
"""
2428+
2429+
expires_at_end_of_cadence: Required[bool]
2430+
"""
2431+
Whether the allocated amount should expire at the end of the cadence or roll
2432+
over to the next period.
2433+
"""
2434+
2435+
23912436
class ReplacePriceDiscount(TypedDict, total=False):
23922437
discount_type: Required[Literal["percentage", "usage", "amount"]]
23932438

@@ -4191,6 +4236,9 @@ class ReplacePrice(TypedDict, total=False):
41914236
replaces_price_id: Required[str]
41924237
"""The id of the price on the plan to replace in the subscription."""
41934238

4239+
allocation_price: Optional[ReplacePriceAllocationPrice]
4240+
"""The definition of a new allocation price to create and add to the subscription."""
4241+
41944242
discounts: Optional[Iterable[ReplacePriceDiscount]]
41954243
"""[DEPRECATED] Use add_adjustments instead.
41964244

tests/api_resources/test_subscriptions.py

+48
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
5757
],
5858
add_prices=[
5959
{
60+
"allocation_price": {
61+
"amount": "10.00",
62+
"cadence": "one_time",
63+
"currency": "USD",
64+
"expires_at_end_of_cadence": True,
65+
},
6066
"discounts": [
6167
{
6268
"discount_type": "percentage",
@@ -145,6 +151,12 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
145151
replace_prices=[
146152
{
147153
"replaces_price_id": "replaces_price_id",
154+
"allocation_price": {
155+
"amount": "10.00",
156+
"cadence": "one_time",
157+
"currency": "USD",
158+
"expires_at_end_of_cadence": True,
159+
},
148160
"discounts": [
149161
{
150162
"discount_type": "percentage",
@@ -710,6 +722,12 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None:
710722
],
711723
add_prices=[
712724
{
725+
"allocation_price": {
726+
"amount": "10.00",
727+
"cadence": "one_time",
728+
"currency": "USD",
729+
"expires_at_end_of_cadence": True,
730+
},
713731
"discounts": [
714732
{
715733
"discount_type": "percentage",
@@ -793,6 +811,12 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None:
793811
replace_prices=[
794812
{
795813
"replaces_price_id": "replaces_price_id",
814+
"allocation_price": {
815+
"amount": "10.00",
816+
"cadence": "one_time",
817+
"currency": "USD",
818+
"expires_at_end_of_cadence": True,
819+
},
796820
"discounts": [
797821
{
798822
"discount_type": "percentage",
@@ -1169,6 +1193,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
11691193
],
11701194
add_prices=[
11711195
{
1196+
"allocation_price": {
1197+
"amount": "10.00",
1198+
"cadence": "one_time",
1199+
"currency": "USD",
1200+
"expires_at_end_of_cadence": True,
1201+
},
11721202
"discounts": [
11731203
{
11741204
"discount_type": "percentage",
@@ -1257,6 +1287,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
12571287
replace_prices=[
12581288
{
12591289
"replaces_price_id": "replaces_price_id",
1290+
"allocation_price": {
1291+
"amount": "10.00",
1292+
"cadence": "one_time",
1293+
"currency": "USD",
1294+
"expires_at_end_of_cadence": True,
1295+
},
12601296
"discounts": [
12611297
{
12621298
"discount_type": "percentage",
@@ -1822,6 +1858,12 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A
18221858
],
18231859
add_prices=[
18241860
{
1861+
"allocation_price": {
1862+
"amount": "10.00",
1863+
"cadence": "one_time",
1864+
"currency": "USD",
1865+
"expires_at_end_of_cadence": True,
1866+
},
18251867
"discounts": [
18261868
{
18271869
"discount_type": "percentage",
@@ -1905,6 +1947,12 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A
19051947
replace_prices=[
19061948
{
19071949
"replaces_price_id": "replaces_price_id",
1950+
"allocation_price": {
1951+
"amount": "10.00",
1952+
"cadence": "one_time",
1953+
"currency": "USD",
1954+
"expires_at_end_of_cadence": True,
1955+
},
19081956
"discounts": [
19091957
{
19101958
"discount_type": "percentage",

0 commit comments

Comments
 (0)