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

from ..common import results_common_pb2 as results__common__pb2


class ResultsStub(object):
    """*
    The ResultsService provides methods for interacting with results
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListResults = channel.unary_unary(
                '/armonik.api.grpc.v1.results.Results/ListResults',
                request_serializer=results__common__pb2.ListResultsRequest.SerializeToString,
                response_deserializer=results__common__pb2.ListResultsResponse.FromString,
                )
        self.GetOwnerTaskId = channel.unary_unary(
                '/armonik.api.grpc.v1.results.Results/GetOwnerTaskId',
                request_serializer=results__common__pb2.GetOwnerTaskIdRequest.SerializeToString,
                response_deserializer=results__common__pb2.GetOwnerTaskIdResponse.FromString,
                )


class ResultsServicer(object):
    """*
    The ResultsService provides methods for interacting with results
    """

    def ListResults(self, request, context):
        """*
        Get a results list using pagination, filters and sorting
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetOwnerTaskId(self, request, context):
        """*
        Get the id of the task that should produce the result
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ResultsServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ListResults': grpc.unary_unary_rpc_method_handler(
                    servicer.ListResults,
                    request_deserializer=results__common__pb2.ListResultsRequest.FromString,
                    response_serializer=results__common__pb2.ListResultsResponse.SerializeToString,
            ),
            'GetOwnerTaskId': grpc.unary_unary_rpc_method_handler(
                    servicer.GetOwnerTaskId,
                    request_deserializer=results__common__pb2.GetOwnerTaskIdRequest.FromString,
                    response_serializer=results__common__pb2.GetOwnerTaskIdResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'armonik.api.grpc.v1.results.Results', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Results(object):
    """*
    The ResultsService provides methods for interacting with results
    """

    @staticmethod
    def ListResults(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, '/armonik.api.grpc.v1.results.Results/ListResults',
            results__common__pb2.ListResultsRequest.SerializeToString,
            results__common__pb2.ListResultsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetOwnerTaskId(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, '/armonik.api.grpc.v1.results.Results/GetOwnerTaskId',
            results__common__pb2.GetOwnerTaskIdRequest.SerializeToString,
            results__common__pb2.GetOwnerTaskIdResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
