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

from ...core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from ...entity_types.types.entity_id import EntityId
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class EntityGroupUserEntityRequest(UniversalBaseModel):
    """
    Examples
    --------
    from mercoa.entity_group_types import EntityGroupUserEntityRequest

    EntityGroupUserEntityRequest(
        roles=["admin", "approver"],
        entity_id="ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
    )
    """

    roles: typing.List[str] = pydantic.Field()
    """
    List of roles. A role can be any string. For example: "payer", "approver", "viewer"
    """

    entity_id: EntityId = pydantic.Field(alias="entityId")
    """
    The IDs of the entities that these roles applies to.
    """

    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
