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

from __future__ import annotations
from ...core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from .identifier_list import IdentifierList
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class Rule_Approver(UniversalBaseModel):
    """
    Examples
    --------
    from mercoa.entity_types import IdentifierList_RolesList, Rule_Approver

    Rule_Approver(
        num_approvers=2,
        identifier_list=IdentifierList_RolesList(value=["Admin", "Controller"]),
    )
    """

    type: typing.Literal["approver"] = "approver"
    num_approvers: int = pydantic.Field(alias="numApprovers")
    identifier_list: IdentifierList = pydantic.Field(alias="identifierList")

    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


"""
from mercoa.entity_types import IdentifierList_RolesList, Rule_Approver

Rule_Approver(
    num_approvers=2,
    identifier_list=IdentifierList_RolesList(value=["Admin", "Controller"]),
)
"""
Rule = Rule_Approver
