# 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 ...types.aws_qasm_3_job_input import AwsQasm3JobInput
from ...types.azure_ionq_job_input_circuit_item import AzureIonqJobInputCircuitItem


class CreateJobRequestInput_AzureIonqSimulator(UniversalBaseModel):
    """
    Backend-specific job input. The format depends on the backend the job is executed on.
    """

    backend_id: typing_extensions.Annotated[
        typing.Literal["azure.ionq.simulator"], FieldMetadata(alias="backendId")
    ] = "azure.ionq.simulator"
    circuit: typing.List[AzureIonqJobInputCircuitItem]
    gateset: typing.Literal["qis"] = "qis"
    qubits: int
    registers: typing.Optional[typing.Dict[str, typing.List[int]]] = 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


class CreateJobRequestInput_AwsIqmGarnet(UniversalBaseModel):
    value: AwsQasm3JobInput
    backend_id: typing_extensions.Annotated[typing.Literal["aws.iqm.garnet"], FieldMetadata(alias="backendId")] = (
        "aws.iqm.garnet"
    )

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True


class CreateJobRequestInput_AwsSimSv1(UniversalBaseModel):
    value: AwsQasm3JobInput
    backend_id: typing_extensions.Annotated[typing.Literal["aws.sim.sv1"], FieldMetadata(alias="backendId")] = (
        "aws.sim.sv1"
    )

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True


class CreateJobRequestInput_AwsIonqAria2(UniversalBaseModel):
    value: AwsQasm3JobInput
    backend_id: typing_extensions.Annotated[typing.Literal["aws.ionq.aria-2"], FieldMetadata(alias="backendId")] = (
        "aws.ionq.aria-2"
    )

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True


class CreateJobRequestInput_AwsIonqForte(UniversalBaseModel):
    value: AwsQasm3JobInput
    backend_id: typing_extensions.Annotated[typing.Literal["aws.ionq.forte"], FieldMetadata(alias="backendId")] = (
        "aws.ionq.forte"
    )

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True


class CreateJobRequestInput_AwsSimDm1(UniversalBaseModel):
    value: AwsQasm3JobInput
    backend_id: typing_extensions.Annotated[typing.Literal["aws.sim.dm1"], FieldMetadata(alias="backendId")] = (
        "aws.sim.dm1"
    )

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True


class CreateJobRequestInput_AwsIonqAria(UniversalBaseModel):
    value: AwsQasm3JobInput
    backend_id: typing_extensions.Annotated[typing.Literal["aws.ionq.aria"], FieldMetadata(alias="backendId")] = (
        "aws.ionq.aria"
    )

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True


class CreateJobRequestInput_AwsRigettiAnkaa(UniversalBaseModel):
    value: AwsQasm3JobInput
    backend_id: typing_extensions.Annotated[typing.Literal["aws.rigetti.ankaa"], FieldMetadata(alias="backendId")] = (
        "aws.rigetti.ankaa"
    )

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True


CreateJobRequestInput = typing_extensions.Annotated[
    typing.Union[
        CreateJobRequestInput_AzureIonqSimulator,
        CreateJobRequestInput_AwsIqmGarnet,
        CreateJobRequestInput_AwsSimSv1,
        CreateJobRequestInput_AwsIonqAria2,
        CreateJobRequestInput_AwsIonqForte,
        CreateJobRequestInput_AwsSimDm1,
        CreateJobRequestInput_AwsIonqAria,
        CreateJobRequestInput_AwsRigettiAnkaa,
    ],
    pydantic.Field(discriminator="backendId"),
]
