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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .multi_input_media_source_media_type import MultiInputMediaSourceMediaType


class MultiInputMediaSource(UniversalBaseModel):
    """
    An object specifying an image source for multi-input embeddings. You must provide exactly one of `url`, `base64_string`, or `asset_id`.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The unique identifier for this media source.
    
    This field is required when `input_type` references this image.
    """

    media_type: MultiInputMediaSourceMediaType = pydantic.Field()
    """
    The type of media.
    
    **Value**: `image`
    """

    url: typing.Optional[str] = pydantic.Field(default=None)
    """
    The publicly accessible URL of the image file  Use direct links to raw image files. Image hosting platforms and cloud storage sharing links are not supported.
    """

    base_64_string: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="base64_string")] = (
        pydantic.Field(default=None)
    )
    """
    The base64-encoded image data.
    """

    asset_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The unique identifier of an asset from a [direct](/v1.3/api-reference/upload-content) or [multipart](/v1.3/api-reference/upload-content/multipart-uploads) upload.
    """

    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
