"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from paygentic_sdk.types import BaseModel
import pydantic
from typing import Literal, Union
from typing_extensions import Annotated, TypeAliasType, TypedDict


class PriceProperties4TypedDict(TypedDict):
    r"""Percentage pricing model"""

    max_charge: str
    r"""Ceiling amount limiting total charge regardless of percentage calculation. Sample values: '500.00' caps fees at $500 maximum, '2000.00' limits charges to $2000 per period"""
    min_charge: str
    r"""Floor amount charged regardless of percentage calculation. Sample values: '5.00' ensures minimum $5 fee, '25.00' guarantees at least $25 per billing event"""
    percentage: str
    r"""Rate expressed as decimal between 0 and 10, supporting up to 4 decimal precision. Sample values: '0.03' represents 3%, '0.075' represents 7.5%, '1.10' represents 110%"""


class PriceProperties4(BaseModel):
    r"""Percentage pricing model"""

    max_charge: Annotated[str, pydantic.Field(alias="maxCharge")]
    r"""Ceiling amount limiting total charge regardless of percentage calculation. Sample values: '500.00' caps fees at $500 maximum, '2000.00' limits charges to $2000 per period"""

    min_charge: Annotated[str, pydantic.Field(alias="minCharge")]
    r"""Floor amount charged regardless of percentage calculation. Sample values: '5.00' ensures minimum $5 fee, '25.00' guarantees at least $25 per billing event"""

    percentage: str
    r"""Rate expressed as decimal between 0 and 10, supporting up to 4 decimal precision. Sample values: '0.03' represents 3%, '0.075' represents 7.5%, '1.10' represents 110%"""


Function = Literal["linear",]
r"""Function used for volume pricing calculations"""


class ParametersTypedDict(TypedDict):
    function: Function
    r"""Function used for volume pricing calculations"""
    gradient: str
    r"""Gradient for volume pricing calculations"""
    max: str
    r"""Maximum value for volume pricing"""
    min: str
    r"""Minimum value for volume pricing"""


class Parameters(BaseModel):
    function: Function
    r"""Function used for volume pricing calculations"""

    gradient: str
    r"""Gradient for volume pricing calculations"""

    max: str
    r"""Maximum value for volume pricing"""

    min: str
    r"""Minimum value for volume pricing"""


class PriceProperties3TypedDict(TypedDict):
    r"""Volume pricing model"""

    default: str
    r"""Default value for volume pricing"""
    parameters: ParametersTypedDict


class PriceProperties3(BaseModel):
    r"""Volume pricing model"""

    default: str
    r"""Default value for volume pricing"""

    parameters: Parameters


class PriceProperties2TypedDict(TypedDict):
    r"""Dynamic pricing model"""

    max_price: str
    r"""Upper limit of the price range for dynamic pricing. Sample values: '0.10' means $0.10 per token for large volumes at peak times"""
    min_price: str
    r"""Lower limit of the price range for dynamic pricing. Sample values: '0.01' means $0.01 per token for low volumes during off-peak hours"""


class PriceProperties2(BaseModel):
    r"""Dynamic pricing model"""

    max_price: Annotated[str, pydantic.Field(alias="maxPrice")]
    r"""Upper limit of the price range for dynamic pricing. Sample values: '0.10' means $0.10 per token for large volumes at peak times"""

    min_price: Annotated[str, pydantic.Field(alias="minPrice")]
    r"""Lower limit of the price range for dynamic pricing. Sample values: '0.01' means $0.01 per token for low volumes during off-peak hours"""


class PriceProperties1TypedDict(TypedDict):
    r"""Standard pricing model"""

    unit_price: str
    r"""Per-unit cost in decimal format for fixed-rate pricing. Sample values: '0.00002' represents $0.00002 per token, '0.15' represents $0.15 per gigabyte stored, '0.05' represents $0.05 per API call"""


class PriceProperties1(BaseModel):
    r"""Standard pricing model"""

    unit_price: Annotated[str, pydantic.Field(alias="unitPrice")]
    r"""Per-unit cost in decimal format for fixed-rate pricing. Sample values: '0.00002' represents $0.00002 per token, '0.15' represents $0.15 per gigabyte stored, '0.05' represents $0.05 per API call"""


PricePropertiesUnionTypedDict = TypeAliasType(
    "PricePropertiesUnionTypedDict",
    Union[
        PriceProperties1TypedDict,
        PriceProperties2TypedDict,
        PriceProperties3TypedDict,
        PriceProperties4TypedDict,
    ],
)


PricePropertiesUnion = TypeAliasType(
    "PricePropertiesUnion",
    Union[PriceProperties1, PriceProperties2, PriceProperties3, PriceProperties4],
)


try:
    PriceProperties4.model_rebuild()
except NameError:
    pass
try:
    PriceProperties2.model_rebuild()
except NameError:
    pass
try:
    PriceProperties1.model_rebuild()
except NameError:
    pass
