# This file was auto-generated by Fern from our API Definition.

from __future__ import annotations

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .amount import Amount
from .package_price_output_rounding_behavior import PackagePriceOutputRoundingBehavior


class Price_Flat(UniversalBaseModel):
    price_type: typing.Literal["flat"] = "flat"
    amount: Amount

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow


class Price_Package(UniversalBaseModel):
    price_type: typing.Literal["package"] = "package"
    amount: Amount
    package_units: int
    rounding_behavior: PackagePriceOutputRoundingBehavior

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow


Price = typing.Union[Price_Flat, Price_Package]
