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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from .sources_response_dto_sources_item import SourcesResponseDtoSourcesItem
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class SourcesResponseDto(UniversalBaseModel):
    """
    The response model for a successful `Sources` request retrieving news sources matching the specified criteria. Response field behavior:
    - Required fields are guaranteed to be present and non-null.
    - Optional fields may be `null`/`undefined` if the data couldn't be extracted during processing.
    """

    message: str = pydantic.Field()
    """
    A message indicating the result of the request.
    """

    sources: typing.List[SourcesResponseDtoSourcesItem] = pydantic.Field()
    """
    A list of news sources that match the specified criteria.
    """

    user_input: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
    """
    The user input parameters for the request.
    """

    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
