# 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 .expires_at import ExpiresAt


class PresignedUrlChunk(UniversalBaseModel):
    chunk_index: typing.Optional[int] = pydantic.Field(default=None)
    """
    The index of this chunk.
    """

    url: typing.Optional[str] = pydantic.Field(default=None)
    """
    The presigned URL for uploading this chunk. Each URL can only be used once and expires after 1 hour.
    """

    expires_at: typing.Optional[ExpiresAt] = 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
