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

from invoicesrpc import invoices_pb2 as invoicesrpc_dot_invoices__pb2
from lnrpc import rpc_pb2 as lnrpc_dot_rpc__pb2


class InvoicesStub(object):
  """Invoices is a service that can be used to create, accept, settle and cancel
  invoices.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.SubscribeSingleInvoice = channel.unary_stream(
        '/invoicesrpc.Invoices/SubscribeSingleInvoice',
        request_serializer=invoicesrpc_dot_invoices__pb2.SubscribeSingleInvoiceRequest.SerializeToString,
        response_deserializer=lnrpc_dot_rpc__pb2.Invoice.FromString,
        )
    self.CancelInvoice = channel.unary_unary(
        '/invoicesrpc.Invoices/CancelInvoice',
        request_serializer=invoicesrpc_dot_invoices__pb2.CancelInvoiceMsg.SerializeToString,
        response_deserializer=invoicesrpc_dot_invoices__pb2.CancelInvoiceResp.FromString,
        )
    self.AddHoldInvoice = channel.unary_unary(
        '/invoicesrpc.Invoices/AddHoldInvoice',
        request_serializer=invoicesrpc_dot_invoices__pb2.AddHoldInvoiceRequest.SerializeToString,
        response_deserializer=invoicesrpc_dot_invoices__pb2.AddHoldInvoiceResp.FromString,
        )
    self.SettleInvoice = channel.unary_unary(
        '/invoicesrpc.Invoices/SettleInvoice',
        request_serializer=invoicesrpc_dot_invoices__pb2.SettleInvoiceMsg.SerializeToString,
        response_deserializer=invoicesrpc_dot_invoices__pb2.SettleInvoiceResp.FromString,
        )


class InvoicesServicer(object):
  """Invoices is a service that can be used to create, accept, settle and cancel
  invoices.
  """

  def SubscribeSingleInvoice(self, request, context):
    """*
    SubscribeSingleInvoice returns a uni-directional stream (server -> client)
    to notify the client of state transitions of the specified invoice.
    Initially the current invoice state is always sent out.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def CancelInvoice(self, request, context):
    """*
    CancelInvoice cancels a currently open invoice. If the invoice is already 
    canceled, this call will succeed. If the invoice is already settled, it will
    fail.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def AddHoldInvoice(self, request, context):
    """*
    AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
    supplied in the request.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SettleInvoice(self, request, context):
    """*
    SettleInvoice settles an accepted invoice. If the invoice is already
    settled, this call will succeed.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_InvoicesServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'SubscribeSingleInvoice': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeSingleInvoice,
          request_deserializer=invoicesrpc_dot_invoices__pb2.SubscribeSingleInvoiceRequest.FromString,
          response_serializer=lnrpc_dot_rpc__pb2.Invoice.SerializeToString,
      ),
      'CancelInvoice': grpc.unary_unary_rpc_method_handler(
          servicer.CancelInvoice,
          request_deserializer=invoicesrpc_dot_invoices__pb2.CancelInvoiceMsg.FromString,
          response_serializer=invoicesrpc_dot_invoices__pb2.CancelInvoiceResp.SerializeToString,
      ),
      'AddHoldInvoice': grpc.unary_unary_rpc_method_handler(
          servicer.AddHoldInvoice,
          request_deserializer=invoicesrpc_dot_invoices__pb2.AddHoldInvoiceRequest.FromString,
          response_serializer=invoicesrpc_dot_invoices__pb2.AddHoldInvoiceResp.SerializeToString,
      ),
      'SettleInvoice': grpc.unary_unary_rpc_method_handler(
          servicer.SettleInvoice,
          request_deserializer=invoicesrpc_dot_invoices__pb2.SettleInvoiceMsg.FromString,
          response_serializer=invoicesrpc_dot_invoices__pb2.SettleInvoiceResp.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'invoicesrpc.Invoices', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
