Skip to content

Commit 71281fc

Browse files
feat(api): api update
1 parent 66bf6f8 commit 71281fc

13 files changed

+1661
-8
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-297c7ce95bc0aa1ac6f324a487515f49b8a30b74eb9d39ca9dcd2d9cf065f0ef.yml
3-
openapi_spec_hash: 29e9af981bc78379336079bb4208c54d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-b070c1d97a6e3b400f43d2bce36c22ed89d432345b26374728c55dd0a20f0afa.yml
3+
openapi_spec_hash: dba4ff52c381cda6159fc56d8b77eb32
44
config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2

src/orb/resources/prices/prices.py

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,6 +2671,102 @@ def create(
26712671
"""
26722672
...
26732673

2674+
@overload
2675+
def create(
2676+
self,
2677+
*,
2678+
cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"],
2679+
currency: str,
2680+
item_id: str,
2681+
model_type: Literal["percent"],
2682+
name: str,
2683+
percent_config: price_create_params.NewFloatingPercentCompositePricePercentConfig,
2684+
billable_metric_id: Optional[str] | Omit = omit,
2685+
billed_in_advance: Optional[bool] | Omit = omit,
2686+
billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit,
2687+
conversion_rate: Optional[float] | Omit = omit,
2688+
conversion_rate_config: Optional[price_create_params.NewFloatingPercentCompositePriceConversionRateConfig]
2689+
| Omit = omit,
2690+
dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | Omit = omit,
2691+
external_price_id: Optional[str] | Omit = omit,
2692+
fixed_price_quantity: Optional[float] | Omit = omit,
2693+
invoice_grouping_key: Optional[str] | Omit = omit,
2694+
invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit,
2695+
metadata: Optional[Dict[str, Optional[str]]] | Omit = omit,
2696+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2697+
# The extra values given here take precedence over values defined on the client or passed to this method.
2698+
extra_headers: Headers | None = None,
2699+
extra_query: Query | None = None,
2700+
extra_body: Body | None = None,
2701+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
2702+
idempotency_key: str | None = None,
2703+
) -> Price:
2704+
"""
2705+
This endpoint is used to create a [price](/product-catalog/price-configuration).
2706+
A price created using this endpoint is always an add-on, meaning that it's not
2707+
associated with a specific plan and can instead be individually added to
2708+
subscriptions, including subscriptions on different plans.
2709+
2710+
An `external_price_id` can be optionally specified as an alias to allow
2711+
ergonomic interaction with prices in the Orb API.
2712+
2713+
See the [Price resource](/product-catalog/price-configuration) for the
2714+
specification of different price model configurations possible in this endpoint.
2715+
2716+
Args:
2717+
cadence: The cadence to bill for this price on.
2718+
2719+
currency: An ISO 4217 currency string for which this price is billed in.
2720+
2721+
item_id: The id of the item the price will be associated with.
2722+
2723+
model_type: The pricing model type
2724+
2725+
name: The name of the price.
2726+
2727+
percent_config: Configuration for percent pricing
2728+
2729+
billable_metric_id: The id of the billable metric for the price. Only needed if the price is
2730+
usage-based.
2731+
2732+
billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if
2733+
this is true, and in-arrears if this is false.
2734+
2735+
billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or
2736+
months.
2737+
2738+
conversion_rate: The per unit conversion rate of the price currency to the invoicing currency.
2739+
2740+
conversion_rate_config: The configuration for the rate of the price currency to the invoicing currency.
2741+
2742+
dimensional_price_configuration: For dimensional price: specifies a price group and dimension values
2743+
2744+
external_price_id: An alias for the price.
2745+
2746+
fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units
2747+
applied.
2748+
2749+
invoice_grouping_key: The property used to group this price on an invoice
2750+
2751+
invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced.
2752+
If unspecified, a single invoice is produced per billing cycle.
2753+
2754+
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
2755+
by setting the value to `null`, and the entire metadata mapping can be cleared
2756+
by setting `metadata` to `null`.
2757+
2758+
extra_headers: Send extra headers
2759+
2760+
extra_query: Add additional query parameters to the request
2761+
2762+
extra_body: Add additional JSON properties to the request
2763+
2764+
timeout: Override the client-level default timeout for this request, in seconds
2765+
2766+
idempotency_key: Specify a custom idempotency key for this request
2767+
"""
2768+
...
2769+
26742770
@overload
26752771
def create(
26762772
self,
@@ -2795,6 +2891,7 @@ def create(
27952891
["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_tiered_pricing_config"],
27962892
["cadence", "cumulative_grouped_bulk_config", "currency", "item_id", "model_type", "name"],
27972893
["cadence", "currency", "item_id", "minimum_config", "model_type", "name"],
2894+
["cadence", "currency", "item_id", "model_type", "name", "percent_config"],
27982895
["cadence", "currency", "event_output_config", "item_id", "model_type", "name"],
27992896
)
28002897
def create(
@@ -2830,6 +2927,7 @@ def create(
28302927
| Literal["scalable_matrix_with_tiered_pricing"]
28312928
| Literal["cumulative_grouped_bulk"]
28322929
| Literal["minimum"]
2930+
| Literal["percent"]
28332931
| Literal["event_output"],
28342932
name: str,
28352933
unit_config: UnitConfig | Omit = omit,
@@ -2864,6 +2962,7 @@ def create(
28642962
| Optional[price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig]
28652963
| Optional[price_create_params.NewFloatingCumulativeGroupedBulkPriceConversionRateConfig]
28662964
| Optional[price_create_params.NewFloatingMinimumCompositePriceConversionRateConfig]
2965+
| Optional[price_create_params.NewFloatingPercentCompositePriceConversionRateConfig]
28672966
| Optional[price_create_params.NewFloatingEventOutputPriceConversionRateConfig]
28682967
| Omit = omit,
28692968
dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | Omit = omit,
@@ -2916,6 +3015,7 @@ def create(
29163015
cumulative_grouped_bulk_config: price_create_params.NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig
29173016
| Omit = omit,
29183017
minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig | Omit = omit,
3018+
percent_config: price_create_params.NewFloatingPercentCompositePricePercentConfig | Omit = omit,
29193019
event_output_config: price_create_params.NewFloatingEventOutputPriceEventOutputConfig | Omit = omit,
29203020
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
29213021
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2974,6 +3074,7 @@ def create(
29743074
"scalable_matrix_with_tiered_pricing_config": scalable_matrix_with_tiered_pricing_config,
29753075
"cumulative_grouped_bulk_config": cumulative_grouped_bulk_config,
29763076
"minimum_config": minimum_config,
3077+
"percent_config": percent_config,
29773078
"event_output_config": event_output_config,
29783079
},
29793080
price_create_params.PriceCreateParams,
@@ -6020,6 +6121,102 @@ async def create(
60206121
"""
60216122
...
60226123

6124+
@overload
6125+
async def create(
6126+
self,
6127+
*,
6128+
cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"],
6129+
currency: str,
6130+
item_id: str,
6131+
model_type: Literal["percent"],
6132+
name: str,
6133+
percent_config: price_create_params.NewFloatingPercentCompositePricePercentConfig,
6134+
billable_metric_id: Optional[str] | Omit = omit,
6135+
billed_in_advance: Optional[bool] | Omit = omit,
6136+
billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit,
6137+
conversion_rate: Optional[float] | Omit = omit,
6138+
conversion_rate_config: Optional[price_create_params.NewFloatingPercentCompositePriceConversionRateConfig]
6139+
| Omit = omit,
6140+
dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | Omit = omit,
6141+
external_price_id: Optional[str] | Omit = omit,
6142+
fixed_price_quantity: Optional[float] | Omit = omit,
6143+
invoice_grouping_key: Optional[str] | Omit = omit,
6144+
invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit,
6145+
metadata: Optional[Dict[str, Optional[str]]] | Omit = omit,
6146+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6147+
# The extra values given here take precedence over values defined on the client or passed to this method.
6148+
extra_headers: Headers | None = None,
6149+
extra_query: Query | None = None,
6150+
extra_body: Body | None = None,
6151+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
6152+
idempotency_key: str | None = None,
6153+
) -> Price:
6154+
"""
6155+
This endpoint is used to create a [price](/product-catalog/price-configuration).
6156+
A price created using this endpoint is always an add-on, meaning that it's not
6157+
associated with a specific plan and can instead be individually added to
6158+
subscriptions, including subscriptions on different plans.
6159+
6160+
An `external_price_id` can be optionally specified as an alias to allow
6161+
ergonomic interaction with prices in the Orb API.
6162+
6163+
See the [Price resource](/product-catalog/price-configuration) for the
6164+
specification of different price model configurations possible in this endpoint.
6165+
6166+
Args:
6167+
cadence: The cadence to bill for this price on.
6168+
6169+
currency: An ISO 4217 currency string for which this price is billed in.
6170+
6171+
item_id: The id of the item the price will be associated with.
6172+
6173+
model_type: The pricing model type
6174+
6175+
name: The name of the price.
6176+
6177+
percent_config: Configuration for percent pricing
6178+
6179+
billable_metric_id: The id of the billable metric for the price. Only needed if the price is
6180+
usage-based.
6181+
6182+
billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if
6183+
this is true, and in-arrears if this is false.
6184+
6185+
billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or
6186+
months.
6187+
6188+
conversion_rate: The per unit conversion rate of the price currency to the invoicing currency.
6189+
6190+
conversion_rate_config: The configuration for the rate of the price currency to the invoicing currency.
6191+
6192+
dimensional_price_configuration: For dimensional price: specifies a price group and dimension values
6193+
6194+
external_price_id: An alias for the price.
6195+
6196+
fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units
6197+
applied.
6198+
6199+
invoice_grouping_key: The property used to group this price on an invoice
6200+
6201+
invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced.
6202+
If unspecified, a single invoice is produced per billing cycle.
6203+
6204+
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
6205+
by setting the value to `null`, and the entire metadata mapping can be cleared
6206+
by setting `metadata` to `null`.
6207+
6208+
extra_headers: Send extra headers
6209+
6210+
extra_query: Add additional query parameters to the request
6211+
6212+
extra_body: Add additional JSON properties to the request
6213+
6214+
timeout: Override the client-level default timeout for this request, in seconds
6215+
6216+
idempotency_key: Specify a custom idempotency key for this request
6217+
"""
6218+
...
6219+
60236220
@overload
60246221
async def create(
60256222
self,
@@ -6144,6 +6341,7 @@ async def create(
61446341
["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_tiered_pricing_config"],
61456342
["cadence", "cumulative_grouped_bulk_config", "currency", "item_id", "model_type", "name"],
61466343
["cadence", "currency", "item_id", "minimum_config", "model_type", "name"],
6344+
["cadence", "currency", "item_id", "model_type", "name", "percent_config"],
61476345
["cadence", "currency", "event_output_config", "item_id", "model_type", "name"],
61486346
)
61496347
async def create(
@@ -6179,6 +6377,7 @@ async def create(
61796377
| Literal["scalable_matrix_with_tiered_pricing"]
61806378
| Literal["cumulative_grouped_bulk"]
61816379
| Literal["minimum"]
6380+
| Literal["percent"]
61826381
| Literal["event_output"],
61836382
name: str,
61846383
unit_config: UnitConfig | Omit = omit,
@@ -6213,6 +6412,7 @@ async def create(
62136412
| Optional[price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig]
62146413
| Optional[price_create_params.NewFloatingCumulativeGroupedBulkPriceConversionRateConfig]
62156414
| Optional[price_create_params.NewFloatingMinimumCompositePriceConversionRateConfig]
6415+
| Optional[price_create_params.NewFloatingPercentCompositePriceConversionRateConfig]
62166416
| Optional[price_create_params.NewFloatingEventOutputPriceConversionRateConfig]
62176417
| Omit = omit,
62186418
dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | Omit = omit,
@@ -6265,6 +6465,7 @@ async def create(
62656465
cumulative_grouped_bulk_config: price_create_params.NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig
62666466
| Omit = omit,
62676467
minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig | Omit = omit,
6468+
percent_config: price_create_params.NewFloatingPercentCompositePricePercentConfig | Omit = omit,
62686469
event_output_config: price_create_params.NewFloatingEventOutputPriceEventOutputConfig | Omit = omit,
62696470
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
62706471
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -6323,6 +6524,7 @@ async def create(
63236524
"scalable_matrix_with_tiered_pricing_config": scalable_matrix_with_tiered_pricing_config,
63246525
"cumulative_grouped_bulk_config": cumulative_grouped_bulk_config,
63256526
"minimum_config": minimum_config,
6527+
"percent_config": percent_config,
63266528
"event_output_config": event_output_config,
63276529
},
63286530
price_create_params.PriceCreateParams,

0 commit comments

Comments
 (0)