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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .rulesengine_check_flag_result_feature_usage_period import RulesengineCheckFlagResultFeatureUsagePeriod
from .rulesengine_check_flag_result_rule_type import RulesengineCheckFlagResultRuleType


class RulesengineCheckFlagResult(UniversalBaseModel):
    company_id: typing.Optional[str] = None
    err: typing.Optional[str] = None
    feature_allocation: typing.Optional[int] = None
    feature_usage: typing.Optional[int] = None
    feature_usage_event: typing.Optional[str] = None
    feature_usage_period: typing.Optional[RulesengineCheckFlagResultFeatureUsagePeriod] = None
    feature_usage_reset_at: typing.Optional[dt.datetime] = None
    flag_id: typing.Optional[str] = None
    flag_key: str
    reason: str
    rule_id: typing.Optional[str] = None
    rule_type: typing.Optional[RulesengineCheckFlagResultRuleType] = None
    user_id: typing.Optional[str] = None
    value: bool

    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
