Skip to content

Commit 6f8c441

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): api update (#436)
1 parent 3dc9d02 commit 6f8c441

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-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: 97
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-bf3e71b33372f4a9307f4b6cb689ea46b3cf583ecc5d79eee9601cd0b0467c9a.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0f43f737c6520ed2a2407628511350362959997f89a868c50aa38d47d5791171.yml

src/orb/resources/subscriptions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,10 @@ def schedule_plan_change(
13361336
auto_collection: Optional[bool] | NotGiven = NOT_GIVEN,
13371337
billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]]
13381338
| NotGiven = NOT_GIVEN,
1339+
billing_cycle_anchor_configuration: Optional[
1340+
subscription_schedule_plan_change_params.BillingCycleAnchorConfiguration
1341+
]
1342+
| NotGiven = NOT_GIVEN,
13391343
change_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
13401344
coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN,
13411345
credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN,
@@ -1635,6 +1639,7 @@ def schedule_plan_change(
16351639
"align_billing_with_plan_change_date": align_billing_with_plan_change_date,
16361640
"auto_collection": auto_collection,
16371641
"billing_cycle_alignment": billing_cycle_alignment,
1642+
"billing_cycle_anchor_configuration": billing_cycle_anchor_configuration,
16381643
"change_date": change_date,
16391644
"coupon_redemption_code": coupon_redemption_code,
16401645
"credits_overage_rate": credits_overage_rate,
@@ -3280,6 +3285,10 @@ async def schedule_plan_change(
32803285
auto_collection: Optional[bool] | NotGiven = NOT_GIVEN,
32813286
billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]]
32823287
| NotGiven = NOT_GIVEN,
3288+
billing_cycle_anchor_configuration: Optional[
3289+
subscription_schedule_plan_change_params.BillingCycleAnchorConfiguration
3290+
]
3291+
| NotGiven = NOT_GIVEN,
32833292
change_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
32843293
coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN,
32853294
credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN,
@@ -3579,6 +3588,7 @@ async def schedule_plan_change(
35793588
"align_billing_with_plan_change_date": align_billing_with_plan_change_date,
35803589
"auto_collection": auto_collection,
35813590
"billing_cycle_alignment": billing_cycle_alignment,
3591+
"billing_cycle_anchor_configuration": billing_cycle_anchor_configuration,
35823592
"change_date": change_date,
35833593
"coupon_redemption_code": coupon_redemption_code,
35843594
"credits_overage_rate": credits_overage_rate,

src/orb/types/subscription_schedule_plan_change_params.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"AddPricePriceNewSubscriptionBulkWithProrationPrice",
8787
"AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration",
8888
"AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration",
89+
"BillingCycleAnchorConfiguration",
8990
"RemoveAdjustment",
9091
"RemovePrice",
9192
"ReplaceAdjustment",
@@ -204,6 +205,8 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False):
204205
billing cycle alignment.
205206
"""
206207

208+
billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfiguration]
209+
207210
change_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
208211
"""The date that the plan change should take effect.
209212
@@ -2193,6 +2196,30 @@ class AddPrice(TypedDict, total=False):
21932196
"""
21942197

21952198

2199+
class BillingCycleAnchorConfiguration(TypedDict, total=False):
2200+
day: Required[int]
2201+
"""The day of the month on which the billing cycle is anchored.
2202+
2203+
If the maximum number of days in a month is greater than this value, the last
2204+
day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April
2205+
means the billing period begins on the 30th.
2206+
"""
2207+
2208+
month: Optional[int]
2209+
"""The month on which the billing cycle is anchored (e.g.
2210+
2211+
a quarterly price anchored in February would have cycles starting February, May,
2212+
August, and November).
2213+
"""
2214+
2215+
year: Optional[int]
2216+
"""The year on which the billing cycle is anchored (e.g.
2217+
2218+
a 2 year billing cycle anchored on 2021 would have cycles starting on 2021,
2219+
2023, 2025, etc.).
2220+
"""
2221+
2222+
21962223
class RemoveAdjustment(TypedDict, total=False):
21972224
adjustment_id: Required[str]
21982225
"""The id of the adjustment to remove on the subscription."""

tests/api_resources/test_subscriptions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,11 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None:
749749
align_billing_with_plan_change_date=True,
750750
auto_collection=True,
751751
billing_cycle_alignment="unchanged",
752+
billing_cycle_anchor_configuration={
753+
"day": 1,
754+
"month": 1,
755+
"year": 0,
756+
},
752757
change_date=parse_datetime("2017-07-21T17:32:28Z"),
753758
coupon_redemption_code="coupon_redemption_code",
754759
credits_overage_rate=0,
@@ -1849,6 +1854,11 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A
18491854
align_billing_with_plan_change_date=True,
18501855
auto_collection=True,
18511856
billing_cycle_alignment="unchanged",
1857+
billing_cycle_anchor_configuration={
1858+
"day": 1,
1859+
"month": 1,
1860+
"year": 0,
1861+
},
18521862
change_date=parse_datetime("2017-07-21T17:32:28Z"),
18531863
coupon_redemption_code="coupon_redemption_code",
18541864
credits_overage_rate=0,

0 commit comments

Comments
 (0)