# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: qm/pb/inc_qm_api.proto
# plugin: python-betterproto
# This file has been @generated
import warnings
from dataclasses import dataclass
from typing import List

import betterproto
import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf

from .. import (
    general_messages as _general_messages__,
    qua_config as _qua_config__,
)


class DigitalInputPortPolarity(betterproto.Enum):
    RISING = 0
    FALLING = 1


@dataclass(eq=False, repr=False)
class HighQmApiRequest(betterproto.Message):
    config: "QmConfig" = betterproto.message_field(1)
    strong_config: "_qua_config__.QuaConfig" = betterproto.message_field(2)
    quantum_machine_id: str = betterproto.string_field(3)
    set_correction: "HighQmApiRequestSetCorrection" = betterproto.message_field(
        51, group="api_oneof"
    )
    set_frequency: "HighQmApiRequestSetFrequency" = betterproto.message_field(
        52, group="api_oneof"
    )
    set_dc_offset: "HighQmApiRequestSetDcOffset" = betterproto.message_field(
        53, group="api_oneof"
    )
    set_digital_route: "HighQmApiRequestSetDigitalRoute" = betterproto.message_field(
        54, group="api_oneof"
    )
    set_io_values: "HighQmApiRequestSetIoValues" = betterproto.message_field(
        55, group="api_oneof"
    )
    set_input_dc_offset: "HighQmApiRequestSetInputDcOffset" = betterproto.message_field(
        56, group="api_oneof"
    )
    set_output_dc_offset: "HighQmApiRequestSetOutputDcOffset" = (
        betterproto.message_field(57, group="api_oneof")
    )
    set_output_filter_taps: "HighQmApiRequestSetOutputFilterTaps" = (
        betterproto.message_field(58, group="api_oneof")
    )
    set_digital_input_threshold: "HighQmApiRequestSetDigitalInputThreshold" = (
        betterproto.message_field(59, group="api_oneof")
    )
    set_digital_input_deadtime: "HighQmApiRequestSetDigitalInputDeadtime" = (
        betterproto.message_field(61, group="api_oneof")
    )
    set_digital_input_polarity: "HighQmApiRequestSetDigitalInputPolarity" = (
        betterproto.message_field(63, group="api_oneof")
    )

    def __post_init__(self) -> None:
        super().__post_init__()
        if self.is_set("config"):
            warnings.warn("HighQmApiRequest.config is deprecated", DeprecationWarning)
        if self.is_set("strong_config"):
            warnings.warn(
                "HighQmApiRequest.strong_config is deprecated", DeprecationWarning
            )
        if self.is_set("set_dc_offset"):
            warnings.warn(
                "HighQmApiRequest.set_dc_offset is deprecated", DeprecationWarning
            )


@dataclass(eq=False, repr=False)
class HighQmApiRequestSetCorrection(betterproto.Message):
    correction: "Matrix" = betterproto.message_field(1)
    qe: str = betterproto.string_field(10, group="oneof_set_correction")
    mixer: "HighQmApiRequestSetCorrectionMixerInfo" = betterproto.message_field(
        11, group="oneof_set_correction"
    )


@dataclass(eq=False, repr=False)
class HighQmApiRequestSetCorrectionMixerInfo(betterproto.Message):
    mixer: str = betterproto.string_field(1)
    intermediate_frequency: int = betterproto.uint64_field(2)
    lo_frequency: int = betterproto.uint64_field(3)
    frequency_negative: bool = betterproto.bool_field(4)
    intermediate_frequency_double: float = betterproto.double_field(5)
    lo_frequency_double: float = betterproto.double_field(6)

    def __post_init__(self) -> None:
        super().__post_init__()
        if self.is_set("intermediate_frequency"):
            warnings.warn(
                "HighQmApiRequestSetCorrectionMixerInfo.intermediate_frequency is deprecated",
                DeprecationWarning,
            )
        if self.is_set("lo_frequency"):
            warnings.warn(
                "HighQmApiRequestSetCorrectionMixerInfo.lo_frequency is deprecated",
                DeprecationWarning,
            )


@dataclass(eq=False, repr=False)
class HighQmApiRequestSetFrequency(betterproto.Message):
    value: float = betterproto.double_field(1)
    qe: str = betterproto.string_field(10, group="oneof_set_frequency")


@dataclass(eq=False, repr=False)
class HighQmApiRequestSetDcOffset(betterproto.Message):
    i: float = betterproto.double_field(1)
    q: float = betterproto.double_field(2)
    qe: "HighQmApiRequestQePort" = betterproto.message_field(10, group="oneof_set_dc")


