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

from . import storage_pb2 as v1_dot_storage__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Put = channel.unary_unary(
                '/nitric.v1.storage.Storage/Put',
                request_serializer=v1_dot_storage__pb2.PutRequest.SerializeToString,
                response_deserializer=v1_dot_storage__pb2.PutReply.FromString,
                )
        self.Get = channel.unary_unary(
                '/nitric.v1.storage.Storage/Get',
                request_serializer=v1_dot_storage__pb2.GetRequest.SerializeToString,
                response_deserializer=v1_dot_storage__pb2.GetReply.FromString,
                )
        self.Delete = channel.unary_unary(
                '/nitric.v1.storage.Storage/Delete',
                request_serializer=v1_dot_storage__pb2.DeleteRequest.SerializeToString,
                response_deserializer=v1_dot_storage__pb2.DeleteReply.FromString,
                )


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

    def Put(self, request, context):
        """Store an item to a bucket
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Get(self, request, context):
        """Retrieve an item from a bucket
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Delete(self, request, context):
        """Delete an item from a bucket
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_StorageServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Put': grpc.unary_unary_rpc_method_handler(
                    servicer.Put,
                    request_deserializer=v1_dot_storage__pb2.PutRequest.FromString,
                    response_serializer=v1_dot_storage__pb2.PutReply.SerializeToString,
            ),
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=v1_dot_storage__pb2.GetRequest.FromString,
                    response_serializer=v1_dot_storage__pb2.GetReply.SerializeToString,
            ),
            'Delete': grpc.unary_unary_rpc_method_handler(
                    servicer.Delete,
                    request_deserializer=v1_dot_storage__pb2.DeleteRequest.FromString,
                    response_serializer=v1_dot_storage__pb2.DeleteReply.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'nitric.v1.storage.Storage', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def Put(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, '/nitric.v1.storage.Storage/Put',
            v1_dot_storage__pb2.PutRequest.SerializeToString,
            v1_dot_storage__pb2.PutReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Get(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, '/nitric.v1.storage.Storage/Get',
            v1_dot_storage__pb2.GetRequest.SerializeToString,
            v1_dot_storage__pb2.GetReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Delete(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, '/nitric.v1.storage.Storage/Delete',
            v1_dot_storage__pb2.DeleteRequest.SerializeToString,
            v1_dot_storage__pb2.DeleteReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
