
# Wrapper to enforce deterministic serialization
def deterministic_serialize_wrapper(orig_serialize_func):
    def wrapped(msg):
        return orig_serialize_func(msg, deterministic=True)
    return wrapped

# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

from qm.grpc.qm.grpc.v2 import qmm_api_pb2 as qm_dot_grpc_dot_v2_dot_qmm__api__pb2

GRPC_GENERATED_VERSION = '1.68.1'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in qm/grpc/v2/qmm_api_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class QmmServiceStub(object):
    """Missing associated documentation comment in .proto file."""

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.GetVersion = channel.unary_unary(
                '/qm.grpc.v2.QmmService/GetVersion',
                request_serializer=deterministic_serialize_wrapper(qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetVersionRequest.SerializeToString),
                response_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetVersionResponse.FromString,
                _registered_method=True)
        self.HealthCheck = channel.unary_unary(
                '/qm.grpc.v2.QmmService/HealthCheck',
                request_serializer=deterministic_serialize_wrapper(qm_dot_grpc_dot_v2_dot_qmm__api__pb2.HealthCheckRequest.SerializeToString),
                response_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.HealthCheckResponse.FromString,
                _registered_method=True)
        self.GetControllers = channel.unary_unary(
                '/qm.grpc.v2.QmmService/GetControllers',
                request_serializer=deterministic_serialize_wrapper(qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetControllersRequest.SerializeToString),
                response_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetControllersResponse.FromString,
                _registered_method=True)
        self.OpenQuantumMachine = channel.unary_unary(
                '/qm.grpc.v2.QmmService/OpenQuantumMachine',
                request_serializer=deterministic_serialize_wrapper(qm_dot_grpc_dot_v2_dot_qmm__api__pb2.OpenQuantumMachineRequest.SerializeToString),
                response_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.OpenQuantumMachineResponse.FromString,
                _registered_method=True)
        self.GetQuantumMachine = channel.unary_unary(
                '/qm.grpc.v2.QmmService/GetQuantumMachine',
                request_serializer=deterministic_serialize_wrapper(qm_dot_grpc_dot_v2_dot_qmm__api__pb2.QmmServiceGetQuantumMachineRequest.SerializeToString),
                response_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetQuantumMachineResponse.FromString,
                _registered_method=True)
        self.ListOpenQuantumMachines = channel.unary_unary(
                '/qm.grpc.v2.QmmService/ListOpenQuantumMachines',
                request_serializer=deterministic_serialize_wrapper(qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ListOpenQuantumMachinesRequest.SerializeToString),
                response_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ListOpenQuantumMachinesResponse.FromString,
                _registered_method=True)
        self.CloseAllQuantumMachines = channel.unary_unary(
                '/qm.grpc.v2.QmmService/CloseAllQuantumMachines',
                request_serializer=deterministic_serialize_wrapper(qm_dot_grpc_dot_v2_dot_qmm__api__pb2.CloseAllQuantumMachinesRequest.SerializeToString),
                response_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.CloseAllQuantumMachinesResponse.FromString,
                _registered_method=True)
        self.ClearAllJobResults = channel.unary_unary(
                '/qm.grpc.v2.QmmService/ClearAllJobResults',
                request_serializer=deterministic_serialize_wrapper(qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ClearAllJobResultsRequest.SerializeToString),
                response_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ClearAllJobResultsResponse.FromString,
                _registered_method=True)
        self.GetJobs = channel.unary_unary(
                '/qm.grpc.v2.QmmService/GetJobs',
                request_serializer=deterministic_serialize_wrapper(qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetJobsRequest.SerializeToString),
                response_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetJobsResponse.FromString,
                _registered_method=True)
        self.ResetDataProcessing = channel.unary_unary(
                '/qm.grpc.v2.QmmService/ResetDataProcessing',
                request_serializer=deterministic_serialize_wrapper(qm_dot_grpc_dot_v2_dot_qmm__api__pb2.QmmServiceResetDataProcessingRequest.SerializeToString),
                response_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ResetDataProcessingResponse.FromString,
                _registered_method=True)
        self.Simulate = channel.unary_unary(
                '/qm.grpc.v2.QmmService/Simulate',
                request_serializer=deterministic_serialize_wrapper(qm_dot_grpc_dot_v2_dot_qmm__api__pb2.QmmServiceSimulateRequest.SerializeToString),
                response_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.QmmServiceSimulateResponse.FromString,
                _registered_method=True)


