# 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 objects_pb2 as objects__pb2
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.GetResult = channel.unary_unary(
                '/armonik.api.grpc.v1.results.Results/GetResult',
                request_serializer=results__common__pb2.GetResultRequest.SerializeToString,
                response_deserializer=results__common__pb2.GetResultResponse.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,
                )
        self.CreateResultsMetaData = channel.unary_unary(
                '/armonik.api.grpc.v1.results.Results/CreateResultsMetaData',
                request_serializer=results__common__pb2.CreateResultsMetaDataRequest.SerializeToString,
                response_deserializer=results__common__pb2.CreateResultsMetaDataResponse.FromString,
                )
        self.CreateResults = channel.unary_unary(
                '/armonik.api.grpc.v1.results.Results/CreateResults',
                request_serializer=results__common__pb2.CreateResultsRequest.SerializeToString,
                response_deserializer=results__common__pb2.CreateResultsResponse.FromString,
                )
        self.UploadResultData = channel.stream_unary(
                '/armonik.api.grpc.v1.results.Results/UploadResultData',
                request_serializer=results__common__pb2.UploadResultDataRequest.SerializeToString,
                response_deserializer=results__common__pb2.UploadResultDataResponse.FromString,
                )
        self.DownloadResultData = channel.unary_stream(
                '/armonik.api.grpc.v1.results.Results/DownloadResultData',
                request_serializer=results__common__pb2.DownloadResultDataRequest.SerializeToString,
                response_deserializer=results__common__pb2.DownloadResultDataResponse.FromString,
                )
        self.DeleteResultsData = channel.unary_unary(
                '/armonik.api.grpc.v1.results.Results/DeleteResultsData',
                request_serializer=results__common__pb2.DeleteResultsDataRequest.SerializeToString,
                response_deserializer=results__common__pb2.DeleteResultsDataResponse.FromString,
                )
        self.GetServiceConfiguration = channel.unary_unary(
                '/armonik.api.grpc.v1.results.Results/GetServiceConfiguration',
                request_serializer=objects__pb2.Empty.SerializeToString,
                response_deserializer=results__common__pb2.ResultsServiceConfigurationResponse.FromString,
                )
        self.WatchResults = channel.stream_stream(
                '/armonik.api.grpc.v1.results.Results/WatchResults',
                request_serializer=results__common__pb2.WatchResultRequest.SerializeToString,
                response_deserializer=results__common__pb2.WatchResultResponse.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 GetResult(self, request, context):
        """*
        Get a result by id.
        """
        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 CreateResultsMetaData(self, request, context):
        """*
        Create the metadata of multiple results at once
        Data have to be uploaded separately
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateResults(self, request, context):
        """*
        Create one result with data included in the request
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UploadResultData(self, request_iterator, context):
        """*
        Upload data for result with stream
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DownloadResultData(self, request, context):
        """*
        Retrieve data
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteResultsData(self, request, context):
        """*
        Delete data from multiple results
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetServiceConfiguration(self, request, context):
        """*
        Get the configuration of the service
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def WatchResults(self, request_iterator, context):
        """*
        This endpoint allows a user to watch a list of results and be notified when there is any change.
        The user sends the list of ids they want to watch.
        The submitter will then send the statuses for all requested ids immediately and keep the stream open.
        Ids not present in DB will be returned at that time with the special state NOTFOUND.
        The submitter will send updates to the client via the opened stream.
        Any reply can be implicitely chunked if there are too many event to report at the same time (or for the first reply).
        It is possible to filter out specific statuses from events.
        """
        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,
            ),
            'GetResult': grpc.unary_unary_rpc_method_handler(
                    servicer.GetResult,
                    request_deserializer=results__common__pb2.GetResultRequest.FromString,
                    response_serializer=results__common__pb2.GetResultResponse.SerializeToString,
            ),
            'GetOwnerTaskId': grpc.unary_unary_rpc_method_handler(
                    servicer.GetOwnerTaskId,
                    request_deserializer=results__common__pb2.GetOwnerTaskIdRequest.FromString,
                    response_serializer=results__common__pb2.GetOwnerTaskIdResponse.SerializeToString,
            ),
            'CreateResultsMetaData': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateResultsMetaData,
                    request_deserializer=results__common__pb2.CreateResultsMetaDataRequest.FromString,
                    response_serializer=results__common__pb2.CreateResultsMetaDataResponse.SerializeToString,
            ),
            'CreateResults': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateResults,
                    request_deserializer=results__common__pb2.CreateResultsRequest.FromString,
                    response_serializer=results__common__pb2.CreateResultsResponse.SerializeToString,
            ),
            'UploadResultData': grpc.stream_unary_rpc_method_handler(
                    servicer.UploadResultData,
                    request_deserializer=results__common__pb2.UploadResultDataRequest.FromString,
                    response_serializer=results__common__pb2.UploadResultDataResponse.SerializeToString,
            ),
            'DownloadResultData': grpc.unary_stream_rpc_method_handler(
                    servicer.DownloadResultData,
                    request_deserializer=results__common__pb2.DownloadResultDataRequest.FromString,
                    response_serializer=results__common__pb2.DownloadResultDataResponse.SerializeToString,
            ),
            'DeleteResultsData': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteResultsData,
                    request_deserializer=results__common__pb2.DeleteResultsDataRequest.FromString,
                    response_serializer=results__common__pb2.DeleteResultsDataResponse.SerializeToString,
            ),
            'GetServiceConfiguration': grpc.unary_unary_rpc_method_handler(
                    servicer.GetServiceConfiguration,
                    request_deserializer=objects__pb2.Empty.FromString,
                    response_serializer=results__common__pb2.ResultsServiceConfigurationResponse.SerializeToString,
            ),
            'WatchResults': grpc.stream_stream_rpc_method_handler(
                    servicer.WatchResults,
                    request_deserializer=results__common__pb2.WatchResultRequest.FromString,
                    response_serializer=results__common__pb2.WatchResultResponse.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 GetResult(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/GetResult',
            results__common__pb2.GetResultRequest.SerializeToString,
            results__common__pb2.GetResultResponse.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)

    @staticmethod
    def CreateResultsMetaData(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/CreateResultsMetaData',
            results__common__pb2.CreateResultsMetaDataRequest.SerializeToString,
            results__common__pb2.CreateResultsMetaDataResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreateResults(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/CreateResults',
            results__common__pb2.CreateResultsRequest.SerializeToString,
            results__common__pb2.CreateResultsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def UploadResultData(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_unary(request_iterator, target, '/armonik.api.grpc.v1.results.Results/UploadResultData',
            results__common__pb2.UploadResultDataRequest.SerializeToString,
            results__common__pb2.UploadResultDataResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

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

    @staticmethod
    def DeleteResultsData(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/DeleteResultsData',
            results__common__pb2.DeleteResultsDataRequest.SerializeToString,
            results__common__pb2.DeleteResultsDataResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetServiceConfiguration(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/GetServiceConfiguration',
            objects__pb2.Empty.SerializeToString,
            results__common__pb2.ResultsServiceConfigurationResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def WatchResults(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/armonik.api.grpc.v1.results.Results/WatchResults',
            results__common__pb2.WatchResultRequest.SerializeToString,
            results__common__pb2.WatchResultResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
