
# 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.pb import job_manager_pb2 as qm_dot_pb_dot_job__manager__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/pb/job_manager_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 JobManagerServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetElementCorrection = channel.unary_unary(
                '/qm.grpc.job_manager.JobManagerService/GetElementCorrection',
                request_serializer=deterministic_serialize_wrapper(qm_dot_pb_dot_job__manager__pb2.GetElementCorrectionRequest.SerializeToString),
                response_deserializer=qm_dot_pb_dot_job__manager__pb2.GetElementCorrectionResponse.FromString,
                _registered_method=True)
        self.SetElementCorrection = channel.unary_unary(
                '/qm.grpc.job_manager.JobManagerService/SetElementCorrection',
                request_serializer=deterministic_serialize_wrapper(qm_dot_pb_dot_job__manager__pb2.SetElementCorrectionRequest.SerializeToString),
                response_deserializer=qm_dot_pb_dot_job__manager__pb2.SetElementCorrectionResponse.FromString,
                _registered_method=True)
        self.InsertInputStream = channel.unary_unary(
                '/qm.grpc.job_manager.JobManagerService/InsertInputStream',
                request_serializer=deterministic_serialize_wrapper(qm_dot_pb_dot_job__manager__pb2.InsertInputStreamRequest.SerializeToString),
                response_deserializer=qm_dot_pb_dot_job__manager__pb2.InsertInputStreamResponse.FromString,
                _registered_method=True)
        self.UpdateOscillatorFrequency = channel.unary_unary(
                '/qm.grpc.job_manager.JobManagerService/UpdateOscillatorFrequency',
                request_serializer=deterministic_serialize_wrapper(qm_dot_pb_dot_job__manager__pb2.ChangeOscillatorFrequencyRequest.SerializeToString),
                response_deserializer=qm_dot_pb_dot_job__manager__pb2.ChangeOscillatorFrequencyResponse.FromString,
                _registered_method=True)


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

    def GetElementCorrection(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 SetElementCorrection(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 InsertInputStream(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 UpdateOscillatorFrequency(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_JobManagerServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetElementCorrection': grpc.unary_unary_rpc_method_handler(
                    servicer.GetElementCorrection,
                    request_deserializer=qm_dot_pb_dot_job__manager__pb2.GetElementCorrectionRequest.FromString,
                    response_serializer=qm_dot_pb_dot_job__manager__pb2.GetElementCorrectionResponse.SerializeToString,
            ),
            'SetElementCorrection': grpc.unary_unary_rpc_method_handler(
                    servicer.SetElementCorrection,
                    request_deserializer=qm_dot_pb_dot_job__manager__pb2.SetElementCorrectionRequest.FromString,
                    response_serializer=qm_dot_pb_dot_job__manager__pb2.SetElementCorrectionResponse.SerializeToString,
            ),
            'InsertInputStream': grpc.unary_unary_rpc_method_handler(
                    servicer.InsertInputStream,
                    request_deserializer=qm_dot_pb_dot_job__manager__pb2.InsertInputStreamRequest.FromString,
                    response_serializer=qm_dot_pb_dot_job__manager__pb2.InsertInputStreamResponse.SerializeToString,
            ),
            'UpdateOscillatorFrequency': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateOscillatorFrequency,
                    request_deserializer=qm_dot_pb_dot_job__manager__pb2.ChangeOscillatorFrequencyRequest.FromString,
                    response_serializer=qm_dot_pb_dot_job__manager__pb2.ChangeOscillatorFrequencyResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'qm.grpc.job_manager.JobManagerService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('qm.grpc.job_manager.JobManagerService', rpc_method_handlers)


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

    @staticmethod
    def GetElementCorrection(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.job_manager.JobManagerService/GetElementCorrection',
            qm_dot_pb_dot_job__manager__pb2.GetElementCorrectionRequest.SerializeToString,
            qm_dot_pb_dot_job__manager__pb2.GetElementCorrectionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SetElementCorrection(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.job_manager.JobManagerService/SetElementCorrection',
            qm_dot_pb_dot_job__manager__pb2.SetElementCorrectionRequest.SerializeToString,
            qm_dot_pb_dot_job__manager__pb2.SetElementCorrectionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def InsertInputStream(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.job_manager.JobManagerService/InsertInputStream',
            qm_dot_pb_dot_job__manager__pb2.InsertInputStreamRequest.SerializeToString,
            qm_dot_pb_dot_job__manager__pb2.InsertInputStreamResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateOscillatorFrequency(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.job_manager.JobManagerService/UpdateOscillatorFrequency',
            qm_dot_pb_dot_job__manager__pb2.ChangeOscillatorFrequencyRequest.SerializeToString,
            qm_dot_pb_dot_job__manager__pb2.ChangeOscillatorFrequencyResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