class QmmServiceServicer(object):
    """Missing associated documentation comment in .proto file."""

    def GetVersion(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def HealthCheck(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetControllers(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def OpenQuantumMachine(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetQuantumMachine(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListOpenQuantumMachines(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CloseAllQuantumMachines(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ClearAllJobResults(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetJobs(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ResetDataProcessing(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Simulate(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_QmmServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetVersion': grpc.unary_unary_rpc_method_handler(
                    servicer.GetVersion,
                    request_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetVersionRequest.FromString,
                    response_serializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetVersionResponse.SerializeToString,
            ),
            'HealthCheck': grpc.unary_unary_rpc_method_handler(
                    servicer.HealthCheck,
                    request_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.HealthCheckRequest.FromString,
                    response_serializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.HealthCheckResponse.SerializeToString,
            ),
            'GetControllers': grpc.unary_unary_rpc_method_handler(
                    servicer.GetControllers,
                    request_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetControllersRequest.FromString,
                    response_serializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetControllersResponse.SerializeToString,
            ),
            'OpenQuantumMachine': grpc.unary_unary_rpc_method_handler(
                    servicer.OpenQuantumMachine,
                    request_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.OpenQuantumMachineRequest.FromString,
                    response_serializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.OpenQuantumMachineResponse.SerializeToString,
            ),
            'GetQuantumMachine': grpc.unary_unary_rpc_method_handler(
                    servicer.GetQuantumMachine,
                    request_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.QmmServiceGetQuantumMachineRequest.FromString,
                    response_serializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetQuantumMachineResponse.SerializeToString,
            ),
            'ListOpenQuantumMachines': grpc.unary_unary_rpc_method_handler(
                    servicer.ListOpenQuantumMachines,
                    request_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ListOpenQuantumMachinesRequest.FromString,
                    response_serializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ListOpenQuantumMachinesResponse.SerializeToString,
            ),
            'CloseAllQuantumMachines': grpc.unary_unary_rpc_method_handler(
                    servicer.CloseAllQuantumMachines,
                    request_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.CloseAllQuantumMachinesRequest.FromString,
                    response_serializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.CloseAllQuantumMachinesResponse.SerializeToString,
            ),
            'ClearAllJobResults': grpc.unary_unary_rpc_method_handler(
                    servicer.ClearAllJobResults,
                    request_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ClearAllJobResultsRequest.FromString,
                    response_serializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ClearAllJobResultsResponse.SerializeToString,
            ),
            'GetJobs': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJobs,
                    request_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetJobsRequest.FromString,
                    response_serializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetJobsResponse.SerializeToString,
            ),
            'ResetDataProcessing': grpc.unary_unary_rpc_method_handler(
                    servicer.ResetDataProcessing,
                    request_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.QmmServiceResetDataProcessingRequest.FromString,
                    response_serializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ResetDataProcessingResponse.SerializeToString,
            ),
            'Simulate': grpc.unary_unary_rpc_method_handler(
                    servicer.Simulate,
                    request_deserializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.QmmServiceSimulateRequest.FromString,
                    response_serializer=qm_dot_grpc_dot_v2_dot_qmm__api__pb2.QmmServiceSimulateResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'qm.grpc.v2.QmmService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('qm.grpc.v2.QmmService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class QmmService(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def GetVersion(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/qm.grpc.v2.QmmService/GetVersion',
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetVersionRequest.SerializeToString,
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetVersionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def HealthCheck(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/qm.grpc.v2.QmmService/HealthCheck',
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.HealthCheckRequest.SerializeToString,
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.HealthCheckResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetControllers(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/qm.grpc.v2.QmmService/GetControllers',
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetControllersRequest.SerializeToString,
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetControllersResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def OpenQuantumMachine(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/qm.grpc.v2.QmmService/OpenQuantumMachine',
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.OpenQuantumMachineRequest.SerializeToString,
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.OpenQuantumMachineResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetQuantumMachine(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/qm.grpc.v2.QmmService/GetQuantumMachine',
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.QmmServiceGetQuantumMachineRequest.SerializeToString,
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetQuantumMachineResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListOpenQuantumMachines(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/qm.grpc.v2.QmmService/ListOpenQuantumMachines',
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ListOpenQuantumMachinesRequest.SerializeToString,
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ListOpenQuantumMachinesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CloseAllQuantumMachines(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/qm.grpc.v2.QmmService/CloseAllQuantumMachines',
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.CloseAllQuantumMachinesRequest.SerializeToString,
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.CloseAllQuantumMachinesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ClearAllJobResults(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/qm.grpc.v2.QmmService/ClearAllJobResults',
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ClearAllJobResultsRequest.SerializeToString,
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ClearAllJobResultsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetJobs(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/qm.grpc.v2.QmmService/GetJobs',
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetJobsRequest.SerializeToString,
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.GetJobsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ResetDataProcessing(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/qm.grpc.v2.QmmService/ResetDataProcessing',
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.QmmServiceResetDataProcessingRequest.SerializeToString,
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.ResetDataProcessingResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Simulate(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/qm.grpc.v2.QmmService/Simulate',
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.QmmServiceSimulateRequest.SerializeToString,
            qm_dot_grpc_dot_v2_dot_qmm__api__pb2.QmmServiceSimulateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
