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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata
from .fetch_response_agents_response_completed_result import FetchResponseAgentsResponseCompletedResult


class FetchResponseAgentsResponse_Running(UniversalBaseModel):
    status: typing.Literal["RUNNING"] = "RUNNING"

    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


class FetchResponseAgentsResponse_Completed(UniversalBaseModel):
    status: typing.Literal["COMPLETED"] = "COMPLETED"
    result: FetchResponseAgentsResponseCompletedResult

    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


class FetchResponseAgentsResponse_Failed(UniversalBaseModel):
    status: typing.Literal["FAILED"] = "FAILED"
    error_message: typing_extensions.Annotated[
        str, FieldMetadata(alias="errorMessage"), pydantic.Field(alias="errorMessage")
    ]

    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


FetchResponseAgentsResponse = typing_extensions.Annotated[
    typing.Union[
        FetchResponseAgentsResponse_Running, FetchResponseAgentsResponse_Completed, FetchResponseAgentsResponse_Failed
    ],
    pydantic.Field(discriminator="status"),
]
