# 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 .create_dimension_interface import CreateDimensionInterface
from .create_pricing_matrix_interface import CreatePricingMatrixInterface
from .create_pricing_metric_interface import CreatePricingMetricInterface


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

    name: str
    description: typing.Optional[str] = None
    included_units: typing.Optional[int] = None
    pricing_metric: CreatePricingMetricInterface
    dimensions: typing.List[CreateDimensionInterface]
    pricing_matrix: CreatePricingMatrixInterface

    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
