# 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 .rulesengine_company_metric import RulesengineCompanyMetric
from .rulesengine_rule import RulesengineRule
from .rulesengine_subscription import RulesengineSubscription
from .rulesengine_trait import RulesengineTrait


class RulesengineCompany(UniversalBaseModel):
    account_id: str
    base_plan_id: typing.Optional[str] = None
    billing_product_ids: typing.List[str]
    credit_balances: typing.Dict[str, float]
    crm_product_ids: typing.List[str]
    environment_id: str
    id: str
    keys: typing.Dict[str, str]
    metrics: typing.List[RulesengineCompanyMetric]
    plan_ids: typing.List[str]
    rules: typing.List[RulesengineRule]
    subscription: typing.Optional[RulesengineSubscription] = None
    traits: typing.List[RulesengineTrait]

    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
