# 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 .trait_definition import TraitDefinition


class Condition(UniversalBaseModel):
    account_id: str
    comparison_trait_definition: typing.Optional[TraitDefinition] = None
    condition_type: str
    consumption_rate: typing.Optional[float] = None
    credit_id: typing.Optional[str] = None
    environment_id: str
    event_subtype: typing.Optional[str] = None
    id: str
    metric_period: typing.Optional[str] = None
    metric_period_month_reset: typing.Optional[str] = None
    metric_value: typing.Optional[int] = None
    operator: str
    resource_ids: typing.List[str]
    trait_definition: typing.Optional[TraitDefinition] = None
    trait_value: str

    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
