diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 75e8a660..4336a6cb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.14.0" + ".": "3.15.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 715ea230..f6e24a32 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-48084a007f009b4358484f09a3a7b74a990c402669f9d15adfbb60e4f835f951.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-04f02fa57c3ab8d15ecf0a16a41a83814c21cdc2a830fae4d65f1b7b2196d819.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index e0671202..b764cdbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 3.15.0 (2025-03-11) + +Full Changelog: [v3.14.0...v3.15.0](https://github.com/orbcorp/orb-python/compare/v3.14.0...v3.15.0) + +### Features + +* **api:** api update ([#578](https://github.com/orbcorp/orb-python/issues/578)) ([04eaf67](https://github.com/orbcorp/orb-python/commit/04eaf6721083e11b758e90427f5b4337ba9b0d91)) +* **api:** api update ([#580](https://github.com/orbcorp/orb-python/issues/580)) ([5d04ab2](https://github.com/orbcorp/orb-python/commit/5d04ab2dc9d6404f3092241470e379ef5c5693b3)) +* **api:** api update ([#581](https://github.com/orbcorp/orb-python/issues/581)) ([dd09767](https://github.com/orbcorp/orb-python/commit/dd097673811c2082c8c95ee39dda5e613fd2c6a2)) + ## 3.14.0 (2025-03-05) Full Changelog: [v3.13.0...v3.14.0](https://github.com/orbcorp/orb-python/compare/v3.13.0...v3.14.0) diff --git a/pyproject.toml b/pyproject.toml index cde1f183..bad0d66e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "3.14.0" +version = "3.15.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/scripts/test b/scripts/test index 4fa5698b..2b878456 100755 --- a/scripts/test +++ b/scripts/test @@ -52,6 +52,8 @@ else echo fi +export DEFER_PYDANTIC_BUILD=false + echo "==> Running tests" rye run pytest "$@" diff --git a/src/orb/_version.py b/src/orb/_version.py index 4a465f8c..e94c8f9b 100644 --- a/src/orb/_version.py +++ b/src/orb/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "orb" -__version__ = "3.14.0" # x-release-please-version +__version__ = "3.15.0" # x-release-please-version diff --git a/src/orb/resources/alerts.py b/src/orb/resources/alerts.py index 4a38058d..8a6ece08 100644 --- a/src/orb/resources/alerts.py +++ b/src/orb/resources/alerts.py @@ -215,13 +215,7 @@ def create_for_customer( customer_id: str, *, currency: str, - type: Literal[ - "usage_exceeded", - "cost_exceeded", - "credit_balance_depleted", - "credit_balance_dropped", - "credit_balance_recovered", - ], + type: Literal["credit_balance_depleted", "credit_balance_dropped", "credit_balance_recovered"], thresholds: Optional[Iterable[alert_create_for_customer_params.Threshold]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -286,13 +280,7 @@ def create_for_external_customer( external_customer_id: str, *, currency: str, - type: Literal[ - "usage_exceeded", - "cost_exceeded", - "credit_balance_depleted", - "credit_balance_dropped", - "credit_balance_recovered", - ], + type: Literal["credit_balance_depleted", "credit_balance_dropped", "credit_balance_recovered"], thresholds: Optional[Iterable[alert_create_for_external_customer_params.Threshold]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -359,13 +347,7 @@ def create_for_subscription( subscription_id: str, *, thresholds: Iterable[alert_create_for_subscription_params.Threshold], - type: Literal[ - "usage_exceeded", - "cost_exceeded", - "credit_balance_depleted", - "credit_balance_dropped", - "credit_balance_recovered", - ], + type: Literal["usage_exceeded", "cost_exceeded"], metric_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -708,13 +690,7 @@ async def create_for_customer( customer_id: str, *, currency: str, - type: Literal[ - "usage_exceeded", - "cost_exceeded", - "credit_balance_depleted", - "credit_balance_dropped", - "credit_balance_recovered", - ], + type: Literal["credit_balance_depleted", "credit_balance_dropped", "credit_balance_recovered"], thresholds: Optional[Iterable[alert_create_for_customer_params.Threshold]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -779,13 +755,7 @@ async def create_for_external_customer( external_customer_id: str, *, currency: str, - type: Literal[ - "usage_exceeded", - "cost_exceeded", - "credit_balance_depleted", - "credit_balance_dropped", - "credit_balance_recovered", - ], + type: Literal["credit_balance_depleted", "credit_balance_dropped", "credit_balance_recovered"], thresholds: Optional[Iterable[alert_create_for_external_customer_params.Threshold]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -852,13 +822,7 @@ async def create_for_subscription( subscription_id: str, *, thresholds: Iterable[alert_create_for_subscription_params.Threshold], - type: Literal[ - "usage_exceeded", - "cost_exceeded", - "credit_balance_depleted", - "credit_balance_dropped", - "credit_balance_recovered", - ], + type: Literal["usage_exceeded", "cost_exceeded"], metric_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/orb/types/alert.py b/src/orb/types/alert.py index 0ef04360..b5e25436 100644 --- a/src/orb/types/alert.py +++ b/src/orb/types/alert.py @@ -79,10 +79,10 @@ class Alert(BaseModel): """ type: Literal[ - "usage_exceeded", - "cost_exceeded", "credit_balance_depleted", "credit_balance_dropped", "credit_balance_recovered", + "usage_exceeded", + "cost_exceeded", ] """The type of alert. This must be a valid alert type.""" diff --git a/src/orb/types/alert_create_for_customer_params.py b/src/orb/types/alert_create_for_customer_params.py index 5eeec557..2e2c77d9 100644 --- a/src/orb/types/alert_create_for_customer_params.py +++ b/src/orb/types/alert_create_for_customer_params.py @@ -12,15 +12,7 @@ class AlertCreateForCustomerParams(TypedDict, total=False): currency: Required[str] """The case sensitive currency or custom pricing unit to use for this alert.""" - type: Required[ - Literal[ - "usage_exceeded", - "cost_exceeded", - "credit_balance_depleted", - "credit_balance_dropped", - "credit_balance_recovered", - ] - ] + type: Required[Literal["credit_balance_depleted", "credit_balance_dropped", "credit_balance_recovered"]] """The type of alert to create. This must be a valid alert type.""" thresholds: Optional[Iterable[Threshold]] diff --git a/src/orb/types/alert_create_for_external_customer_params.py b/src/orb/types/alert_create_for_external_customer_params.py index 6732f61c..4c452e7f 100644 --- a/src/orb/types/alert_create_for_external_customer_params.py +++ b/src/orb/types/alert_create_for_external_customer_params.py @@ -12,15 +12,7 @@ class AlertCreateForExternalCustomerParams(TypedDict, total=False): currency: Required[str] """The case sensitive currency or custom pricing unit to use for this alert.""" - type: Required[ - Literal[ - "usage_exceeded", - "cost_exceeded", - "credit_balance_depleted", - "credit_balance_dropped", - "credit_balance_recovered", - ] - ] + type: Required[Literal["credit_balance_depleted", "credit_balance_dropped", "credit_balance_recovered"]] """The type of alert to create. This must be a valid alert type.""" thresholds: Optional[Iterable[Threshold]] diff --git a/src/orb/types/alert_create_for_subscription_params.py b/src/orb/types/alert_create_for_subscription_params.py index 767408dc..e91ce1ab 100644 --- a/src/orb/types/alert_create_for_subscription_params.py +++ b/src/orb/types/alert_create_for_subscription_params.py @@ -12,15 +12,7 @@ class AlertCreateForSubscriptionParams(TypedDict, total=False): thresholds: Required[Iterable[Threshold]] """The thresholds that define the values at which the alert will be triggered.""" - type: Required[ - Literal[ - "usage_exceeded", - "cost_exceeded", - "credit_balance_depleted", - "credit_balance_dropped", - "credit_balance_recovered", - ] - ] + type: Required[Literal["usage_exceeded", "cost_exceeded"]] """The type of alert to create. This must be a valid alert type.""" metric_id: Optional[str] diff --git a/src/orb/types/invoice.py b/src/orb/types/invoice.py index ebc09d4e..f979503d 100644 --- a/src/orb/types/invoice.py +++ b/src/orb/types/invoice.py @@ -605,7 +605,11 @@ class LineItem(BaseModel): """ adjustments: List[LineItemAdjustment] - """All adjustments (ie. maximums, minimums, discounts) applied to the line item.""" + """ + All adjustments applied to the line item in the order they were applied based on + invoice calculations (ie. usage discounts -> amount discounts -> percentage + discounts -> minimums -> maximums). + """ amount: str """ diff --git a/src/orb/types/invoice_fetch_upcoming_response.py b/src/orb/types/invoice_fetch_upcoming_response.py index ca7af8dc..fa2cc709 100644 --- a/src/orb/types/invoice_fetch_upcoming_response.py +++ b/src/orb/types/invoice_fetch_upcoming_response.py @@ -605,7 +605,11 @@ class LineItem(BaseModel): """ adjustments: List[LineItemAdjustment] - """All adjustments (ie. maximums, minimums, discounts) applied to the line item.""" + """ + All adjustments applied to the line item in the order they were applied based on + invoice calculations (ie. usage discounts -> amount discounts -> percentage + discounts -> minimums -> maximums). + """ amount: str """ diff --git a/src/orb/types/invoice_line_item_create_response.py b/src/orb/types/invoice_line_item_create_response.py index b046e206..d4af6fff 100644 --- a/src/orb/types/invoice_line_item_create_response.py +++ b/src/orb/types/invoice_line_item_create_response.py @@ -309,7 +309,11 @@ class InvoiceLineItemCreateResponse(BaseModel): """ adjustments: List[Adjustment] - """All adjustments (ie. maximums, minimums, discounts) applied to the line item.""" + """ + All adjustments applied to the line item in the order they were applied based on + invoice calculations (ie. usage discounts -> amount discounts -> percentage + discounts -> minimums -> maximums). + """ amount: str """ diff --git a/src/orb/types/subscription.py b/src/orb/types/subscription.py index f6118f04..85454c04 100644 --- a/src/orb/types/subscription.py +++ b/src/orb/types/subscription.py @@ -439,7 +439,10 @@ class Subscription(BaseModel): """ adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" + """ + The adjustment intervals for this subscription sorted by the start_date of the + adjustment interval. + """ auto_collection: Optional[bool] = None """ @@ -503,7 +506,7 @@ class Subscription(BaseModel): """ discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" + """The discount intervals for this subscription sorted by the start_date.""" end_date: Optional[datetime] = None """The date Orb stops billing for this subscription.""" @@ -513,7 +516,7 @@ class Subscription(BaseModel): invoicing_threshold: Optional[str] = None maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" + """The maximum intervals for this subscription sorted by the start_date.""" metadata: Dict[str, str] """User specified key-value pairs for the resource. @@ -524,7 +527,7 @@ class Subscription(BaseModel): """ minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" + """The minimum intervals for this subscription sorted by the start_date.""" net_terms: int """ diff --git a/src/orb/types/subscription_cancel_response.py b/src/orb/types/subscription_cancel_response.py index 797ecfe3..700b020c 100644 --- a/src/orb/types/subscription_cancel_response.py +++ b/src/orb/types/subscription_cancel_response.py @@ -439,7 +439,10 @@ class SubscriptionCancelResponse(BaseModel): """ adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" + """ + The adjustment intervals for this subscription sorted by the start_date of the + adjustment interval. + """ auto_collection: Optional[bool] = None """ @@ -503,7 +506,7 @@ class SubscriptionCancelResponse(BaseModel): """ discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" + """The discount intervals for this subscription sorted by the start_date.""" end_date: Optional[datetime] = None """The date Orb stops billing for this subscription.""" @@ -513,7 +516,7 @@ class SubscriptionCancelResponse(BaseModel): invoicing_threshold: Optional[str] = None maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" + """The maximum intervals for this subscription sorted by the start_date.""" metadata: Dict[str, str] """User specified key-value pairs for the resource. @@ -524,7 +527,7 @@ class SubscriptionCancelResponse(BaseModel): """ minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" + """The minimum intervals for this subscription sorted by the start_date.""" net_terms: int """ diff --git a/src/orb/types/subscription_create_response.py b/src/orb/types/subscription_create_response.py index 5a494c5f..ab422df8 100644 --- a/src/orb/types/subscription_create_response.py +++ b/src/orb/types/subscription_create_response.py @@ -439,7 +439,10 @@ class SubscriptionCreateResponse(BaseModel): """ adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" + """ + The adjustment intervals for this subscription sorted by the start_date of the + adjustment interval. + """ auto_collection: Optional[bool] = None """ @@ -503,7 +506,7 @@ class SubscriptionCreateResponse(BaseModel): """ discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" + """The discount intervals for this subscription sorted by the start_date.""" end_date: Optional[datetime] = None """The date Orb stops billing for this subscription.""" @@ -513,7 +516,7 @@ class SubscriptionCreateResponse(BaseModel): invoicing_threshold: Optional[str] = None maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" + """The maximum intervals for this subscription sorted by the start_date.""" metadata: Dict[str, str] """User specified key-value pairs for the resource. @@ -524,7 +527,7 @@ class SubscriptionCreateResponse(BaseModel): """ minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" + """The minimum intervals for this subscription sorted by the start_date.""" net_terms: int """ diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index 0ae10958..ce28d218 100644 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -2803,14 +2803,18 @@ class AddAdjustment(TypedDict, total=False): """The start date of the adjustment interval. This is the date that the adjustment will start affecting prices on the - subscription. + subscription. The adjustment will apply to invoice dates that overlap with this + `start_date`. This `start_date` is treated as inclusive for in-advance prices, + and exclusive for in-arrears prices. """ end_date: Annotated[Union[Union[str, datetime], BillingCycleRelativeDate, None], PropertyInfo(format="iso8601")] """The end date of the adjustment interval. This is the date that the adjustment will stop affecting prices on the - subscription. + subscription. The adjustment will apply to invoice dates that overlap with this + `end_date`.This `end_date` is treated as exclusive for in-advance prices, and + inclusive for in-arrears prices. """ diff --git a/src/orb/types/subscription_price_intervals_response.py b/src/orb/types/subscription_price_intervals_response.py index 0dc1d984..b2652d91 100644 --- a/src/orb/types/subscription_price_intervals_response.py +++ b/src/orb/types/subscription_price_intervals_response.py @@ -439,7 +439,10 @@ class SubscriptionPriceIntervalsResponse(BaseModel): """ adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" + """ + The adjustment intervals for this subscription sorted by the start_date of the + adjustment interval. + """ auto_collection: Optional[bool] = None """ @@ -503,7 +506,7 @@ class SubscriptionPriceIntervalsResponse(BaseModel): """ discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" + """The discount intervals for this subscription sorted by the start_date.""" end_date: Optional[datetime] = None """The date Orb stops billing for this subscription.""" @@ -513,7 +516,7 @@ class SubscriptionPriceIntervalsResponse(BaseModel): invoicing_threshold: Optional[str] = None maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" + """The maximum intervals for this subscription sorted by the start_date.""" metadata: Dict[str, str] """User specified key-value pairs for the resource. @@ -524,7 +527,7 @@ class SubscriptionPriceIntervalsResponse(BaseModel): """ minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" + """The minimum intervals for this subscription sorted by the start_date.""" net_terms: int """ diff --git a/src/orb/types/subscription_schedule_plan_change_response.py b/src/orb/types/subscription_schedule_plan_change_response.py index 5549771f..669fe675 100644 --- a/src/orb/types/subscription_schedule_plan_change_response.py +++ b/src/orb/types/subscription_schedule_plan_change_response.py @@ -439,7 +439,10 @@ class SubscriptionSchedulePlanChangeResponse(BaseModel): """ adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" + """ + The adjustment intervals for this subscription sorted by the start_date of the + adjustment interval. + """ auto_collection: Optional[bool] = None """ @@ -503,7 +506,7 @@ class SubscriptionSchedulePlanChangeResponse(BaseModel): """ discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" + """The discount intervals for this subscription sorted by the start_date.""" end_date: Optional[datetime] = None """The date Orb stops billing for this subscription.""" @@ -513,7 +516,7 @@ class SubscriptionSchedulePlanChangeResponse(BaseModel): invoicing_threshold: Optional[str] = None maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" + """The maximum intervals for this subscription sorted by the start_date.""" metadata: Dict[str, str] """User specified key-value pairs for the resource. @@ -524,7 +527,7 @@ class SubscriptionSchedulePlanChangeResponse(BaseModel): """ minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" + """The minimum intervals for this subscription sorted by the start_date.""" net_terms: int """ diff --git a/src/orb/types/subscription_trigger_phase_response.py b/src/orb/types/subscription_trigger_phase_response.py index a0891557..55c038c5 100644 --- a/src/orb/types/subscription_trigger_phase_response.py +++ b/src/orb/types/subscription_trigger_phase_response.py @@ -439,7 +439,10 @@ class SubscriptionTriggerPhaseResponse(BaseModel): """ adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" + """ + The adjustment intervals for this subscription sorted by the start_date of the + adjustment interval. + """ auto_collection: Optional[bool] = None """ @@ -503,7 +506,7 @@ class SubscriptionTriggerPhaseResponse(BaseModel): """ discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" + """The discount intervals for this subscription sorted by the start_date.""" end_date: Optional[datetime] = None """The date Orb stops billing for this subscription.""" @@ -513,7 +516,7 @@ class SubscriptionTriggerPhaseResponse(BaseModel): invoicing_threshold: Optional[str] = None maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" + """The maximum intervals for this subscription sorted by the start_date.""" metadata: Dict[str, str] """User specified key-value pairs for the resource. @@ -524,7 +527,7 @@ class SubscriptionTriggerPhaseResponse(BaseModel): """ minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" + """The minimum intervals for this subscription sorted by the start_date.""" net_terms: int """ diff --git a/src/orb/types/subscription_unschedule_cancellation_response.py b/src/orb/types/subscription_unschedule_cancellation_response.py index f084f56a..a6629fd9 100644 --- a/src/orb/types/subscription_unschedule_cancellation_response.py +++ b/src/orb/types/subscription_unschedule_cancellation_response.py @@ -439,7 +439,10 @@ class SubscriptionUnscheduleCancellationResponse(BaseModel): """ adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" + """ + The adjustment intervals for this subscription sorted by the start_date of the + adjustment interval. + """ auto_collection: Optional[bool] = None """ @@ -503,7 +506,7 @@ class SubscriptionUnscheduleCancellationResponse(BaseModel): """ discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" + """The discount intervals for this subscription sorted by the start_date.""" end_date: Optional[datetime] = None """The date Orb stops billing for this subscription.""" @@ -513,7 +516,7 @@ class SubscriptionUnscheduleCancellationResponse(BaseModel): invoicing_threshold: Optional[str] = None maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" + """The maximum intervals for this subscription sorted by the start_date.""" metadata: Dict[str, str] """User specified key-value pairs for the resource. @@ -524,7 +527,7 @@ class SubscriptionUnscheduleCancellationResponse(BaseModel): """ minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" + """The minimum intervals for this subscription sorted by the start_date.""" net_terms: int """ diff --git a/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py b/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py index 6e27be58..910e45d4 100644 --- a/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py +++ b/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py @@ -439,7 +439,10 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse(BaseModel): """ adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" + """ + The adjustment intervals for this subscription sorted by the start_date of the + adjustment interval. + """ auto_collection: Optional[bool] = None """ @@ -503,7 +506,7 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse(BaseModel): """ discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" + """The discount intervals for this subscription sorted by the start_date.""" end_date: Optional[datetime] = None """The date Orb stops billing for this subscription.""" @@ -513,7 +516,7 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse(BaseModel): invoicing_threshold: Optional[str] = None maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" + """The maximum intervals for this subscription sorted by the start_date.""" metadata: Dict[str, str] """User specified key-value pairs for the resource. @@ -524,7 +527,7 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse(BaseModel): """ minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" + """The minimum intervals for this subscription sorted by the start_date.""" net_terms: int """ diff --git a/src/orb/types/subscription_unschedule_pending_plan_changes_response.py b/src/orb/types/subscription_unschedule_pending_plan_changes_response.py index 3d5943a6..9d7342a9 100644 --- a/src/orb/types/subscription_unschedule_pending_plan_changes_response.py +++ b/src/orb/types/subscription_unschedule_pending_plan_changes_response.py @@ -439,7 +439,10 @@ class SubscriptionUnschedulePendingPlanChangesResponse(BaseModel): """ adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" + """ + The adjustment intervals for this subscription sorted by the start_date of the + adjustment interval. + """ auto_collection: Optional[bool] = None """ @@ -503,7 +506,7 @@ class SubscriptionUnschedulePendingPlanChangesResponse(BaseModel): """ discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" + """The discount intervals for this subscription sorted by the start_date.""" end_date: Optional[datetime] = None """The date Orb stops billing for this subscription.""" @@ -513,7 +516,7 @@ class SubscriptionUnschedulePendingPlanChangesResponse(BaseModel): invoicing_threshold: Optional[str] = None maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" + """The maximum intervals for this subscription sorted by the start_date.""" metadata: Dict[str, str] """User specified key-value pairs for the resource. @@ -524,7 +527,7 @@ class SubscriptionUnschedulePendingPlanChangesResponse(BaseModel): """ minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" + """The minimum intervals for this subscription sorted by the start_date.""" net_terms: int """ diff --git a/src/orb/types/subscription_update_fixed_fee_quantity_response.py b/src/orb/types/subscription_update_fixed_fee_quantity_response.py index 4be85ee3..74110564 100644 --- a/src/orb/types/subscription_update_fixed_fee_quantity_response.py +++ b/src/orb/types/subscription_update_fixed_fee_quantity_response.py @@ -439,7 +439,10 @@ class SubscriptionUpdateFixedFeeQuantityResponse(BaseModel): """ adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" + """ + The adjustment intervals for this subscription sorted by the start_date of the + adjustment interval. + """ auto_collection: Optional[bool] = None """ @@ -503,7 +506,7 @@ class SubscriptionUpdateFixedFeeQuantityResponse(BaseModel): """ discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" + """The discount intervals for this subscription sorted by the start_date.""" end_date: Optional[datetime] = None """The date Orb stops billing for this subscription.""" @@ -513,7 +516,7 @@ class SubscriptionUpdateFixedFeeQuantityResponse(BaseModel): invoicing_threshold: Optional[str] = None maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" + """The maximum intervals for this subscription sorted by the start_date.""" metadata: Dict[str, str] """User specified key-value pairs for the resource. @@ -524,7 +527,7 @@ class SubscriptionUpdateFixedFeeQuantityResponse(BaseModel): """ minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" + """The minimum intervals for this subscription sorted by the start_date.""" net_terms: int """ diff --git a/src/orb/types/subscription_update_trial_response.py b/src/orb/types/subscription_update_trial_response.py index c56975f6..2b8ae20e 100644 --- a/src/orb/types/subscription_update_trial_response.py +++ b/src/orb/types/subscription_update_trial_response.py @@ -439,7 +439,10 @@ class SubscriptionUpdateTrialResponse(BaseModel): """ adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" + """ + The adjustment intervals for this subscription sorted by the start_date of the + adjustment interval. + """ auto_collection: Optional[bool] = None """ @@ -503,7 +506,7 @@ class SubscriptionUpdateTrialResponse(BaseModel): """ discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" + """The discount intervals for this subscription sorted by the start_date.""" end_date: Optional[datetime] = None """The date Orb stops billing for this subscription.""" @@ -513,7 +516,7 @@ class SubscriptionUpdateTrialResponse(BaseModel): invoicing_threshold: Optional[str] = None maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" + """The maximum intervals for this subscription sorted by the start_date.""" metadata: Dict[str, str] """User specified key-value pairs for the resource. @@ -524,7 +527,7 @@ class SubscriptionUpdateTrialResponse(BaseModel): """ minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" + """The minimum intervals for this subscription sorted by the start_date.""" net_terms: int """ diff --git a/tests/api_resources/test_alerts.py b/tests/api_resources/test_alerts.py index 568aa4ea..b12409c4 100644 --- a/tests/api_resources/test_alerts.py +++ b/tests/api_resources/test_alerts.py @@ -152,7 +152,7 @@ def test_method_create_for_customer(self, client: Orb) -> None: alert = client.alerts.create_for_customer( customer_id="customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) assert_matches_type(Alert, alert, path=["response"]) @@ -161,7 +161,7 @@ def test_method_create_for_customer_with_all_params(self, client: Orb) -> None: alert = client.alerts.create_for_customer( customer_id="customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", thresholds=[{"value": 0}], ) assert_matches_type(Alert, alert, path=["response"]) @@ -171,7 +171,7 @@ def test_raw_response_create_for_customer(self, client: Orb) -> None: response = client.alerts.with_raw_response.create_for_customer( customer_id="customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) assert response.is_closed is True @@ -184,7 +184,7 @@ def test_streaming_response_create_for_customer(self, client: Orb) -> None: with client.alerts.with_streaming_response.create_for_customer( customer_id="customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -200,7 +200,7 @@ def test_path_params_create_for_customer(self, client: Orb) -> None: client.alerts.with_raw_response.create_for_customer( customer_id="", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) @parametrize @@ -208,7 +208,7 @@ def test_method_create_for_external_customer(self, client: Orb) -> None: alert = client.alerts.create_for_external_customer( external_customer_id="external_customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) assert_matches_type(Alert, alert, path=["response"]) @@ -217,7 +217,7 @@ def test_method_create_for_external_customer_with_all_params(self, client: Orb) alert = client.alerts.create_for_external_customer( external_customer_id="external_customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", thresholds=[{"value": 0}], ) assert_matches_type(Alert, alert, path=["response"]) @@ -227,7 +227,7 @@ def test_raw_response_create_for_external_customer(self, client: Orb) -> None: response = client.alerts.with_raw_response.create_for_external_customer( external_customer_id="external_customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) assert response.is_closed is True @@ -240,7 +240,7 @@ def test_streaming_response_create_for_external_customer(self, client: Orb) -> N with client.alerts.with_streaming_response.create_for_external_customer( external_customer_id="external_customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -256,7 +256,7 @@ def test_path_params_create_for_external_customer(self, client: Orb) -> None: client.alerts.with_raw_response.create_for_external_customer( external_customer_id="", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) @parametrize @@ -546,7 +546,7 @@ async def test_method_create_for_customer(self, async_client: AsyncOrb) -> None: alert = await async_client.alerts.create_for_customer( customer_id="customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) assert_matches_type(Alert, alert, path=["response"]) @@ -555,7 +555,7 @@ async def test_method_create_for_customer_with_all_params(self, async_client: As alert = await async_client.alerts.create_for_customer( customer_id="customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", thresholds=[{"value": 0}], ) assert_matches_type(Alert, alert, path=["response"]) @@ -565,7 +565,7 @@ async def test_raw_response_create_for_customer(self, async_client: AsyncOrb) -> response = await async_client.alerts.with_raw_response.create_for_customer( customer_id="customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) assert response.is_closed is True @@ -578,7 +578,7 @@ async def test_streaming_response_create_for_customer(self, async_client: AsyncO async with async_client.alerts.with_streaming_response.create_for_customer( customer_id="customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -594,7 +594,7 @@ async def test_path_params_create_for_customer(self, async_client: AsyncOrb) -> await async_client.alerts.with_raw_response.create_for_customer( customer_id="", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) @parametrize @@ -602,7 +602,7 @@ async def test_method_create_for_external_customer(self, async_client: AsyncOrb) alert = await async_client.alerts.create_for_external_customer( external_customer_id="external_customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) assert_matches_type(Alert, alert, path=["response"]) @@ -611,7 +611,7 @@ async def test_method_create_for_external_customer_with_all_params(self, async_c alert = await async_client.alerts.create_for_external_customer( external_customer_id="external_customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", thresholds=[{"value": 0}], ) assert_matches_type(Alert, alert, path=["response"]) @@ -621,7 +621,7 @@ async def test_raw_response_create_for_external_customer(self, async_client: Asy response = await async_client.alerts.with_raw_response.create_for_external_customer( external_customer_id="external_customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) assert response.is_closed is True @@ -634,7 +634,7 @@ async def test_streaming_response_create_for_external_customer(self, async_clien async with async_client.alerts.with_streaming_response.create_for_external_customer( external_customer_id="external_customer_id", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -650,7 +650,7 @@ async def test_path_params_create_for_external_customer(self, async_client: Asyn await async_client.alerts.with_raw_response.create_for_external_customer( external_customer_id="", currency="currency", - type="usage_exceeded", + type="credit_balance_depleted", ) @parametrize diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 1e87e427..b5cf7ca7 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -43,7 +43,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: ], "excluded": True, }, - additional_emails=["string"], + additional_emails=["dev@stainless.com"], auto_collection=True, billing_address={ "city": "city", @@ -556,7 +556,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No ], "excluded": True, }, - additional_emails=["string"], + additional_emails=["dev@stainless.com"], auto_collection=True, billing_address={ "city": "city",