Skip to content

Commit 71340f6

Browse files
feat(api): api update
1 parent 2366135 commit 71340f6

13 files changed

Lines changed: 2406 additions & 23 deletions

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 139
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-07428f2af8d77b3af7d838375b0fb5adce7fba2c8312ca84bcd8ef340d782bbc.yml
3-
openapi_spec_hash: 99d6e3e97bab8a25399a63f3db134542
3+
openapi_spec_hash: bba0e6257d3d2f8612c5ad14b95839e2
44
config_hash: c01c1191b1cd696c7ca855ff6d28a8df

src/orb/resources/prices/prices.py

Lines changed: 210 additions & 0 deletions
Large diffs are not rendered by default.

src/orb/types/beta/external_plan_id_create_plan_version_params.py

Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from typing import Dict, Union, Iterable, Optional
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

8+
from ..._types import SequenceNotStr
89
from ..shared_params.new_maximum import NewMaximum
910
from ..shared_params.new_minimum import NewMinimum
1011
from ..shared_params.unit_config import UnitConfig
@@ -68,6 +69,10 @@
6869
"AddPricePriceNewPlanCumulativeGroupedAllocationPrice",
6970
"AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig",
7071
"AddPricePriceNewPlanCumulativeGroupedAllocationPriceConversionRateConfig",
72+
"AddPricePriceNewPlanDailyCreditAllowancePrice",
73+
"AddPricePriceNewPlanDailyCreditAllowancePriceDailyCreditAllowanceConfig",
74+
"AddPricePriceNewPlanDailyCreditAllowancePriceDailyCreditAllowanceConfigMatrixValue",
75+
"AddPricePriceNewPlanDailyCreditAllowancePriceConversionRateConfig",
7176
"AddPricePriceNewPlanPercentCompositePrice",
7277
"AddPricePriceNewPlanPercentCompositePricePercentConfig",
7378
"AddPricePriceNewPlanPercentCompositePriceConversionRateConfig",
@@ -98,6 +103,10 @@
98103
"ReplacePricePriceNewPlanCumulativeGroupedAllocationPrice",
99104
"ReplacePricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig",
100105
"ReplacePricePriceNewPlanCumulativeGroupedAllocationPriceConversionRateConfig",
106+
"ReplacePricePriceNewPlanDailyCreditAllowancePrice",
107+
"ReplacePricePriceNewPlanDailyCreditAllowancePriceDailyCreditAllowanceConfig",
108+
"ReplacePricePriceNewPlanDailyCreditAllowancePriceDailyCreditAllowanceConfigMatrixValue",
109+
"ReplacePricePriceNewPlanDailyCreditAllowancePriceConversionRateConfig",
101110
"ReplacePricePriceNewPlanPercentCompositePrice",
102111
"ReplacePricePriceNewPlanPercentCompositePricePercentConfig",
103112
"ReplacePricePriceNewPlanPercentCompositePriceConversionRateConfig",
@@ -697,6 +706,137 @@ class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=Fals
697706
"""
698707

699708

709+
class AddPricePriceNewPlanDailyCreditAllowancePriceDailyCreditAllowanceConfigMatrixValue(TypedDict, total=False):
710+
"""Per-dimension credit price for the daily credit allowance model."""
711+
712+
dimension_values: Required[SequenceNotStr[Optional[str]]]
713+
"""One or two matrix keys to filter usage to this value by.
714+
715+
For example, ["model"] could be used to apply a different credit rate to each AI
716+
model.
717+
"""
718+
719+
unit_amount: Required[str]
720+
"""Credits charged per unit of usage matching the specified dimension_values"""
721+
722+
723+
class AddPricePriceNewPlanDailyCreditAllowancePriceDailyCreditAllowanceConfig(TypedDict, total=False):
724+
"""Configuration for daily_credit_allowance pricing"""
725+
726+
daily_allowance: Required[str]
727+
"""Credits granted per day. Lose-it-or-use-it; does not roll over."""
728+
729+
default_unit_amount: Required[str]
730+
"""
731+
Default per-unit credit rate for any usage not bucketed into a specified
732+
matrix_value
733+
"""
734+
735+
dimensions: Required[SequenceNotStr[Optional[str]]]
736+
"""One or two event property values to evaluate matrix groups by"""
737+
738+
event_day_property: Required[str]
739+
"""Event property whose value identifies the day bucket the event belongs to (e.g.
740+
741+
'event_day' set to an ISO date string in the customer's timezone). The allowance
742+
resets per distinct value of this property.
743+
"""
744+
745+
matrix_values: Required[
746+
Iterable[AddPricePriceNewPlanDailyCreditAllowancePriceDailyCreditAllowanceConfigMatrixValue]
747+
]
748+
"""Per-dimension credit rates"""
749+
750+
751+
AddPricePriceNewPlanDailyCreditAllowancePriceConversionRateConfig: TypeAlias = Union[
752+
UnitConversionRateConfig, TieredConversionRateConfig
753+
]
754+
755+
756+
class AddPricePriceNewPlanDailyCreditAllowancePrice(TypedDict, total=False):
757+
cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]]
758+
"""The cadence to bill for this price on."""
759+
760+
daily_credit_allowance_config: Required[AddPricePriceNewPlanDailyCreditAllowancePriceDailyCreditAllowanceConfig]
761+
"""Configuration for daily_credit_allowance pricing"""
762+
763+
item_id: Required[str]
764+
"""The id of the item the price will be associated with."""
765+
766+
model_type: Required[Literal["daily_credit_allowance"]]
767+
"""The pricing model type"""
768+
769+
name: Required[str]
770+
"""The name of the price."""
771+
772+
billable_metric_id: Optional[str]
773+
"""The id of the billable metric for the price.
774+
775+
Only needed if the price is usage-based.
776+
"""
777+
778+
billed_in_advance: Optional[bool]
779+
"""
780+
If the Price represents a fixed cost, the price will be billed in-advance if
781+
this is true, and in-arrears if this is false.
782+
"""
783+
784+
billing_cycle_configuration: Optional[NewBillingCycleConfiguration]
785+
"""
786+
For custom cadence: specifies the duration of the billing period in days or
787+
months.
788+
"""
789+
790+
conversion_rate: Optional[float]
791+
"""The per unit conversion rate of the price currency to the invoicing currency."""
792+
793+
conversion_rate_config: Optional[AddPricePriceNewPlanDailyCreditAllowancePriceConversionRateConfig]
794+
"""The configuration for the rate of the price currency to the invoicing currency."""
795+
796+
currency: Optional[str]
797+
"""
798+
An ISO 4217 currency string, or custom pricing unit identifier, in which this
799+
price is billed.
800+
"""
801+
802+
dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration]
803+
"""For dimensional price: specifies a price group and dimension values"""
804+
805+
external_price_id: Optional[str]
806+
"""An alias for the price."""
807+
808+
fixed_price_quantity: Optional[float]
809+
"""
810+
If the Price represents a fixed cost, this represents the quantity of units
811+
applied.
812+
"""
813+
814+
invoice_grouping_key: Optional[str]
815+
"""The property used to group this price on an invoice"""
816+
817+
invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration]
818+
"""Within each billing cycle, specifies the cadence at which invoices are produced.
819+
820+
If unspecified, a single invoice is produced per billing cycle.
821+
"""
822+
823+
license_type_id: Optional[str]
824+
"""The ID of the license type to associate with this price."""
825+
826+
metadata: Optional[Dict[str, Optional[str]]]
827+
"""User-specified key/value pairs for the resource.
828+
829+
Individual keys can be removed by setting the value to `null`, and the entire
830+
metadata mapping can be cleared by setting `metadata` to `null`.
831+
"""
832+
833+
reference_id: Optional[str]
834+
"""
835+
A transient ID that can be used to reference this price when adding adjustments
836+
in the same API call.
837+
"""
838+
839+
700840
class AddPricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False):
701841
"""Configuration for percent pricing"""
702842

@@ -931,6 +1071,7 @@ class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False):
9311071
NewPlanScalableMatrixWithTieredPricingPrice,
9321072
NewPlanCumulativeGroupedBulkPrice,
9331073
AddPricePriceNewPlanCumulativeGroupedAllocationPrice,
1074+
AddPricePriceNewPlanDailyCreditAllowancePrice,
9341075
NewPlanMinimumCompositePrice,
9351076
AddPricePriceNewPlanPercentCompositePrice,
9361077
AddPricePriceNewPlanEventOutputPrice,
@@ -1534,6 +1675,137 @@ class ReplacePricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=
15341675
"""
15351676

15361677

1678+
class ReplacePricePriceNewPlanDailyCreditAllowancePriceDailyCreditAllowanceConfigMatrixValue(TypedDict, total=False):
1679+
"""Per-dimension credit price for the daily credit allowance model."""
1680+
1681+
dimension_values: Required[SequenceNotStr[Optional[str]]]
1682+
"""One or two matrix keys to filter usage to this value by.
1683+
1684+
For example, ["model"] could be used to apply a different credit rate to each AI
1685+
model.
1686+
"""
1687+
1688+
unit_amount: Required[str]
1689+
"""Credits charged per unit of usage matching the specified dimension_values"""
1690+
1691+
1692+
class ReplacePricePriceNewPlanDailyCreditAllowancePriceDailyCreditAllowanceConfig(TypedDict, total=False):
1693+
"""Configuration for daily_credit_allowance pricing"""
1694+
1695+
daily_allowance: Required[str]
1696+
"""Credits granted per day. Lose-it-or-use-it; does not roll over."""
1697+
1698+
default_unit_amount: Required[str]
1699+
"""
1700+
Default per-unit credit rate for any usage not bucketed into a specified
1701+
matrix_value
1702+
"""
1703+
1704+
dimensions: Required[SequenceNotStr[Optional[str]]]
1705+
"""One or two event property values to evaluate matrix groups by"""
1706+
1707+
event_day_property: Required[str]
1708+
"""Event property whose value identifies the day bucket the event belongs to (e.g.
1709+
1710+
'event_day' set to an ISO date string in the customer's timezone). The allowance
1711+
resets per distinct value of this property.
1712+
"""
1713+
1714+
matrix_values: Required[
1715+
Iterable[ReplacePricePriceNewPlanDailyCreditAllowancePriceDailyCreditAllowanceConfigMatrixValue]
1716+
]
1717+
"""Per-dimension credit rates"""
1718+
1719+
1720+
ReplacePricePriceNewPlanDailyCreditAllowancePriceConversionRateConfig: TypeAlias = Union[
1721+
UnitConversionRateConfig, TieredConversionRateConfig
1722+
]
1723+
1724+
1725+
class ReplacePricePriceNewPlanDailyCreditAllowancePrice(TypedDict, total=False):
1726+
cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]]
1727+
"""The cadence to bill for this price on."""
1728+
1729+
daily_credit_allowance_config: Required[ReplacePricePriceNewPlanDailyCreditAllowancePriceDailyCreditAllowanceConfig]
1730+
"""Configuration for daily_credit_allowance pricing"""
1731+
1732+
item_id: Required[str]
1733+
"""The id of the item the price will be associated with."""
1734+
1735+
model_type: Required[Literal["daily_credit_allowance"]]
1736+
"""The pricing model type"""
1737+
1738+
name: Required[str]
1739+
"""The name of the price."""
1740+
1741+
billable_metric_id: Optional[str]
1742+
"""The id of the billable metric for the price.
1743+
1744+
Only needed if the price is usage-based.
1745+
"""
1746+
1747+
billed_in_advance: Optional[bool]
1748+
"""
1749+
If the Price represents a fixed cost, the price will be billed in-advance if
1750+
this is true, and in-arrears if this is false.
1751+
"""
1752+
1753+
billing_cycle_configuration: Optional[NewBillingCycleConfiguration]
1754+
"""
1755+
For custom cadence: specifies the duration of the billing period in days or
1756+
months.
1757+
"""
1758+
1759+
conversion_rate: Optional[float]
1760+
"""The per unit conversion rate of the price currency to the invoicing currency."""
1761+
1762+
conversion_rate_config: Optional[ReplacePricePriceNewPlanDailyCreditAllowancePriceConversionRateConfig]
1763+
"""The configuration for the rate of the price currency to the invoicing currency."""
1764+
1765+
currency: Optional[str]
1766+
"""
1767+
An ISO 4217 currency string, or custom pricing unit identifier, in which this
1768+
price is billed.
1769+
"""
1770+
1771+
dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration]
1772+
"""For dimensional price: specifies a price group and dimension values"""
1773+
1774+
external_price_id: Optional[str]
1775+
"""An alias for the price."""
1776+
1777+
fixed_price_quantity: Optional[float]
1778+
"""
1779+
If the Price represents a fixed cost, this represents the quantity of units
1780+
applied.
1781+
"""
1782+
1783+
invoice_grouping_key: Optional[str]
1784+
"""The property used to group this price on an invoice"""
1785+
1786+
invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration]
1787+
"""Within each billing cycle, specifies the cadence at which invoices are produced.
1788+
1789+
If unspecified, a single invoice is produced per billing cycle.
1790+
"""
1791+
1792+
license_type_id: Optional[str]
1793+
"""The ID of the license type to associate with this price."""
1794+
1795+
metadata: Optional[Dict[str, Optional[str]]]
1796+
"""User-specified key/value pairs for the resource.
1797+
1798+
Individual keys can be removed by setting the value to `null`, and the entire
1799+
metadata mapping can be cleared by setting `metadata` to `null`.
1800+
"""
1801+
1802+
reference_id: Optional[str]
1803+
"""
1804+
A transient ID that can be used to reference this price when adding adjustments
1805+
in the same API call.
1806+
"""
1807+
1808+
15371809
class ReplacePricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False):
15381810
"""Configuration for percent pricing"""
15391811

@@ -1768,6 +2040,7 @@ class ReplacePricePriceNewPlanEventOutputPrice(TypedDict, total=False):
17682040
NewPlanScalableMatrixWithTieredPricingPrice,
17692041
NewPlanCumulativeGroupedBulkPrice,
17702042
ReplacePricePriceNewPlanCumulativeGroupedAllocationPrice,
2043+
ReplacePricePriceNewPlanDailyCreditAllowancePrice,
17712044
NewPlanMinimumCompositePrice,
17722045
ReplacePricePriceNewPlanPercentCompositePrice,
17732046
ReplacePricePriceNewPlanEventOutputPrice,

0 commit comments

Comments
 (0)