@dataclass(eq=False, repr=False)
class HighQmApiRequestSetOutputDcOffset(betterproto.Message):
    i: float = betterproto.double_field(1)
    q: float = betterproto.double_field(2)
    qe: "HighQmApiRequestQePort" = betterproto.message_field(10, group="oneof_set_dc")


@dataclass(eq=False, repr=False)
class HighQmApiRequestSetOutputFilterTaps(betterproto.Message):
    filter: "HighQmApiRequestAnalogOutputPortFilter" = betterproto.message_field(1)
    qe: "HighQmApiRequestQePort" = betterproto.message_field(
        10, group="oneof_set_filter_Taps"
    )


@dataclass(eq=False, repr=False)
class HighQmApiRequestAnalogOutputPortFilter(betterproto.Message):
    feedforward: List[float] = betterproto.double_field(1)
    feedback: List[float] = betterproto.double_field(2)


@dataclass(eq=False, repr=False)
class HighQmApiRequestSetInputDcOffset(betterproto.Message):
    offset: float = betterproto.double_field(1)
    qe: "HighQmApiRequestQePort" = betterproto.message_field(10, group="oneof_set_dc")


@dataclass(eq=False, repr=False)
class HighQmApiRequestSetDigitalRoute(betterproto.Message):
    value: int = betterproto.uint32_field(1)
    delay: "HighQmApiRequestQePort" = betterproto.message_field(
        10, group="oneof_set_digital_route"
    )
    buffer: "HighQmApiRequestQePort" = betterproto.message_field(
        11, group="oneof_set_digital_route"
    )
    tof: str = betterproto.string_field(12, group="oneof_set_digital_route")
    smearing: str = betterproto.string_field(13, group="oneof_set_digital_route")


@dataclass(eq=False, repr=False)
class HighQmApiRequestSetIoValues(betterproto.Message):
    all: bool = betterproto.bool_field(1, group="oneof_setType")
    io_value_set_data: List[
        "HighQmApiRequestIoValueSetData"
    ] = betterproto.message_field(51)


@dataclass(eq=False, repr=False)
class HighQmApiRequestQePort(betterproto.Message):
    qe: str = betterproto.string_field(1)
    port: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class HighQmApiRequestIoValueSetData(betterproto.Message):
    io_number: int = betterproto.int32_field(1)
    int_value: int = betterproto.int32_field(2, group="oneof_IO_type")
    double_value: float = betterproto.double_field(3, group="oneof_IO_type")
    boolean_value: bool = betterproto.bool_field(4, group="oneof_IO_type")


@dataclass(eq=False, repr=False)
class HighQmApiRequestSetDigitalInputThreshold(betterproto.Message):
    digital_port: "DigitalInputPort" = betterproto.message_field(1)
    threshold: float = betterproto.double_field(2)


@dataclass(eq=False, repr=False)
class HighQmApiRequestSetDigitalInputPolarity(betterproto.Message):
    digital_port: "DigitalInputPort" = betterproto.message_field(1)
    polarity: "DigitalInputPortPolarity" = betterproto.enum_field(2)


@dataclass(eq=False, repr=False)
class HighQmApiRequestSetDigitalInputDeadtime(betterproto.Message):
    digital_port: "DigitalInputPort" = betterproto.message_field(1)
    deadtime: int = betterproto.uint32_field(2)


@dataclass(eq=False, repr=False)
class DigitalInputPort(betterproto.Message):
    controller_name: str = betterproto.string_field(1)
    port_number: int = betterproto.uint32_field(2)
    fem_number: int = betterproto.uint32_field(3)


@dataclass(eq=False, repr=False)
class HighQmApiResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    errors: List["_general_messages__.ErrorMessage"] = betterproto.message_field(2)


@dataclass(eq=False, repr=False)
class QmConfig(betterproto.Message):
    version: int = betterproto.uint32_field(1)
    root: "betterproto_lib_google_protobuf.Struct" = betterproto.message_field(2)


@dataclass(eq=False, repr=False)
class Matrix(betterproto.Message):
    v00: float = betterproto.double_field(1)
    v01: float = betterproto.double_field(2)
    v10: float = betterproto.double_field(3)
    v11: float = betterproto.double_field(4)


@dataclass(eq=False, repr=False)
class PortReference(betterproto.Message):
    controller: str = betterproto.string_field(1)
    number: int = betterproto.uint32_field(2)
