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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .azure_ionq_job_input_circuit_item_type import AzureIonqJobInputCircuitItemType


class AzureIonqJobInputCircuitItem(UniversalBaseModel):
    """
    A gate application to qubit in the circuit
    """

    type: typing.Optional[AzureIonqJobInputCircuitItemType] = pydantic.Field(default=None)
    """
    Gate name
    """

    targets: typing.List[int] = pydantic.Field()
    """
    Qubit indices the gate is applied to
    """

    controls: typing.Optional[typing.List[int]] = pydantic.Field(default=None)
    """
    Optional control-qubit indices
    """

    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
