Skip to content

Commit db10b87

Browse files
feat(api): api update
1 parent a6465b2 commit db10b87

File tree

9 files changed

+87
-13
lines changed

9 files changed

+87
-13
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-36e32afb76082ffbe12a71342ed5b855b9ae83d8c5bcd225fe23915c308b39e7.yml
3-
openapi_spec_hash: 035e0bb6141d78b4aed031303585940c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0ab0946487d1ee971683d894554494d9940010403874c0be724ffc3a82d696db.yml
3+
openapi_spec_hash: 66b792328a4faee3c7659185accc3f0e
44
config_hash: e6db17547fe854b1c240407cf4c6dc9e

src/orb/resources/subscriptions.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,9 +1316,8 @@ def price_intervals(
13161316
credit note. Consider using this as a safety mechanism if you do not expect
13171317
existing invoices to be changed.
13181318
1319-
can_defer_billing: If true, ending an in-arrears price interval mid-cycle will defer billing the
1320-
final line itemuntil the next scheduled invoice. If false, it will be billed on
1321-
its end date. If not provided, behaviorwill follow account default.
1319+
can_defer_billing: If set, the default value to use for added/edited price intervals with an
1320+
end_date set.
13221321
13231322
edit: A list of price intervals to edit on the subscription.
13241323
@@ -3408,9 +3407,8 @@ async def price_intervals(
34083407
credit note. Consider using this as a safety mechanism if you do not expect
34093408
existing invoices to be changed.
34103409
3411-
can_defer_billing: If true, ending an in-arrears price interval mid-cycle will defer billing the
3412-
final line itemuntil the next scheduled invoice. If false, it will be billed on
3413-
its end date. If not provided, behaviorwill follow account default.
3410+
can_defer_billing: If set, the default value to use for added/edited price intervals with an
3411+
end_date set.
34143412
34153413
edit: A list of price intervals to edit on the subscription.
34163414

src/orb/types/shared/new_allocation_price.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,17 @@ class NewAllocationPrice(BaseModel):
4444

4545
filters: Optional[List[Filter]] = None
4646
"""The filters that determine which items the allocation applies to."""
47+
48+
item_id: Optional[str] = None
49+
"""
50+
The item ID that line items representing charges for this allocation will be
51+
associated with. If not provided, the default allocation item for the currency
52+
will be used (e.g. 'Included Allocation (USD)').
53+
"""
54+
55+
per_unit_cost_basis: Optional[str] = None
56+
"""The (per-unit) cost basis of each created block.
57+
58+
If non-zero, a customer will be invoiced according to the quantity and per unit
59+
cost basis specified for the allocation each cadence.
60+
"""

src/orb/types/shared_params/new_allocation_price.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,17 @@ class NewAllocationPrice(TypedDict, total=False):
4646

4747
filters: Optional[Iterable[Filter]]
4848
"""The filters that determine which items the allocation applies to."""
49+
50+
item_id: Optional[str]
51+
"""
52+
The item ID that line items representing charges for this allocation will be
53+
associated with. If not provided, the default allocation item for the currency
54+
will be used (e.g. 'Included Allocation (USD)').
55+
"""
56+
57+
per_unit_cost_basis: str
58+
"""The (per-unit) cost basis of each created block.
59+
60+
If non-zero, a customer will be invoiced according to the quantity and per unit
61+
cost basis specified for the allocation each cadence.
62+
"""

src/orb/types/subscription_price_intervals_params.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,8 @@ class SubscriptionPriceIntervalsParams(TypedDict, total=False):
100100

101101
can_defer_billing: Optional[bool]
102102
"""
103-
If true, ending an in-arrears price interval mid-cycle will defer billing the
104-
final line itemuntil the next scheduled invoice. If false, it will be billed on
105-
its end date. If not provided, behaviorwill follow account default.
103+
If set, the default value to use for added/edited price intervals with an
104+
end_date set.
106105
"""
107106

108107
edit: Iterable[Edit]
@@ -665,6 +664,13 @@ class Add(TypedDict, total=False):
665664
allocation_price: Optional[NewAllocationPrice]
666665
"""The definition of a new allocation price to create and add to the subscription."""
667666

667+
can_defer_billing: Optional[bool]
668+
"""
669+
If true, an in-arrears price interval ending mid-cycle will defer billing the
670+
final line item until the next scheduled invoice. If false, it will be billed on
671+
its end date.
672+
"""
673+
668674
discounts: Optional[Iterable[AddDiscount]]
669675
"""A list of discounts to initialize on the price interval."""
670676

@@ -775,9 +781,9 @@ class Edit(TypedDict, total=False):
775781

776782
can_defer_billing: Optional[bool]
777783
"""
778-
If true, ending an in-arrears price interval mid-cycle will defer billing the
784+
If true, an in-arrears price interval ending mid-cycle will defer billing the
779785
final line item until the next scheduled invoice. If false, it will be billed on
780-
its end date. If not provided, behavior will follow account default.
786+
its end date.
781787
"""
782788

783789
end_date: Annotated[Union[Union[str, datetime], BillingCycleRelativeDate, None], PropertyInfo(format="iso8601")]

tests/api_resources/beta/test_external_plan_id.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None:
7070
"values": ["string"],
7171
}
7272
],
73+
"item_id": "item_id",
74+
"per_unit_cost_basis": "per_unit_cost_basis",
7375
},
7476
"plan_phase_order": 0,
7577
"price": {
@@ -164,6 +166,8 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None:
164166
"values": ["string"],
165167
}
166168
],
169+
"item_id": "item_id",
170+
"per_unit_cost_basis": "per_unit_cost_basis",
167171
},
168172
"plan_phase_order": 0,
169173
"price": {
@@ -391,6 +395,8 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As
391395
"values": ["string"],
392396
}
393397
],
398+
"item_id": "item_id",
399+
"per_unit_cost_basis": "per_unit_cost_basis",
394400
},
395401
"plan_phase_order": 0,
396402
"price": {
@@ -485,6 +491,8 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As
485491
"values": ["string"],
486492
}
487493
],
494+
"item_id": "item_id",
495+
"per_unit_cost_basis": "per_unit_cost_basis",
488496
},
489497
"plan_phase_order": 0,
490498
"price": {

tests/api_resources/test_beta.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None:
7070
"values": ["string"],
7171
}
7272
],
73+
"item_id": "item_id",
74+
"per_unit_cost_basis": "per_unit_cost_basis",
7375
},
7476
"plan_phase_order": 0,
7577
"price": {
@@ -164,6 +166,8 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None:
164166
"values": ["string"],
165167
}
166168
],
169+
"item_id": "item_id",
170+
"per_unit_cost_basis": "per_unit_cost_basis",
167171
},
168172
"plan_phase_order": 0,
169173
"price": {
@@ -391,6 +395,8 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As
391395
"values": ["string"],
392396
}
393397
],
398+
"item_id": "item_id",
399+
"per_unit_cost_basis": "per_unit_cost_basis",
394400
},
395401
"plan_phase_order": 0,
396402
"price": {
@@ -485,6 +491,8 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As
485491
"values": ["string"],
486492
}
487493
],
494+
"item_id": "item_id",
495+
"per_unit_cost_basis": "per_unit_cost_basis",
488496
},
489497
"plan_phase_order": 0,
490498
"price": {

tests/api_resources/test_plans.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
5151
"values": ["string"],
5252
}
5353
],
54+
"item_id": "item_id",
55+
"per_unit_cost_basis": "per_unit_cost_basis",
5456
},
5557
"plan_phase_order": 0,
5658
"price": {
@@ -318,6 +320,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
318320
"values": ["string"],
319321
}
320322
],
323+
"item_id": "item_id",
324+
"per_unit_cost_basis": "per_unit_cost_basis",
321325
},
322326
"plan_phase_order": 0,
323327
"price": {

tests/api_resources/test_subscriptions.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
7575
"values": ["string"],
7676
}
7777
],
78+
"item_id": "item_id",
79+
"per_unit_cost_basis": "per_unit_cost_basis",
7880
},
7981
"discounts": [
8082
{
@@ -205,6 +207,8 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
205207
"values": ["string"],
206208
}
207209
],
210+
"item_id": "item_id",
211+
"per_unit_cost_basis": "per_unit_cost_basis",
208212
},
209213
"discounts": [
210214
{
@@ -657,7 +661,10 @@ def test_method_price_intervals_with_all_params(self, client: Orb) -> None:
657661
"values": ["string"],
658662
}
659663
],
664+
"item_id": "item_id",
665+
"per_unit_cost_basis": "per_unit_cost_basis",
660666
},
667+
"can_defer_billing": True,
661668
"discounts": [
662669
{
663670
"amount_discount": 0,
@@ -910,6 +917,8 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None:
910917
"values": ["string"],
911918
}
912919
],
920+
"item_id": "item_id",
921+
"per_unit_cost_basis": "per_unit_cost_basis",
913922
},
914923
"discounts": [
915924
{
@@ -1033,6 +1042,8 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None:
10331042
"values": ["string"],
10341043
}
10351044
],
1045+
"item_id": "item_id",
1046+
"per_unit_cost_basis": "per_unit_cost_basis",
10361047
},
10371048
"discounts": [
10381049
{
@@ -1454,6 +1465,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
14541465
"values": ["string"],
14551466
}
14561467
],
1468+
"item_id": "item_id",
1469+
"per_unit_cost_basis": "per_unit_cost_basis",
14571470
},
14581471
"discounts": [
14591472
{
@@ -1584,6 +1597,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
15841597
"values": ["string"],
15851598
}
15861599
],
1600+
"item_id": "item_id",
1601+
"per_unit_cost_basis": "per_unit_cost_basis",
15871602
},
15881603
"discounts": [
15891604
{
@@ -2036,7 +2051,10 @@ async def test_method_price_intervals_with_all_params(self, async_client: AsyncO
20362051
"values": ["string"],
20372052
}
20382053
],
2054+
"item_id": "item_id",
2055+
"per_unit_cost_basis": "per_unit_cost_basis",
20392056
},
2057+
"can_defer_billing": True,
20402058
"discounts": [
20412059
{
20422060
"amount_discount": 0,
@@ -2289,6 +2307,8 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A
22892307
"values": ["string"],
22902308
}
22912309
],
2310+
"item_id": "item_id",
2311+
"per_unit_cost_basis": "per_unit_cost_basis",
22922312
},
22932313
"discounts": [
22942314
{
@@ -2412,6 +2432,8 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A
24122432
"values": ["string"],
24132433
}
24142434
],
2435+
"item_id": "item_id",
2436+
"per_unit_cost_basis": "per_unit_cost_basis",
24152437
},
24162438
"discounts": [
24172439
{

0 commit comments

Comments
 (0)