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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .dimension_interface import DimensionInterface
from .pricing_matrix_interface import PricingMatrixInterface
from .pricing_metric_interface import PricingMetricInterface


class DimensionalUsageBasedRateInterface(UniversalBaseModel):
    id: str
    code: str = pydantic.Field()
    """
    Code of this rate to be used for overrides and external reference.
    """

    name: str
    description: str
    included_units: int
    pricing_metric: PricingMetricInterface
    dimensions: typing.List[DimensionInterface]
    pricing_matrix: PricingMatrixInterface

    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
