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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
import typing_extensions
from ..core.serialization import FieldMetadata
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CloudS3DataSource(UniversalBaseModel):
    supports_access_control: typing.Optional[bool] = None
    bucket: str = pydantic.Field()
    """
    The name of the S3 bucket to read from.
    """

    prefix: typing.Optional[str] = pydantic.Field(default=None)
    """
    The prefix of the S3 objects to read from.
    """

    aws_access_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The AWS access ID to use for authentication.
    """

    aws_access_secret: typing.Optional[str] = pydantic.Field(default=None)
    """
    The AWS access secret to use for authentication.
    """

    s_3_endpoint_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="s3_endpoint_url")] = (
        pydantic.Field(default=None)
    )
    """
    The S3 endpoint URL to use for authentication.
    """

    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
