# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from common.pb2 import book_pb2 as catalog_dot_book__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class BookControllerStub(object):
  # missing associated documentation comment in .proto file
  pass

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

    Args:
      channel: A grpc.Channel.
    """
    self.List = channel.unary_stream(
        '/catalog.BookController/List',
        request_serializer=catalog_dot_book__pb2.BookListRequest.SerializeToString,
        response_deserializer=catalog_dot_book__pb2.Book.FromString,
        )
    self.Create = channel.unary_unary(
        '/catalog.BookController/Create',
        request_serializer=catalog_dot_book__pb2.Book.SerializeToString,
        response_deserializer=catalog_dot_book__pb2.Book.FromString,
        )
    self.Retrieve = channel.unary_unary(
        '/catalog.BookController/Retrieve',
        request_serializer=catalog_dot_book__pb2.BookRetrieveRequest.SerializeToString,
        response_deserializer=catalog_dot_book__pb2.Book.FromString,
        )
    self.Update = channel.unary_unary(
        '/catalog.BookController/Update',
        request_serializer=catalog_dot_book__pb2.Book.SerializeToString,
        response_deserializer=catalog_dot_book__pb2.Book.FromString,
        )
    self.Destroy = channel.unary_unary(
        '/catalog.BookController/Destroy',
        request_serializer=catalog_dot_book__pb2.Book.SerializeToString,
        response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )


class BookControllerServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def List(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Create(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Retrieve(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Update(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Destroy(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    print('IN DESTROY CONTROLLER')
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemente----d!')
    raise NotImplementedError('Method not imple---mented!')


def add_BookControllerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'List': grpc.unary_stream_rpc_method_handler(
          servicer.List,
          request_deserializer=catalog_dot_book__pb2.BookListRequest.FromString,
          response_serializer=catalog_dot_book__pb2.Book.SerializeToString,
      ),
      'Create': grpc.unary_unary_rpc_method_handler(
          servicer.Create,
          request_deserializer=catalog_dot_book__pb2.Book.FromString,
          response_serializer=catalog_dot_book__pb2.Book.SerializeToString,
      ),
      'Retrieve': grpc.unary_unary_rpc_method_handler(
          servicer.Retrieve,
          request_deserializer=catalog_dot_book__pb2.BookRetrieveRequest.FromString,
          response_serializer=catalog_dot_book__pb2.Book.SerializeToString,
      ),
      'Update': grpc.unary_unary_rpc_method_handler(
          servicer.Update,
          request_deserializer=catalog_dot_book__pb2.Book.FromString,
          response_serializer=catalog_dot_book__pb2.Book.SerializeToString,
      ),
      'Destroy': grpc.unary_unary_rpc_method_handler(
          servicer.Destroy,
          request_deserializer=catalog_dot_book__pb2.Book.FromString,
          response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'catalog.BookController', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
