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

from ttn.github_com.TheThingsNetwork.api.protocol.lorawan import device_address_pb2 as github__com_dot_TheThingsNetwork_dot_api_dot_protocol_dot_lorawan_dot_device__address__pb2


class DevAddrManagerStub(object):
  """The Device Addresses in the network are issued by the NetworkServer
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.GetPrefixes = channel.unary_unary(
        '/lorawan.DevAddrManager/GetPrefixes',
        request_serializer=github__com_dot_TheThingsNetwork_dot_api_dot_protocol_dot_lorawan_dot_device__address__pb2.PrefixesRequest.SerializeToString,
        response_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_protocol_dot_lorawan_dot_device__address__pb2.PrefixesResponse.FromString,
        )
    self.GetDevAddr = channel.unary_unary(
        '/lorawan.DevAddrManager/GetDevAddr',
        request_serializer=github__com_dot_TheThingsNetwork_dot_api_dot_protocol_dot_lorawan_dot_device__address__pb2.DevAddrRequest.SerializeToString,
        response_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_protocol_dot_lorawan_dot_device__address__pb2.DevAddrResponse.FromString,
        )


class DevAddrManagerServicer(object):
  """The Device Addresses in the network are issued by the NetworkServer
  """

  def GetPrefixes(self, request, context):
    """Get all prefixes that are in use or available
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetDevAddr(self, request, context):
    """Request a device address
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_DevAddrManagerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GetPrefixes': grpc.unary_unary_rpc_method_handler(
          servicer.GetPrefixes,
          request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_protocol_dot_lorawan_dot_device__address__pb2.PrefixesRequest.FromString,
          response_serializer=github__com_dot_TheThingsNetwork_dot_api_dot_protocol_dot_lorawan_dot_device__address__pb2.PrefixesResponse.SerializeToString,
      ),
      'GetDevAddr': grpc.unary_unary_rpc_method_handler(
          servicer.GetDevAddr,
          request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_protocol_dot_lorawan_dot_device__address__pb2.DevAddrRequest.FromString,
          response_serializer=github__com_dot_TheThingsNetwork_dot_api_dot_protocol_dot_lorawan_dot_device__address__pb2.DevAddrResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'lorawan.DevAddrManager', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
