
# 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_results_pb2 as qm_dot_pb_dot_job__results__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_results_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 JobResultsServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetJobResultSchema = channel.unary_unary(
                '/qm.grpc.results_analyser.JobResultsService/GetJobResultSchema',
                request_serializer=deterministic_serialize_wrapper(qm_dot_pb_dot_job__results__pb2.GetJobResultSchemaRequest.SerializeToString),
                response_deserializer=qm_dot_pb_dot_job__results__pb2.GetJobResultSchemaResponse.FromString,
                _registered_method=True)
        self.GetJobState = channel.unary_unary(
                '/qm.grpc.results_analyser.JobResultsService/GetJobState',
                request_serializer=deterministic_serialize_wrapper(qm_dot_pb_dot_job__results__pb2.GetJobStateRequest.SerializeToString),
                response_deserializer=qm_dot_pb_dot_job__results__pb2.GetJobStateResponse.FromString,
                _registered_method=True)
        self.GetJobNamedResultHeader = channel.unary_unary(
                '/qm.grpc.results_analyser.JobResultsService/GetJobNamedResultHeader',
                request_serializer=deterministic_serialize_wrapper(qm_dot_pb_dot_job__results__pb2.GetJobNamedResultHeaderRequest.SerializeToString),
                response_deserializer=qm_dot_pb_dot_job__results__pb2.GetJobNamedResultHeaderResponse.FromString,
                _registered_method=True)
        self.GetJobNamedResult = channel.unary_stream(
                '/qm.grpc.results_analyser.JobResultsService/GetJobNamedResult',
                request_serializer=deterministic_serialize_wrapper(qm_dot_pb_dot_job__results__pb2.GetJobNamedResultRequest.SerializeToString),
                response_deserializer=qm_dot_pb_dot_job__results__pb2.GetJobNamedResultResponse.FromString,
                _registered_method=True)
        self.GetJobErrors = channel.unary_unary(
                '/qm.grpc.results_analyser.JobResultsService/GetJobErrors',
                request_serializer=deterministic_serialize_wrapper(qm_dot_pb_dot_job__results__pb2.GetJobErrorsRequest.SerializeToString),
                response_deserializer=qm_dot_pb_dot_job__results__pb2.GetJobErrorsResponse.FromString,
                _registered_method=True)


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

    def GetJobResultSchema(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 GetJobState(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 GetJobNamedResultHeader(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 GetJobNamedResult(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 GetJobErrors(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_JobResultsServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetJobResultSchema': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJobResultSchema,
                    request_deserializer=qm_dot_pb_dot_job__results__pb2.GetJobResultSchemaRequest.FromString,
                    response_serializer=qm_dot_pb_dot_job__results__pb2.GetJobResultSchemaResponse.SerializeToString,
            ),
            'GetJobState': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJobState,
                    request_deserializer=qm_dot_pb_dot_job__results__pb2.GetJobStateRequest.FromString,
                    response_serializer=qm_dot_pb_dot_job__results__pb2.GetJobStateResponse.SerializeToString,
            ),
            'GetJobNamedResultHeader': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJobNamedResultHeader,
                    request_deserializer=qm_dot_pb_dot_job__results__pb2.GetJobNamedResultHeaderRequest.FromString,
                    response_serializer=qm_dot_pb_dot_job__results__pb2.GetJobNamedResultHeaderResponse.SerializeToString,
            ),
            'GetJobNamedResult': grpc.unary_stream_rpc_method_handler(
                    servicer.GetJobNamedResult,
                    request_deserializer=qm_dot_pb_dot_job__results__pb2.GetJobNamedResultRequest.FromString,
                    response_serializer=qm_dot_pb_dot_job__results__pb2.GetJobNamedResultResponse.SerializeToString,
            ),
            'GetJobErrors': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJobErrors,
                    request_deserializer=qm_dot_pb_dot_job__results__pb2.GetJobErrorsRequest.FromString,
                    response_serializer=qm_dot_pb_dot_job__results__pb2.GetJobErrorsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'qm.grpc.results_analyser.JobResultsService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('qm.grpc.results_analyser.JobResultsService', rpc_method_handlers)


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

    @staticmethod
    def GetJobResultSchema(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.results_analyser.JobResultsService/GetJobResultSchema',
            qm_dot_pb_dot_job__results__pb2.GetJobResultSchemaRequest.SerializeToString,
            qm_dot_pb_dot_job__results__pb2.GetJobResultSchemaResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetJobState(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.results_analyser.JobResultsService/GetJobState',
            qm_dot_pb_dot_job__results__pb2.GetJobStateRequest.SerializeToString,
            qm_dot_pb_dot_job__results__pb2.GetJobStateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetJobNamedResultHeader(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.results_analyser.JobResultsService/GetJobNamedResultHeader',
            qm_dot_pb_dot_job__results__pb2.GetJobNamedResultHeaderRequest.SerializeToString,
            qm_dot_pb_dot_job__results__pb2.GetJobNamedResultHeaderResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetJobNamedResult(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_stream(
            request,
            target,
            '/qm.grpc.results_analyser.JobResultsService/GetJobNamedResult',
            qm_dot_pb_dot_job__results__pb2.GetJobNamedResultRequest.SerializeToString,
            qm_dot_pb_dot_job__results__pb2.GetJobNamedResultResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetJobErrors(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.results_analyser.JobResultsService/GetJobErrors',
            qm_dot_pb_dot_job__results__pb2.GetJobErrorsRequest.SerializeToString,
            qm_dot_pb_dot_job__results__pb2.GetJobErrorsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
