# 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 .collection_role import CollectionRole


class CollectionMemberAdd(UniversalBaseModel):
    """
    Schema for adding a member to a collection.
    """

    user_email: str = pydantic.Field()
    """
    Email address of the user to add to the collection. The user must be a member of the organization.
    """

    role: CollectionRole = pydantic.Field()
    """
    Role to assign to the user in this collection:
    • **collection_owner**: Full control over the collection (modify, delete, manage members)
    • **collection_editor**: Can perform operations (refresh, sync) but cannot modify collection settings
    • **collection_viewer**: Read-only access to the collection
    """

    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
