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: 93
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-3a9214e6a8bf5952997fd2a3b6521804ab82d2cff40ed2ecb3b3cb512fe3bf35.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4df283466fdce46e787565c6480138896b1d7ed98d68a79d5eb3438bed191276.yml
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ dependencies = [
"distro>=1.7.0, <2",
"sniffio",
"cached-property; python_version < '3.8'",

]
requires-python = ">= 3.7"
classifiers = [
Expand All @@ -36,8 +35,6 @@ classifiers = [
"License :: OSI Approved :: Apache Software License"
]



[project.urls]
Homepage = "https://github.com/orbcorp/orb-python"
Repository = "https://github.com/orbcorp/orb-python"
Expand All @@ -59,7 +56,6 @@ dev-dependencies = [
"dirty-equals>=0.6.0",
"importlib-metadata>=6.7.0",
"rich>=13.7.1",

]

[tool.rye.scripts]
Expand Down
80 changes: 78 additions & 2 deletions src/orb/resources/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,34 @@ def create(
$10.00 for a subscription that invoices in USD.

Args:
auto_collection: Determines whether issued invoices for this subscription will automatically be
charged with the saved payment method on the due date. If not specified, this
defaults to the behavior configured for this customer.

coupon_redemption_code: Redemption code to be used for this subscription. If the coupon cannot be found
by its redemption code, or cannot be redeemed, an error response will be
returned and the subscription creation or plan change will not be scheduled.

default_invoice_memo: Determines the default memo on this subscription's invoices. Note that if this
is not provided, it is determined by the plan configuration.

external_plan_id: The external_plan_id of the plan that the given subscription should be switched
to. Note that either this property or `plan_id` must be specified.

initial_phase_order: The phase of the plan to start with

invoicing_threshold: When this subscription's accrued usage reaches this threshold, an invoice will
be issued for the subscription. If not specified, invoices will only be issued
at the end of the billing period.

metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

net_terms: The net terms determines the difference between the invoice date and the issue
date for the invoice. If you intend the invoice to be due on issue, set this
to 0. If not provided, this defaults to the value specified in the plan.

plan_id: The plan that the given subscription should be switched to. Note that either
this property or `external_plan_id` must be specified.

Expand Down Expand Up @@ -1377,14 +1398,17 @@ def schedule_plan_change(
*,
change_option: Literal["requested_date", "end_of_subscription_term", "immediate"],
align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN,
auto_collection: Optional[bool] | NotGiven = NOT_GIVEN,
billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]]
| 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,
default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN,
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN,
invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN,
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN,
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
price_overrides: Optional[Iterable[subscription_schedule_plan_change_params.PriceOverride]]
Expand Down Expand Up @@ -1448,6 +1472,10 @@ def schedule_plan_change(
align_billing_with_plan_change_date: [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be
aligned with the plan change's effective date.

auto_collection: Determines whether issued invoices for this subscription will automatically be
charged with the saved payment method on the due date. If not specified, this
defaults to the behavior configured for this customer.

billing_cycle_alignment: Reset billing periods to be aligned with the plan change's effective date or
start of the month. Defaults to `unchanged` which keeps subscription's existing
billing cycle alignment.
Expand All @@ -1457,7 +1485,10 @@ def schedule_plan_change(

coupon_redemption_code: Redemption code to be used for this subscription. If the coupon cannot be found
by its redemption code, or cannot be redeemed, an error response will be
returned and the plan change will not be scheduled.
returned and the subscription creation or plan change will not be scheduled.

default_invoice_memo: Determines the default memo on this subscription's invoices. Note that if this
is not provided, it is determined by the plan configuration.

external_plan_id: The external_plan_id of the plan that the given subscription should be switched
to. Note that either this property or `plan_id` must be specified.
Expand All @@ -1468,6 +1499,10 @@ def schedule_plan_change(
be issued for the subscription. If not specified, invoices will only be issued
at the end of the billing period.

net_terms: The net terms determines the difference between the invoice date and the issue
date for the invoice. If you intend the invoice to be due on issue, set this
to 0. If not provided, this defaults to the value specified in the plan.

plan_id: The plan that the given subscription should be switched to. Note that either
this property or `external_plan_id` must be specified.

Expand All @@ -1491,13 +1526,16 @@ def schedule_plan_change(
{
"change_option": change_option,
"align_billing_with_plan_change_date": align_billing_with_plan_change_date,
"auto_collection": auto_collection,
"billing_cycle_alignment": billing_cycle_alignment,
"change_date": change_date,
"coupon_redemption_code": coupon_redemption_code,
"credits_overage_rate": credits_overage_rate,
"default_invoice_memo": default_invoice_memo,
"external_plan_id": external_plan_id,
"initial_phase_order": initial_phase_order,
"invoicing_threshold": invoicing_threshold,
"net_terms": net_terms,
"per_credit_overage_amount": per_credit_overage_amount,
"plan_id": plan_id,
"price_overrides": price_overrides,
Expand Down Expand Up @@ -2212,13 +2250,34 @@ async def create(
$10.00 for a subscription that invoices in USD.

Args:
auto_collection: Determines whether issued invoices for this subscription will automatically be
charged with the saved payment method on the due date. If not specified, this
defaults to the behavior configured for this customer.

coupon_redemption_code: Redemption code to be used for this subscription. If the coupon cannot be found
by its redemption code, or cannot be redeemed, an error response will be
returned and the subscription creation or plan change will not be scheduled.

default_invoice_memo: Determines the default memo on this subscription's invoices. Note that if this
is not provided, it is determined by the plan configuration.

external_plan_id: The external_plan_id of the plan that the given subscription should be switched
to. Note that either this property or `plan_id` must be specified.

initial_phase_order: The phase of the plan to start with

invoicing_threshold: When this subscription's accrued usage reaches this threshold, an invoice will
be issued for the subscription. If not specified, invoices will only be issued
at the end of the billing period.

metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

net_terms: The net terms determines the difference between the invoice date and the issue
date for the invoice. If you intend the invoice to be due on issue, set this
to 0. If not provided, this defaults to the value specified in the plan.

plan_id: The plan that the given subscription should be switched to. Note that either
this property or `external_plan_id` must be specified.

Expand Down Expand Up @@ -3112,14 +3171,17 @@ async def schedule_plan_change(
*,
change_option: Literal["requested_date", "end_of_subscription_term", "immediate"],
align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN,
auto_collection: Optional[bool] | NotGiven = NOT_GIVEN,
billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]]
| 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,
default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN,
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN,
invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN,
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN,
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
price_overrides: Optional[Iterable[subscription_schedule_plan_change_params.PriceOverride]]
Expand Down Expand Up @@ -3183,6 +3245,10 @@ async def schedule_plan_change(
align_billing_with_plan_change_date: [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be
aligned with the plan change's effective date.

auto_collection: Determines whether issued invoices for this subscription will automatically be
charged with the saved payment method on the due date. If not specified, this
defaults to the behavior configured for this customer.

billing_cycle_alignment: Reset billing periods to be aligned with the plan change's effective date or
start of the month. Defaults to `unchanged` which keeps subscription's existing
billing cycle alignment.
Expand All @@ -3192,7 +3258,10 @@ async def schedule_plan_change(

coupon_redemption_code: Redemption code to be used for this subscription. If the coupon cannot be found
by its redemption code, or cannot be redeemed, an error response will be
returned and the plan change will not be scheduled.
returned and the subscription creation or plan change will not be scheduled.

default_invoice_memo: Determines the default memo on this subscription's invoices. Note that if this
is not provided, it is determined by the plan configuration.

external_plan_id: The external_plan_id of the plan that the given subscription should be switched
to. Note that either this property or `plan_id` must be specified.
Expand All @@ -3203,6 +3272,10 @@ async def schedule_plan_change(
be issued for the subscription. If not specified, invoices will only be issued
at the end of the billing period.

net_terms: The net terms determines the difference between the invoice date and the issue
date for the invoice. If you intend the invoice to be due on issue, set this
to 0. If not provided, this defaults to the value specified in the plan.

plan_id: The plan that the given subscription should be switched to. Note that either
this property or `external_plan_id` must be specified.

Expand All @@ -3226,13 +3299,16 @@ async def schedule_plan_change(
{
"change_option": change_option,
"align_billing_with_plan_change_date": align_billing_with_plan_change_date,
"auto_collection": auto_collection,
"billing_cycle_alignment": billing_cycle_alignment,
"change_date": change_date,
"coupon_redemption_code": coupon_redemption_code,
"credits_overage_rate": credits_overage_rate,
"default_invoice_memo": default_invoice_memo,
"external_plan_id": external_plan_id,
"initial_phase_order": initial_phase_order,
"invoicing_threshold": invoicing_threshold,
"net_terms": net_terms,
"per_credit_overage_amount": per_credit_overage_amount,
"plan_id": plan_id,
"price_overrides": price_overrides,
Expand Down
26 changes: 26 additions & 0 deletions src/orb/types/subscription_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,33 @@ class SubscriptionCreateParams(TypedDict, total=False):
align_billing_with_subscription_start_date: bool

auto_collection: Optional[bool]
"""
Determines whether issued invoices for this subscription will automatically be
charged with the saved payment method on the due date. If not specified, this
defaults to the behavior configured for this customer.
"""

aws_region: Optional[str]

billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfiguration]

coupon_redemption_code: Optional[str]
"""Redemption code to be used for this subscription.

If the coupon cannot be found by its redemption code, or cannot be redeemed, an
error response will be returned and the subscription creation or plan change
will not be scheduled.
"""

credits_overage_rate: Optional[float]

customer_id: Optional[str]

default_invoice_memo: Optional[str]
"""Determines the default memo on this subscription's invoices.

Note that if this is not provided, it is determined by the plan configuration.
"""

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

Expand All @@ -92,8 +107,14 @@ class SubscriptionCreateParams(TypedDict, total=False):
"""

initial_phase_order: Optional[int]
"""The phase of the plan to start with"""

invoicing_threshold: Optional[str]
"""
When this subscription's accrued usage reaches this threshold, an invoice will
be issued for the subscription. If not specified, invoices will only be issued
at the end of the billing period.
"""

metadata: Optional[Dict[str, Optional[str]]]
"""User-specified key/value pairs for the resource.
Expand All @@ -103,6 +124,11 @@ class SubscriptionCreateParams(TypedDict, total=False):
"""

net_terms: Optional[int]
"""
The net terms determines the difference between the invoice date and the issue
date for the invoice. If you intend the invoice to be due on issue, set this
to 0. If not provided, this defaults to the value specified in the plan.
"""

per_credit_overage_amount: Optional[float]

Expand Down
23 changes: 22 additions & 1 deletion src/orb/types/subscription_schedule_plan_change_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False):
Reset billing periods to be aligned with the plan change's effective date.
"""

auto_collection: Optional[bool]
"""
Determines whether issued invoices for this subscription will automatically be
charged with the saved payment method on the due date. If not specified, this
defaults to the behavior configured for this customer.
"""

billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]]
"""
Reset billing periods to be aligned with the plan change's effective date or
Expand All @@ -85,11 +92,18 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False):
"""Redemption code to be used for this subscription.

If the coupon cannot be found by its redemption code, or cannot be redeemed, an
error response will be returned and the plan change will not be scheduled.
error response will be returned and the subscription creation or plan change
will not be scheduled.
"""

credits_overage_rate: Optional[float]

default_invoice_memo: Optional[str]
"""Determines the default memo on this subscription's invoices.

Note that if this is not provided, it is determined by the plan configuration.
"""

external_plan_id: Optional[str]
"""
The external_plan_id of the plan that the given subscription should be switched
Expand All @@ -106,6 +120,13 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False):
at the end of the billing period.
"""

net_terms: Optional[int]
"""
The net terms determines the difference between the invoice date and the issue
date for the invoice. If you intend the invoice to be due on issue, set this
to 0. If not provided, this defaults to the value specified in the plan.
"""

per_credit_overage_amount: Optional[float]

plan_id: Optional[str]
Expand Down
Loading