Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 97
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-bf3e71b33372f4a9307f4b6cb689ea46b3cf583ecc5d79eee9601cd0b0467c9a.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0f43f737c6520ed2a2407628511350362959997f89a868c50aa38d47d5791171.yml
10 changes: 10 additions & 0 deletions src/orb/resources/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,10 @@ def schedule_plan_change(
auto_collection: Optional[bool] | NotGiven = NOT_GIVEN,
billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]]
| NotGiven = NOT_GIVEN,
billing_cycle_anchor_configuration: Optional[
subscription_schedule_plan_change_params.BillingCycleAnchorConfiguration
]
| NotGiven = NOT_GIVEN,
change_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN,
credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1635,6 +1639,7 @@ def schedule_plan_change(
"align_billing_with_plan_change_date": align_billing_with_plan_change_date,
"auto_collection": auto_collection,
"billing_cycle_alignment": billing_cycle_alignment,
"billing_cycle_anchor_configuration": billing_cycle_anchor_configuration,
"change_date": change_date,
"coupon_redemption_code": coupon_redemption_code,
"credits_overage_rate": credits_overage_rate,
Expand Down Expand Up @@ -3280,6 +3285,10 @@ async def schedule_plan_change(
auto_collection: Optional[bool] | NotGiven = NOT_GIVEN,
billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]]
| NotGiven = NOT_GIVEN,
billing_cycle_anchor_configuration: Optional[
subscription_schedule_plan_change_params.BillingCycleAnchorConfiguration
]
| NotGiven = NOT_GIVEN,
change_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN,
credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -3579,6 +3588,7 @@ async def schedule_plan_change(
"align_billing_with_plan_change_date": align_billing_with_plan_change_date,
"auto_collection": auto_collection,
"billing_cycle_alignment": billing_cycle_alignment,
"billing_cycle_anchor_configuration": billing_cycle_anchor_configuration,
"change_date": change_date,
"coupon_redemption_code": coupon_redemption_code,
"credits_overage_rate": credits_overage_rate,
Expand Down
27 changes: 27 additions & 0 deletions src/orb/types/subscription_schedule_plan_change_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"AddPricePriceNewSubscriptionBulkWithProrationPrice",
"AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration",
"AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration",
"BillingCycleAnchorConfiguration",
"RemoveAdjustment",
"RemovePrice",
"ReplaceAdjustment",
Expand Down Expand Up @@ -204,6 +205,8 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False):
billing cycle alignment.
"""

billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfiguration]

change_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""The date that the plan change should take effect.

Expand Down Expand Up @@ -2193,6 +2196,30 @@ class AddPrice(TypedDict, total=False):
"""


class BillingCycleAnchorConfiguration(TypedDict, total=False):
day: Required[int]
"""The day of the month on which the billing cycle is anchored.

If the maximum number of days in a month is greater than this value, the last
day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April
means the billing period begins on the 30th.
"""

month: Optional[int]
"""The month on which the billing cycle is anchored (e.g.

a quarterly price anchored in February would have cycles starting February, May,
August, and November).
"""

year: Optional[int]
"""The year on which the billing cycle is anchored (e.g.

a 2 year billing cycle anchored on 2021 would have cycles starting on 2021,
2023, 2025, etc.).
"""


class RemoveAdjustment(TypedDict, total=False):
adjustment_id: Required[str]
"""The id of the adjustment to remove on the subscription."""
Expand Down
10 changes: 10 additions & 0 deletions tests/api_resources/test_subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,11 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None:
align_billing_with_plan_change_date=True,
auto_collection=True,
billing_cycle_alignment="unchanged",
billing_cycle_anchor_configuration={
"day": 1,
"month": 1,
"year": 0,
},
change_date=parse_datetime("2017-07-21T17:32:28Z"),
coupon_redemption_code="coupon_redemption_code",
credits_overage_rate=0,
Expand Down Expand Up @@ -1849,6 +1854,11 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A
align_billing_with_plan_change_date=True,
auto_collection=True,
billing_cycle_alignment="unchanged",
billing_cycle_anchor_configuration={
"day": 1,
"month": 1,
"year": 0,
},
change_date=parse_datetime("2017-07-21T17:32:28Z"),
coupon_redemption_code="coupon_redemption_code",
credits_overage_rate=0,
Expand Down