diff --git a/.stats.yml b/.stats.yml index e6f3bc3d..0f0325a1 100755 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index f4073a02..cfb4e45e 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,6 @@ dependencies = [ "distro>=1.7.0, <2", "sniffio", "cached-property; python_version < '3.8'", - ] requires-python = ">= 3.7" classifiers = [ @@ -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" @@ -59,7 +56,6 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", - ] [tool.rye.scripts] diff --git a/src/orb/resources/subscriptions.py b/src/orb/resources/subscriptions.py index b5af316b..4155f2de 100755 --- a/src/orb/resources/subscriptions.py +++ b/src/orb/resources/subscriptions.py @@ -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. @@ -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]] @@ -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. @@ -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. @@ -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. @@ -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, @@ -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. @@ -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]] @@ -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. @@ -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. @@ -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. @@ -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, diff --git a/src/orb/types/subscription_create_params.py b/src/orb/types/subscription_create_params.py index ceaba2cb..f88e5e01 100755 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -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")] @@ -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. @@ -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] diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index dc62ef0c..c7e06d4e 100755 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -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 @@ -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 @@ -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] diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index 1a2d6603..61fcc04f 100755 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -49,8 +49,8 @@ def test_method_create_with_all_params(self, client: Orb) -> None: external_marketplace="google", external_marketplace_reporting_id="external_marketplace_reporting_id", external_plan_id="ZMwNQefe7J3ecf7W", - initial_phase_order=0, - invoicing_threshold="invoicing_threshold", + initial_phase_order=2, + invoicing_threshold="10.00", metadata={"foo": "string"}, net_terms=0, per_credit_overage_amount=0, @@ -843,13 +843,16 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: subscription_id="subscription_id", change_option="requested_date", align_billing_with_plan_change_date=True, + auto_collection=True, billing_cycle_alignment="unchanged", change_date=parse_datetime("2017-07-21T17:32:28Z"), coupon_redemption_code="coupon_redemption_code", credits_overage_rate=0, + default_invoice_memo="default_invoice_memo", external_plan_id="ZMwNQefe7J3ecf7W", initial_phase_order=2, invoicing_threshold="10.00", + net_terms=0, per_credit_overage_amount=0, plan_id="ZMwNQefe7J3ecf7W", price_overrides=[ @@ -1195,8 +1198,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No external_marketplace="google", external_marketplace_reporting_id="external_marketplace_reporting_id", external_plan_id="ZMwNQefe7J3ecf7W", - initial_phase_order=0, - invoicing_threshold="invoicing_threshold", + initial_phase_order=2, + invoicing_threshold="10.00", metadata={"foo": "string"}, net_terms=0, per_credit_overage_amount=0, @@ -1989,13 +1992,16 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A subscription_id="subscription_id", change_option="requested_date", align_billing_with_plan_change_date=True, + auto_collection=True, billing_cycle_alignment="unchanged", change_date=parse_datetime("2017-07-21T17:32:28Z"), coupon_redemption_code="coupon_redemption_code", credits_overage_rate=0, + default_invoice_memo="default_invoice_memo", external_plan_id="ZMwNQefe7J3ecf7W", initial_phase_order=2, invoicing_threshold="10.00", + net_terms=0, per_credit_overage_amount=0, plan_id="ZMwNQefe7J3ecf7W", price_overrides=[