Skip to content

feat(api): api update #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2025
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: 101
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e480186cdd0e2cc631befa7e2c6ba5f2d7ae52052f0e79a748214f3ade8a98ee.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-7fca89ba5a0b4997358c25e6cdfb616a1d8b93a6820e25078f3fa5f61110bfe6.yml
8 changes: 6 additions & 2 deletions src/orb/resources/customers/customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ def delete(
provided the customer does not have any issued invoices. Customers with issued
invoices cannot be deleted. This operation is irreversible. Note that this is a
_soft_ deletion, but the data will be inaccessible through the API and Orb
dashboard. For a hard-deletion, please reach out to the Orb team directly.
dashboard.

For a hard-deletion, please reach out to the Orb team directly.

**Note**: This operation happens asynchronously and can be expected to take a
few minutes to propagate to related resources. However, querying for the
Expand Down Expand Up @@ -1514,7 +1516,9 @@ async def delete(
provided the customer does not have any issued invoices. Customers with issued
invoices cannot be deleted. This operation is irreversible. Note that this is a
_soft_ deletion, but the data will be inaccessible through the API and Orb
dashboard. For a hard-deletion, please reach out to the Orb team directly.
dashboard.

For a hard-deletion, please reach out to the Orb team directly.

**Note**: This operation happens asynchronously and can be expected to take a
few minutes to propagate to related resources. However, querying for the
Expand Down
4 changes: 2 additions & 2 deletions src/orb/resources/events/backfills.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def create(
affect all customers.

When `replace_existing_events` is `true`, this indicates that existing events in
the timeframe should no longer be counter towards invoiced usage. In this
the timeframe should no longer be counted towards invoiced usage. In this
scenario, the parameter `filter` can be optionally added which enables filtering
using
[computed properties](/extensibility/advanced-metrics#computed-properties). The
Expand Down Expand Up @@ -410,7 +410,7 @@ async def create(
affect all customers.

When `replace_existing_events` is `true`, this indicates that existing events in
the timeframe should no longer be counter towards invoiced usage. In this
the timeframe should no longer be counted towards invoiced usage. In this
scenario, the parameter `filter` can be optionally added which enables filtering
using
[computed properties](/extensibility/advanced-metrics#computed-properties). The
Expand Down
190 changes: 190 additions & 0 deletions src/orb/resources/prices/prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,97 @@ def create(
"""
...

@overload
def create(
self,
*,
cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"],
currency: str,
item_id: str,
max_group_tiered_config: Dict[str, object],
model_type: Literal["max_group_tiered"],
name: str,
billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN,
billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN,
billing_cycle_configuration: Optional[
price_create_params.NewFloatingMaxGroupTieredPriceBillingCycleConfiguration
]
| NotGiven = NOT_GIVEN,
conversion_rate: Optional[float] | NotGiven = NOT_GIVEN,
external_price_id: Optional[str] | NotGiven = NOT_GIVEN,
fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN,
invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN,
invoicing_cycle_configuration: Optional[
price_create_params.NewFloatingMaxGroupTieredPriceInvoicingCycleConfiguration
]
| NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, 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.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> Price:
"""
This endpoint is used to create a [price](/product-catalog/price-configuration).
A price created using this endpoint is always an add-on, meaning that it’s not
associated with a specific plan and can instead be individually added to
subscriptions, including subscriptions on different plans.

An `external_price_id` can be optionally specified as an alias to allow
ergonomic interaction with prices in the Orb API.

See the [Price resource](/product-catalog/price-configuration) for the
specification of different price model configurations possible in this endpoint.

Args:
cadence: The cadence to bill for this price on.

currency: An ISO 4217 currency string for which this price is billed in.

item_id: The id of the item the plan will be associated with.

name: The name of the price.

billable_metric_id: The id of the billable metric for the price. Only needed if the price is
usage-based.

billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if
this is true, and in-arrears if this is false.

billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or
months.

conversion_rate: The per unit conversion rate of the price currency to the invoicing currency.

external_price_id: An alias for the price.

fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units
applied.

invoice_grouping_key: The property used to group this price on an invoice

invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced.
If unspecified, a single invoice is produced per billing cycle.

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`.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
...

@overload
def create(
self,
Expand Down Expand Up @@ -2226,6 +2317,7 @@ def create(
["cadence", "currency", "item_id", "model_type", "name", "threshold_total_amount_config"],
["cadence", "currency", "item_id", "model_type", "name", "tiered_package_config"],
["cadence", "currency", "grouped_tiered_config", "item_id", "model_type", "name"],
["cadence", "currency", "item_id", "max_group_tiered_config", "model_type", "name"],
["cadence", "currency", "item_id", "model_type", "name", "tiered_with_minimum_config"],
["cadence", "currency", "item_id", "model_type", "name", "package_with_allocation_config"],
["cadence", "currency", "item_id", "model_type", "name", "tiered_package_with_minimum_config"],
Expand Down Expand Up @@ -2257,6 +2349,7 @@ def create(
| Literal["threshold_total_amount"]
| Literal["tiered_package"]
| Literal["grouped_tiered"]
| Literal["max_group_tiered"]
| Literal["tiered_with_minimum"]
| Literal["package_with_allocation"]
| Literal["tiered_package_with_minimum"]
Expand Down Expand Up @@ -2294,6 +2387,7 @@ def create(
threshold_total_amount_config: Dict[str, object] | NotGiven = NOT_GIVEN,
tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN,
grouped_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN,
max_group_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN,
tiered_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN,
package_with_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN,
tiered_package_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -2346,6 +2440,7 @@ def create(
"threshold_total_amount_config": threshold_total_amount_config,
"tiered_package_config": tiered_package_config,
"grouped_tiered_config": grouped_tiered_config,
"max_group_tiered_config": max_group_tiered_config,
"tiered_with_minimum_config": tiered_with_minimum_config,
"package_with_allocation_config": package_with_allocation_config,
"tiered_package_with_minimum_config": tiered_package_with_minimum_config,
Expand Down Expand Up @@ -3689,6 +3784,97 @@ async def create(
"""
...

@overload
async def create(
self,
*,
cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"],
currency: str,
item_id: str,
max_group_tiered_config: Dict[str, object],
model_type: Literal["max_group_tiered"],
name: str,
billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN,
billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN,
billing_cycle_configuration: Optional[
price_create_params.NewFloatingMaxGroupTieredPriceBillingCycleConfiguration
]
| NotGiven = NOT_GIVEN,
conversion_rate: Optional[float] | NotGiven = NOT_GIVEN,
external_price_id: Optional[str] | NotGiven = NOT_GIVEN,
fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN,
invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN,
invoicing_cycle_configuration: Optional[
price_create_params.NewFloatingMaxGroupTieredPriceInvoicingCycleConfiguration
]
| NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, 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.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> Price:
"""
This endpoint is used to create a [price](/product-catalog/price-configuration).
A price created using this endpoint is always an add-on, meaning that it’s not
associated with a specific plan and can instead be individually added to
subscriptions, including subscriptions on different plans.

An `external_price_id` can be optionally specified as an alias to allow
ergonomic interaction with prices in the Orb API.

See the [Price resource](/product-catalog/price-configuration) for the
specification of different price model configurations possible in this endpoint.

Args:
cadence: The cadence to bill for this price on.

currency: An ISO 4217 currency string for which this price is billed in.

item_id: The id of the item the plan will be associated with.

name: The name of the price.

billable_metric_id: The id of the billable metric for the price. Only needed if the price is
usage-based.

billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if
this is true, and in-arrears if this is false.

billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or
months.

conversion_rate: The per unit conversion rate of the price currency to the invoicing currency.

external_price_id: An alias for the price.

fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units
applied.

invoice_grouping_key: The property used to group this price on an invoice

invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced.
If unspecified, a single invoice is produced per billing cycle.

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`.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
...

@overload
async def create(
self,
Expand Down Expand Up @@ -4794,6 +4980,7 @@ async def create(
["cadence", "currency", "item_id", "model_type", "name", "threshold_total_amount_config"],
["cadence", "currency", "item_id", "model_type", "name", "tiered_package_config"],
["cadence", "currency", "grouped_tiered_config", "item_id", "model_type", "name"],
["cadence", "currency", "item_id", "max_group_tiered_config", "model_type", "name"],
["cadence", "currency", "item_id", "model_type", "name", "tiered_with_minimum_config"],
["cadence", "currency", "item_id", "model_type", "name", "package_with_allocation_config"],
["cadence", "currency", "item_id", "model_type", "name", "tiered_package_with_minimum_config"],
Expand Down Expand Up @@ -4825,6 +5012,7 @@ async def create(
| Literal["threshold_total_amount"]
| Literal["tiered_package"]
| Literal["grouped_tiered"]
| Literal["max_group_tiered"]
| Literal["tiered_with_minimum"]
| Literal["package_with_allocation"]
| Literal["tiered_package_with_minimum"]
Expand Down Expand Up @@ -4862,6 +5050,7 @@ async def create(
threshold_total_amount_config: Dict[str, object] | NotGiven = NOT_GIVEN,
tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN,
grouped_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN,
max_group_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN,
tiered_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN,
package_with_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN,
tiered_package_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -4914,6 +5103,7 @@ async def create(
"threshold_total_amount_config": threshold_total_amount_config,
"tiered_package_config": tiered_package_config,
"grouped_tiered_config": grouped_tiered_config,
"max_group_tiered_config": max_group_tiered_config,
"tiered_with_minimum_config": tiered_with_minimum_config,
"package_with_allocation_config": package_with_allocation_config,
"tiered_package_with_minimum_config": tiered_package_with_minimum_config,
Expand Down
6 changes: 4 additions & 2 deletions src/orb/resources/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,8 @@ def schedule_plan_change(
billing cycle alignment.
change_date: The date that the plan change should take effect. This parameter can only be
passed if the `change_option` is `requested_date`.
passed if the `change_option` is `requested_date`. If a date with no time is
passed, the plan change will happen at midnight in the customer's timezone.
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
Expand Down Expand Up @@ -3549,7 +3550,8 @@ async def schedule_plan_change(
billing cycle alignment.
change_date: The date that the plan change should take effect. This parameter can only be
passed if the `change_option` is `requested_date`.
passed if the `change_option` is `requested_date`. If a date with no time is
passed, the plan change will happen at midnight in the customer's timezone.
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
Expand Down
Loading