Skip to content

Commit e70d3c9

Browse files
feat(api): api update
1 parent 177e362 commit e70d3c9

File tree

14 files changed

+170
-33
lines changed

14 files changed

+170
-33
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-5b9152241ebdd0d2f3fd536784f33721d24a5c4a59e75cab366a3dcb36552d3d.yml
3-
openapi_spec_hash: b40061d10bbe1ebab8998bddd1827cf8
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-f2b97a2c3e41f618dc8955ed325092320ff2170a7d7a9a26a31dc235c969b657.yml
3+
openapi_spec_hash: 64548564dc8ce80ef3ad38fc8cb56b30
44
config_hash: dd4343ce95871032ef6e0735a4ca038c

src/orb/resources/subscriptions.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,7 @@ def price_intervals(
12221222
add: Iterable[subscription_price_intervals_params.Add] | Omit = omit,
12231223
add_adjustments: Iterable[subscription_price_intervals_params.AddAdjustment] | Omit = omit,
12241224
allow_invoice_credit_or_void: Optional[bool] | Omit = omit,
1225+
can_defer_billing: Optional[bool] | Omit = omit,
12251226
edit: Iterable[subscription_price_intervals_params.Edit] | Omit = omit,
12261227
edit_adjustments: Iterable[subscription_price_intervals_params.EditAdjustment] | Omit = omit,
12271228
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -1315,6 +1316,10 @@ def price_intervals(
13151316
credit note. Consider using this as a safety mechanism if you do not expect
13161317
existing invoices to be changed.
13171318
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.
1322+
13181323
edit: A list of price intervals to edit on the subscription.
13191324
13201325
edit_adjustments: A list of adjustments to edit on the subscription.
@@ -1338,6 +1343,7 @@ def price_intervals(
13381343
"add": add,
13391344
"add_adjustments": add_adjustments,
13401345
"allow_invoice_credit_or_void": allow_invoice_credit_or_void,
1346+
"can_defer_billing": can_defer_billing,
13411347
"edit": edit,
13421348
"edit_adjustments": edit_adjustments,
13431349
},
@@ -3308,6 +3314,7 @@ async def price_intervals(
33083314
add: Iterable[subscription_price_intervals_params.Add] | Omit = omit,
33093315
add_adjustments: Iterable[subscription_price_intervals_params.AddAdjustment] | Omit = omit,
33103316
allow_invoice_credit_or_void: Optional[bool] | Omit = omit,
3317+
can_defer_billing: Optional[bool] | Omit = omit,
33113318
edit: Iterable[subscription_price_intervals_params.Edit] | Omit = omit,
33123319
edit_adjustments: Iterable[subscription_price_intervals_params.EditAdjustment] | Omit = omit,
33133320
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -3401,6 +3408,10 @@ async def price_intervals(
34013408
credit note. Consider using this as a safety mechanism if you do not expect
34023409
existing invoices to be changed.
34033410
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.
3414+
34043415
edit: A list of price intervals to edit on the subscription.
34053416
34063417
edit_adjustments: A list of adjustments to edit on the subscription.
@@ -3424,6 +3435,7 @@ async def price_intervals(
34243435
"add": add,
34253436
"add_adjustments": add_adjustments,
34263437
"allow_invoice_credit_or_void": allow_invoice_credit_or_void,
3438+
"can_defer_billing": can_defer_billing,
34273439
"edit": edit,
34283440
"edit_adjustments": edit_adjustments,
34293441
},

src/orb/types/shared/price_interval.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ class PriceInterval(BaseModel):
1616
billing_cycle_day: int
1717
"""The day of the month that Orb bills for this price"""
1818

19+
can_defer_billing: bool
20+
"""For in-arrears prices.
21+
22+
If true, and the price interval ends mid-cycle, the final line item will be
23+
deferred to the next scheduled invoice instead of being billed mid-cycle.
24+
"""
25+
1926
current_billing_period_end_date: Optional[datetime] = None
2027
"""The end of the current billing period.
2128

src/orb/types/shared/tiered_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List
3+
from typing import List, Optional
44

55
from .tier import Tier
66
from ..._models import BaseModel
@@ -11,3 +11,6 @@
1111
class TieredConfig(BaseModel):
1212
tiers: List[Tier]
1313
"""Tiers for rating based on total usage quantities into the specified tier"""
14+
15+
prorated: Optional[bool] = None
16+
"""If true, subtotals from this price are prorated based on the service period"""

src/orb/types/shared/unit_config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from typing import Optional
4+
35
from ..._models import BaseModel
46

57
__all__ = ["UnitConfig"]
@@ -8,3 +10,6 @@
810
class UnitConfig(BaseModel):
911
unit_amount: str
1012
"""Rate per unit of usage"""
13+
14+
prorated: Optional[bool] = None
15+
"""If true, subtotals from this price are prorated based on the service period"""

src/orb/types/shared_params/tiered_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
class TieredConfig(TypedDict, total=False):
1414
tiers: Required[Iterable[Tier]]
1515
"""Tiers for rating based on total usage quantities into the specified tier"""
16+
17+
prorated: bool
18+
"""If true, subtotals from this price are prorated based on the service period"""

src/orb/types/shared_params/unit_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010
class UnitConfig(TypedDict, total=False):
1111
unit_amount: Required[str]
1212
"""Rate per unit of usage"""
13+
14+
prorated: bool
15+
"""If true, subtotals from this price are prorated based on the service period"""

src/orb/types/subscription_price_intervals_params.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ class SubscriptionPriceIntervalsParams(TypedDict, total=False):
9595
existing invoices to be changed.
9696
"""
9797

98+
can_defer_billing: Optional[bool]
99+
"""
100+
If true, ending an in-arrears price interval mid-cycle will defer billing the
101+
final line itemuntil the next scheduled invoice. If false, it will be billed on
102+
its end date. If not provided, behaviorwill follow account default.
103+
"""
104+
98105
edit: Iterable[Edit]
99106
"""A list of price intervals to edit on the subscription."""
100107

@@ -669,6 +676,13 @@ class Edit(TypedDict, total=False):
669676
overlapping price intervals must have the same billing cycle day.
670677
"""
671678

679+
can_defer_billing: Optional[bool]
680+
"""
681+
If true, ending an in-arrears price interval mid-cycle will defer billing the
682+
final line itemuntil the next scheduled invoice. If false, it will be billed on
683+
its end date. If not provided, behaviorwill follow account default.
684+
"""
685+
672686
end_date: Annotated[Union[Union[str, datetime], BillingCycleRelativeDate, None], PropertyInfo(format="iso8601")]
673687
"""The updated end date of this price interval.
674688

tests/api_resources/beta/test_external_plan_id.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None:
7777
"item_id": "item_id",
7878
"model_type": "unit",
7979
"name": "Annual fee",
80-
"unit_config": {"unit_amount": "unit_amount"},
80+
"unit_config": {
81+
"unit_amount": "unit_amount",
82+
"prorated": True,
83+
},
8184
"billable_metric_id": "billable_metric_id",
8285
"billed_in_advance": True,
8386
"billing_cycle_configuration": {
@@ -168,7 +171,10 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None:
168171
"item_id": "item_id",
169172
"model_type": "unit",
170173
"name": "Annual fee",
171-
"unit_config": {"unit_amount": "unit_amount"},
174+
"unit_config": {
175+
"unit_amount": "unit_amount",
176+
"prorated": True,
177+
},
172178
"billable_metric_id": "billable_metric_id",
173179
"billed_in_advance": True,
174180
"billing_cycle_configuration": {
@@ -392,7 +398,10 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As
392398
"item_id": "item_id",
393399
"model_type": "unit",
394400
"name": "Annual fee",
395-
"unit_config": {"unit_amount": "unit_amount"},
401+
"unit_config": {
402+
"unit_amount": "unit_amount",
403+
"prorated": True,
404+
},
396405
"billable_metric_id": "billable_metric_id",
397406
"billed_in_advance": True,
398407
"billing_cycle_configuration": {
@@ -483,7 +492,10 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As
483492
"item_id": "item_id",
484493
"model_type": "unit",
485494
"name": "Annual fee",
486-
"unit_config": {"unit_amount": "unit_amount"},
495+
"unit_config": {
496+
"unit_amount": "unit_amount",
497+
"prorated": True,
498+
},
487499
"billable_metric_id": "billable_metric_id",
488500
"billed_in_advance": True,
489501
"billing_cycle_configuration": {

tests/api_resources/test_beta.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None:
7777
"item_id": "item_id",
7878
"model_type": "unit",
7979
"name": "Annual fee",
80-
"unit_config": {"unit_amount": "unit_amount"},
80+
"unit_config": {
81+
"unit_amount": "unit_amount",
82+
"prorated": True,
83+
},
8184
"billable_metric_id": "billable_metric_id",
8285
"billed_in_advance": True,
8386
"billing_cycle_configuration": {
@@ -168,7 +171,10 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None:
168171
"item_id": "item_id",
169172
"model_type": "unit",
170173
"name": "Annual fee",
171-
"unit_config": {"unit_amount": "unit_amount"},
174+
"unit_config": {
175+
"unit_amount": "unit_amount",
176+
"prorated": True,
177+
},
172178
"billable_metric_id": "billable_metric_id",
173179
"billed_in_advance": True,
174180
"billing_cycle_configuration": {
@@ -392,7 +398,10 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As
392398
"item_id": "item_id",
393399
"model_type": "unit",
394400
"name": "Annual fee",
395-
"unit_config": {"unit_amount": "unit_amount"},
401+
"unit_config": {
402+
"unit_amount": "unit_amount",
403+
"prorated": True,
404+
},
396405
"billable_metric_id": "billable_metric_id",
397406
"billed_in_advance": True,
398407
"billing_cycle_configuration": {
@@ -483,7 +492,10 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As
483492
"item_id": "item_id",
484493
"model_type": "unit",
485494
"name": "Annual fee",
486-
"unit_config": {"unit_amount": "unit_amount"},
495+
"unit_config": {
496+
"unit_amount": "unit_amount",
497+
"prorated": True,
498+
},
487499
"billable_metric_id": "billable_metric_id",
488500
"billed_in_advance": True,
489501
"billing_cycle_configuration": {

0 commit comments

Comments
 (0)