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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel


class FileFromUrl(UncheckedBaseModel):
    url: str = pydantic.Field()
    """
    A URL to download the file. For production use cases, we recommend using presigned URLs with a 5-15 minute expiration time.
    
    Supported file types can be found [here](https://docs.extend.ai/2026-02-09/product/general/supported-file-types).
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the file. If not set, the file name is taken from the URL.
    """

    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
