# 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 partitions_common_pb2 as partitions__common__pb2


class PartitionsStub(object):
    """*
    The PartitionsService provides methods to manage partitions.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListPartitions = channel.unary_unary(
                '/armonik.api.grpc.v1.partitions.Partitions/ListPartitions',
                request_serializer=partitions__common__pb2.ListPartitionsRequest.SerializeToString,
                response_deserializer=partitions__common__pb2.ListPartitionsResponse.FromString,
                )
        self.GetPartition = channel.unary_unary(
                '/armonik.api.grpc.v1.partitions.Partitions/GetPartition',
                request_serializer=partitions__common__pb2.GetPartitionRequest.SerializeToString,
                response_deserializer=partitions__common__pb2.GetPartitionResponse.FromString,
                )


class PartitionsServicer(object):
    """*
    The PartitionsService provides methods to manage partitions.
    """

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

    def GetPartition(self, request, context):
        """*
        Get a partition by its ID.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PartitionsServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ListPartitions': grpc.unary_unary_rpc_method_handler(
                    servicer.ListPartitions,
                    request_deserializer=partitions__common__pb2.ListPartitionsRequest.FromString,
                    response_serializer=partitions__common__pb2.ListPartitionsResponse.SerializeToString,
            ),
            'GetPartition': grpc.unary_unary_rpc_method_handler(
                    servicer.GetPartition,
                    request_deserializer=partitions__common__pb2.GetPartitionRequest.FromString,
                    response_serializer=partitions__common__pb2.GetPartitionResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'armonik.api.grpc.v1.partitions.Partitions', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Partitions(object):
    """*
    The PartitionsService provides methods to manage partitions.
    """

    @staticmethod
    def ListPartitions(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.partitions.Partitions/ListPartitions',
            partitions__common__pb2.ListPartitionsRequest.SerializeToString,
            partitions__common__pb2.ListPartitionsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetPartition(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.partitions.Partitions/GetPartition',
            partitions__common__pb2.GetPartitionRequest.SerializeToString,
            partitions__common__pb2.GetPartitionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
