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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from .box_auth_mechanism import BoxAuthMechanism
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CloudBoxDataSource(UniversalBaseModel):
    supports_access_control: typing.Optional[bool] = None
    folder_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the Box folder to read from.
    """

    authentication_mechanism: BoxAuthMechanism = pydantic.Field()
    """
    The type of authentication to use (Developer Token or CCG)
    """

    developer_token: typing.Optional[str] = pydantic.Field(default=None)
    """
    Developer token for authentication if authentication_mechanism is 'developer_token'.
    """

    client_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Box API key used for identifying the application the user is authenticating with
    """

    client_secret: typing.Optional[str] = pydantic.Field(default=None)
    """
    Box API secret used for making auth requests.
    """

    user_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Box User ID, if provided authenticates as user.
    """

    enterprise_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Box Enterprise ID, if provided authenticates as service.
    """

    class_name: typing.Optional[str] = None

    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
