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

from .base_search_response_dto import BaseSearchResponseDto
import typing
from .articles import Articles
from .user_input_dto import UserInputDto
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class SearchResponseDto(BaseSearchResponseDto):
    """
    The response model for the search requests applies to the `Search`, `Latest Headlines`, `Search by link`, and `Authors` endpoints. 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.
    - To access article properties in the `articles` response array, use array index notation. For example, `articles[n].title`, where `n` is the zero-based index of the article object (0, 1, 2, etc.).
    - The `nlp` property within the article object `articles[n].nlp` is only available with NLP-enabled subscription plans.
    """

    articles: typing.Optional[Articles] = None
    user_input: typing.Optional[UserInputDto] = 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
