From 6fa62f5ce0889168cfb3cbe8dc3fe6b481afc3ab Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Thu, 9 Nov 2023 16:21:40 +0000 Subject: [PATCH] feat(api): updates (#41) --- src/orb/resources/customers/customers.py | 28 +- .../customer_update_by_external_id_params.py | 7 - src/orb/types/customer_update_params.py | 7 - src/orb/types/price.py | 408 +++++++++--------- tests/api_resources/test_customers.py | 4 - 5 files changed, 206 insertions(+), 248 deletions(-) diff --git a/src/orb/resources/customers/customers.py b/src/orb/resources/customers/customers.py index b19fab92..6a626a9e 100644 --- a/src/orb/resources/customers/customers.py +++ b/src/orb/resources/customers/customers.py @@ -275,7 +275,6 @@ def update( currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, - external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[object] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] @@ -296,7 +295,7 @@ def update( This endpoint can be used to update the `payment_provider`, `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`, `auto_collection`, `metadata`, `shipping_address`, `billing_address`, and - `additional_emails` of an existing customer. "Other fields on a customer are + `additional_emails` of an existing customer. Other fields on a customer are currently immutable. Args: @@ -312,10 +311,6 @@ def update( email: A valid customer email, to be used for invoicing and notifications. - external_customer_id: An optional user-defined ID for this customer resource, used throughout the - system as an alias for this Customer. Use this field to identify a customer by - an existing identifier in your system. - metadata: User-specified key value pairs, often useful for referencing internal resources or IDs. Returned as-is in the customer resource. @@ -438,7 +433,6 @@ def update( "currency": currency, "email": email, "email_delivery": email_delivery, - "external_customer_id": external_customer_id, "metadata": metadata, "name": name, "payment_provider": payment_provider, @@ -656,7 +650,6 @@ def update_by_external_id( currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, - external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[object] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] @@ -693,10 +686,6 @@ def update_by_external_id( email: A valid customer email, to be used for invoicing and notifications. - external_customer_id: An optional user-defined ID for this customer resource, used throughout the - system as an alias for this Customer. Use this field to identify a customer by - an existing identifier in your system. - metadata: User-specified key value pairs, often useful for referencing internal resources or IDs. Returned as-is in the customer resource. @@ -819,7 +808,6 @@ def update_by_external_id( "currency": currency, "email": email, "email_delivery": email_delivery, - "external_customer_id": external_customer_id, "metadata": metadata, "name": name, "payment_provider": payment_provider, @@ -1074,7 +1062,6 @@ async def update( currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, - external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[object] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] @@ -1095,7 +1082,7 @@ async def update( This endpoint can be used to update the `payment_provider`, `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`, `auto_collection`, `metadata`, `shipping_address`, `billing_address`, and - `additional_emails` of an existing customer. "Other fields on a customer are + `additional_emails` of an existing customer. Other fields on a customer are currently immutable. Args: @@ -1111,10 +1098,6 @@ async def update( email: A valid customer email, to be used for invoicing and notifications. - external_customer_id: An optional user-defined ID for this customer resource, used throughout the - system as an alias for this Customer. Use this field to identify a customer by - an existing identifier in your system. - metadata: User-specified key value pairs, often useful for referencing internal resources or IDs. Returned as-is in the customer resource. @@ -1237,7 +1220,6 @@ async def update( "currency": currency, "email": email, "email_delivery": email_delivery, - "external_customer_id": external_customer_id, "metadata": metadata, "name": name, "payment_provider": payment_provider, @@ -1455,7 +1437,6 @@ async def update_by_external_id( currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, - external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[object] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] @@ -1492,10 +1473,6 @@ async def update_by_external_id( email: A valid customer email, to be used for invoicing and notifications. - external_customer_id: An optional user-defined ID for this customer resource, used throughout the - system as an alias for this Customer. Use this field to identify a customer by - an existing identifier in your system. - metadata: User-specified key value pairs, often useful for referencing internal resources or IDs. Returned as-is in the customer resource. @@ -1618,7 +1595,6 @@ async def update_by_external_id( "currency": currency, "email": email, "email_delivery": email_delivery, - "external_customer_id": external_customer_id, "metadata": metadata, "name": name, "payment_provider": payment_provider, diff --git a/src/orb/types/customer_update_by_external_id_params.py b/src/orb/types/customer_update_by_external_id_params.py index 60173ee6..fb2aeda8 100644 --- a/src/orb/types/customer_update_by_external_id_params.py +++ b/src/orb/types/customer_update_by_external_id_params.py @@ -45,13 +45,6 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): email_delivery: Optional[bool] - external_customer_id: Optional[str] - """ - An optional user-defined ID for this customer resource, used throughout the - system as an alias for this Customer. Use this field to identify a customer by - an existing identifier in your system. - """ - metadata: Optional[object] """ User-specified key value pairs, often useful for referencing internal resources diff --git a/src/orb/types/customer_update_params.py b/src/orb/types/customer_update_params.py index b8c4286b..b7faf5b8 100644 --- a/src/orb/types/customer_update_params.py +++ b/src/orb/types/customer_update_params.py @@ -45,13 +45,6 @@ class CustomerUpdateParams(TypedDict, total=False): email_delivery: Optional[bool] - external_customer_id: Optional[str] - """ - An optional user-defined ID for this customer resource, used throughout the - system as an alias for this Customer. Use this field to identify a customer by - an existing identifier in your system. - """ - metadata: Optional[object] """ User-specified key value pairs, often useful for referencing internal resources diff --git a/src/orb/types/price.py b/src/orb/types/price.py index acd0fc55..4b701128 100644 --- a/src/orb/types/price.py +++ b/src/orb/types/price.py @@ -14,15 +14,15 @@ "UnitPrice", "UnitPriceBillableMetric", "UnitPriceItem", - "UnitPriceUnitConfig", "UnitPriceMaximum", "UnitPriceMinimum", + "UnitPriceUnitConfig", "PackagePrice", "PackagePriceBillableMetric", "PackagePriceItem", - "PackagePricePackageConfig", "PackagePriceMaximum", "PackagePriceMinimum", + "PackagePricePackageConfig", "MatrixPrice", "MatrixPriceBillableMetric", "MatrixPriceItem", @@ -33,17 +33,17 @@ "TieredPrice", "TieredPriceBillableMetric", "TieredPriceItem", - "TieredPriceTieredConfig", - "TieredPriceTieredConfigTier", "TieredPriceMaximum", "TieredPriceMinimum", + "TieredPriceTieredConfig", + "TieredPriceTieredConfigTier", "TieredBpsPrice", "TieredBpsPriceBillableMetric", "TieredBpsPriceItem", - "TieredBpsPriceTieredBpsConfig", - "TieredBpsPriceTieredBpsConfigTier", "TieredBpsPriceMaximum", "TieredBpsPriceMinimum", + "TieredBpsPriceTieredBpsConfig", + "TieredBpsPriceTieredBpsConfigTier", "BpsPrice", "BpsPriceBillableMetric", "BpsPriceBpsConfig", @@ -107,14 +107,6 @@ class UnitPriceItem(BaseModel): name: str -class UnitPriceUnitConfig(BaseModel): - unit_amount: str - """Rate per unit of usage""" - - scaling_factor: Optional[float] = None - """Multiplier to scale rated quantity by""" - - class UnitPriceMaximum(BaseModel): applies_to_price_ids: List[str] """List of price_ids that this maximum amount applies to. @@ -137,6 +129,14 @@ class UnitPriceMinimum(BaseModel): """Minimum amount applied""" +class UnitPriceUnitConfig(BaseModel): + unit_amount: str + """Rate per unit of usage""" + + scaling_factor: Optional[float] = None + """Multiplier to scale rated quantity by""" + + class UnitPrice(BaseModel): id: str @@ -148,12 +148,22 @@ class UnitPrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] item: UnitPriceItem + maximum: Optional[UnitPriceMaximum] + + maximum_amount: Optional[str] + + minimum: Optional[UnitPriceMinimum] + + minimum_amount: Optional[str] + price_model_type: Literal["unit"] = FieldInfo(alias="model_type") name: str @@ -164,16 +174,6 @@ class UnitPrice(BaseModel): unit_config: UnitPriceUnitConfig - discount: Optional[Discount] = None - - maximum: Optional[UnitPriceMaximum] = None - - maximum_amount: Optional[str] = None - - minimum: Optional[UnitPriceMinimum] = None - - minimum_amount: Optional[str] = None - class PackagePriceBillableMetric(BaseModel): id: str @@ -185,18 +185,6 @@ class PackagePriceItem(BaseModel): name: str -class PackagePricePackageConfig(BaseModel): - package_amount: str - """A currency amount to rate usage by""" - - package_size: Optional[int] = None - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - class PackagePriceMaximum(BaseModel): applies_to_price_ids: List[str] """List of price_ids that this maximum amount applies to. @@ -219,6 +207,18 @@ class PackagePriceMinimum(BaseModel): """Minimum amount applied""" +class PackagePricePackageConfig(BaseModel): + package_amount: str + """A currency amount to rate usage by""" + + package_size: Optional[int] = None + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + class PackagePrice(BaseModel): id: str @@ -230,12 +230,22 @@ class PackagePrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] item: PackagePriceItem + maximum: Optional[PackagePriceMaximum] + + maximum_amount: Optional[str] + + minimum: Optional[PackagePriceMinimum] + + minimum_amount: Optional[str] + price_model_type: Literal["package"] = FieldInfo(alias="model_type") name: str @@ -246,16 +256,6 @@ class PackagePrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] - discount: Optional[Discount] = None - - maximum: Optional[PackagePriceMaximum] = None - - maximum_amount: Optional[str] = None - - minimum: Optional[PackagePriceMinimum] = None - - minimum_amount: Optional[str] = None - class MatrixPriceBillableMetric(BaseModel): id: str @@ -332,6 +332,8 @@ class MatrixPrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] @@ -340,23 +342,21 @@ class MatrixPrice(BaseModel): matrix_config: MatrixPriceMatrixConfig - price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") + maximum: Optional[MatrixPriceMaximum] - name: str - - plan_phase_order: Optional[int] + maximum_amount: Optional[str] - price_type: Literal["usage_price", "fixed_price"] + minimum: Optional[MatrixPriceMinimum] - discount: Optional[Discount] = None + minimum_amount: Optional[str] - maximum: Optional[MatrixPriceMaximum] = None + price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") - maximum_amount: Optional[str] = None + name: str - minimum: Optional[MatrixPriceMinimum] = None + plan_phase_order: Optional[int] - minimum_amount: Optional[str] = None + price_type: Literal["usage_price", "fixed_price"] class TieredPriceBillableMetric(BaseModel): @@ -369,22 +369,6 @@ class TieredPriceItem(BaseModel): name: str -class TieredPriceTieredConfigTier(BaseModel): - first_unit: float - """Inclusive tier starting value""" - - unit_amount: str - """Amount per unit""" - - last_unit: Optional[float] = None - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class TieredPriceTieredConfig(BaseModel): - tiers: List[TieredPriceTieredConfigTier] - """Tiers for rating based on total usage quantities into the specified tier""" - - class TieredPriceMaximum(BaseModel): applies_to_price_ids: List[str] """List of price_ids that this maximum amount applies to. @@ -407,6 +391,22 @@ class TieredPriceMinimum(BaseModel): """Minimum amount applied""" +class TieredPriceTieredConfigTier(BaseModel): + first_unit: float + """Inclusive tier starting value""" + + unit_amount: str + """Amount per unit""" + + last_unit: Optional[float] = None + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class TieredPriceTieredConfig(BaseModel): + tiers: List[TieredPriceTieredConfigTier] + """Tiers for rating based on total usage quantities into the specified tier""" + + class TieredPrice(BaseModel): id: str @@ -418,12 +418,22 @@ class TieredPrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] item: TieredPriceItem + maximum: Optional[TieredPriceMaximum] + + maximum_amount: Optional[str] + + minimum: Optional[TieredPriceMinimum] + + minimum_amount: Optional[str] + price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") name: str @@ -434,16 +444,6 @@ class TieredPrice(BaseModel): tiered_config: TieredPriceTieredConfig - discount: Optional[Discount] = None - - maximum: Optional[TieredPriceMaximum] = None - - maximum_amount: Optional[str] = None - - minimum: Optional[TieredPriceMinimum] = None - - minimum_amount: Optional[str] = None - class TieredBpsPriceBillableMetric(BaseModel): id: str @@ -455,28 +455,6 @@ class TieredBpsPriceItem(BaseModel): name: str -class TieredBpsPriceTieredBpsConfigTier(BaseModel): - bps: float - """Per-event basis point rate""" - - minimum_amount: str - """Inclusive tier starting value""" - - maximum_amount: Optional[str] = None - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] = None - """Per unit maximum to charge""" - - -class TieredBpsPriceTieredBpsConfig(BaseModel): - tiers: List[TieredBpsPriceTieredBpsConfigTier] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - class TieredBpsPriceMaximum(BaseModel): applies_to_price_ids: List[str] """List of price_ids that this maximum amount applies to. @@ -499,6 +477,28 @@ class TieredBpsPriceMinimum(BaseModel): """Minimum amount applied""" +class TieredBpsPriceTieredBpsConfigTier(BaseModel): + bps: float + """Per-event basis point rate""" + + minimum_amount: str + """Inclusive tier starting value""" + + maximum_amount: Optional[str] = None + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] = None + """Per unit maximum to charge""" + + +class TieredBpsPriceTieredBpsConfig(BaseModel): + tiers: List[TieredBpsPriceTieredBpsConfigTier] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + class TieredBpsPrice(BaseModel): id: str @@ -510,12 +510,22 @@ class TieredBpsPrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] item: TieredBpsPriceItem + maximum: Optional[TieredBpsPriceMaximum] + + maximum_amount: Optional[str] + + minimum: Optional[TieredBpsPriceMinimum] + + minimum_amount: Optional[str] + price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") name: str @@ -526,16 +536,6 @@ class TieredBpsPrice(BaseModel): tiered_bps_config: TieredBpsPriceTieredBpsConfig - discount: Optional[Discount] = None - - maximum: Optional[TieredBpsPriceMaximum] = None - - maximum_amount: Optional[str] = None - - minimum: Optional[TieredBpsPriceMinimum] = None - - minimum_amount: Optional[str] = None - class BpsPriceBillableMetric(BaseModel): id: str @@ -590,29 +590,29 @@ class BpsPrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] item: BpsPriceItem - price_model_type: Literal["bps"] = FieldInfo(alias="model_type") - - name: str + maximum: Optional[BpsPriceMaximum] - plan_phase_order: Optional[int] + maximum_amount: Optional[str] - price_type: Literal["usage_price", "fixed_price"] + minimum: Optional[BpsPriceMinimum] - discount: Optional[Discount] = None + minimum_amount: Optional[str] - maximum: Optional[BpsPriceMaximum] = None + price_model_type: Literal["bps"] = FieldInfo(alias="model_type") - maximum_amount: Optional[str] = None + name: str - minimum: Optional[BpsPriceMinimum] = None + plan_phase_order: Optional[int] - minimum_amount: Optional[str] = None + price_type: Literal["usage_price", "fixed_price"] class BulkBpsPriceBillableMetric(BaseModel): @@ -679,29 +679,29 @@ class BulkBpsPrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] item: BulkBpsPriceItem - price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") + maximum: Optional[BulkBpsPriceMaximum] - name: str + maximum_amount: Optional[str] - plan_phase_order: Optional[int] - - price_type: Literal["usage_price", "fixed_price"] + minimum: Optional[BulkBpsPriceMinimum] - discount: Optional[Discount] = None + minimum_amount: Optional[str] - maximum: Optional[BulkBpsPriceMaximum] = None + price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") - maximum_amount: Optional[str] = None + name: str - minimum: Optional[BulkBpsPriceMinimum] = None + plan_phase_order: Optional[int] - minimum_amount: Optional[str] = None + price_type: Literal["usage_price", "fixed_price"] class BulkPriceBillableMetric(BaseModel): @@ -762,29 +762,29 @@ class BulkPrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] item: BulkPriceItem - price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") - - name: str + maximum: Optional[BulkPriceMaximum] - plan_phase_order: Optional[int] + maximum_amount: Optional[str] - price_type: Literal["usage_price", "fixed_price"] + minimum: Optional[BulkPriceMinimum] - discount: Optional[Discount] = None + minimum_amount: Optional[str] - maximum: Optional[BulkPriceMaximum] = None + price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") - maximum_amount: Optional[str] = None + name: str - minimum: Optional[BulkPriceMinimum] = None + plan_phase_order: Optional[int] - minimum_amount: Optional[str] = None + price_type: Literal["usage_price", "fixed_price"] class TestRatingFunctionPriceBillableMetric(BaseModel): @@ -830,12 +830,22 @@ class TestRatingFunctionPrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] item: TestRatingFunctionPriceItem + maximum: Optional[TestRatingFunctionPriceMaximum] + + maximum_amount: Optional[str] + + minimum: Optional[TestRatingFunctionPriceMinimum] + + minimum_amount: Optional[str] + price_model_type: Literal["test_rating_function"] = FieldInfo(alias="model_type") name: str @@ -846,16 +856,6 @@ class TestRatingFunctionPrice(BaseModel): test_rating_function_config: Dict[str, object] - discount: Optional[Discount] = None - - maximum: Optional[TestRatingFunctionPriceMaximum] = None - - maximum_amount: Optional[str] = None - - minimum: Optional[TestRatingFunctionPriceMinimum] = None - - minimum_amount: Optional[str] = None - class FivetranExamplePriceBillableMetric(BaseModel): id: str @@ -900,6 +900,8 @@ class FivetranExamplePrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fivetran_example_config: Dict[str, object] @@ -908,23 +910,21 @@ class FivetranExamplePrice(BaseModel): item: FivetranExamplePriceItem - price_model_type: Literal["fivetran_example"] = FieldInfo(alias="model_type") + maximum: Optional[FivetranExamplePriceMaximum] - name: str + maximum_amount: Optional[str] - plan_phase_order: Optional[int] - - price_type: Literal["usage_price", "fixed_price"] + minimum: Optional[FivetranExamplePriceMinimum] - discount: Optional[Discount] = None + minimum_amount: Optional[str] - maximum: Optional[FivetranExamplePriceMaximum] = None + price_model_type: Literal["fivetran_example"] = FieldInfo(alias="model_type") - maximum_amount: Optional[str] = None + name: str - minimum: Optional[FivetranExamplePriceMinimum] = None + plan_phase_order: Optional[int] - minimum_amount: Optional[str] = None + price_type: Literal["usage_price", "fixed_price"] class ThresholdTotalAmountPriceBillableMetric(BaseModel): @@ -970,12 +970,22 @@ class ThresholdTotalAmountPrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] item: ThresholdTotalAmountPriceItem + maximum: Optional[ThresholdTotalAmountPriceMaximum] + + maximum_amount: Optional[str] + + minimum: Optional[ThresholdTotalAmountPriceMinimum] + + minimum_amount: Optional[str] + price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") name: str @@ -986,16 +996,6 @@ class ThresholdTotalAmountPrice(BaseModel): threshold_total_amount_config: Dict[str, object] - discount: Optional[Discount] = None - - maximum: Optional[ThresholdTotalAmountPriceMaximum] = None - - maximum_amount: Optional[str] = None - - minimum: Optional[ThresholdTotalAmountPriceMinimum] = None - - minimum_amount: Optional[str] = None - class TieredPackagePriceBillableMetric(BaseModel): id: str @@ -1040,12 +1040,22 @@ class TieredPackagePrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] item: TieredPackagePriceItem + maximum: Optional[TieredPackagePriceMaximum] + + maximum_amount: Optional[str] + + minimum: Optional[TieredPackagePriceMinimum] + + minimum_amount: Optional[str] + price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") name: str @@ -1056,16 +1066,6 @@ class TieredPackagePrice(BaseModel): tiered_package_config: Dict[str, object] - discount: Optional[Discount] = None - - maximum: Optional[TieredPackagePriceMaximum] = None - - maximum_amount: Optional[str] = None - - minimum: Optional[TieredPackagePriceMinimum] = None - - minimum_amount: Optional[str] = None - class TieredWithMinimumPriceBillableMetric(BaseModel): id: str @@ -1110,12 +1110,22 @@ class TieredWithMinimumPrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] item: TieredWithMinimumPriceItem + maximum: Optional[TieredWithMinimumPriceMaximum] + + maximum_amount: Optional[str] + + minimum: Optional[TieredWithMinimumPriceMinimum] + + minimum_amount: Optional[str] + price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") name: str @@ -1126,16 +1136,6 @@ class TieredWithMinimumPrice(BaseModel): tiered_with_minimum_config: Dict[str, object] - discount: Optional[Discount] = None - - maximum: Optional[TieredWithMinimumPriceMaximum] = None - - maximum_amount: Optional[str] = None - - minimum: Optional[TieredWithMinimumPriceMinimum] = None - - minimum_amount: Optional[str] = None - class PackageWithAllocationPriceBillableMetric(BaseModel): id: str @@ -1180,12 +1180,22 @@ class PackageWithAllocationPrice(BaseModel): currency: str + discount: Optional[Discount] + external_price_id: Optional[str] fixed_price_quantity: Optional[float] item: PackageWithAllocationPriceItem + maximum: Optional[PackageWithAllocationPriceMaximum] + + maximum_amount: Optional[str] + + minimum: Optional[PackageWithAllocationPriceMinimum] + + minimum_amount: Optional[str] + price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") name: str @@ -1196,16 +1206,6 @@ class PackageWithAllocationPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] - discount: Optional[Discount] = None - - maximum: Optional[PackageWithAllocationPriceMaximum] = None - - maximum_amount: Optional[str] = None - - minimum: Optional[PackageWithAllocationPriceMinimum] = None - - minimum_amount: Optional[str] = None - Price = Union[ UnitPrice, diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 8845edf8..b416b504 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -137,7 +137,6 @@ def test_method_update_with_all_params(self, client: Orb) -> None: currency="string", email="string", email_delivery=True, - external_customer_id="string", metadata={}, name="string", payment_provider="quickbooks", @@ -281,7 +280,6 @@ def test_method_update_by_external_id_with_all_params(self, client: Orb) -> None currency="string", email="string", email_delivery=True, - external_customer_id="string", metadata={}, name="string", payment_provider="quickbooks", @@ -433,7 +431,6 @@ async def test_method_update_with_all_params(self, client: AsyncOrb) -> None: currency="string", email="string", email_delivery=True, - external_customer_id="string", metadata={}, name="string", payment_provider="quickbooks", @@ -577,7 +574,6 @@ async def test_method_update_by_external_id_with_all_params(self, client: AsyncO currency="string", email="string", email_delivery=True, - external_customer_id="string", metadata={}, name="string", payment_provider="quickbooks",