# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: github_com/TheThingsNetwork/api/protocol/lorawan/device_address.proto

import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()


from ttn.github_com.gogo.protobuf.gogoproto import gogo_pb2 as github__com_dot_gogo_dot_protobuf_dot_gogoproto_dot_gogo__pb2


DESCRIPTOR = _descriptor.FileDescriptor(
  name='github_com/TheThingsNetwork/api/protocol/lorawan/device_address.proto',
  package='lorawan',
  syntax='proto3',
  serialized_pb=_b('\nEgithub_com/TheThingsNetwork/api/protocol/lorawan/device_address.proto\x12\x07lorawan\x1a-github_com/gogo/protobuf/gogoproto/gogo.proto\"\x11\n\x0fPrefixesRequest\"}\n\x10PrefixesResponse\x12\x39\n\x08prefixes\x18\x01 \x03(\x0b\x32\'.lorawan.PrefixesResponse.PrefixMapping\x1a.\n\rPrefixMapping\x12\x0e\n\x06prefix\x18\x01 \x01(\t\x12\r\n\x05usage\x18\x02 \x03(\t\"\x1f\n\x0e\x44\x65vAddrRequest\x12\r\n\x05usage\x18\x01 \x03(\t\"_\n\x0f\x44\x65vAddrResponse\x12L\n\x08\x64\x65v_addr\x18\x01 \x01(\x0c\x42:\xc8\xde\x1f\x00\xda\xde\x1f\x32github_com/TheThingsNetwork/ttn/core/types.DevAddr2\x95\x01\n\x0e\x44\x65vAddrManager\x12\x42\n\x0bGetPrefixes\x12\x18.lorawan.PrefixesRequest\x1a\x19.lorawan.PrefixesResponse\x12?\n\nGetDevAddr\x12\x17.lorawan.DevAddrRequest\x1a\x18.lorawan.DevAddrResponseB\x9c\x01\n)org.thethingsnetwork.api.protocol.lorawanB\x14LoRaWANProtocolProtoP\x01Z0github_com/TheThingsNetwork/api/protocol/lorawan\xaa\x02$TheThingsNetwork.API.LoRaWANProtocolb\x06proto3')
  ,
  dependencies=[github__com_dot_gogo_dot_protobuf_dot_gogoproto_dot_gogo__pb2.DESCRIPTOR,])




_PREFIXESREQUEST = _descriptor.Descriptor(
  name='PrefixesRequest',
  full_name='lorawan.PrefixesRequest',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=129,
  serialized_end=146,
)


_PREFIXESRESPONSE_PREFIXMAPPING = _descriptor.Descriptor(
  name='PrefixMapping',
  full_name='lorawan.PrefixesResponse.PrefixMapping',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='prefix', full_name='lorawan.PrefixesResponse.PrefixMapping.prefix', index=0,
      number=1, type=9, cpp_type=9, label=1,
      has_default_value=False, default_value=_b("").decode('utf-8'),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    _descriptor.FieldDescriptor(
      name='usage', full_name='lorawan.PrefixesResponse.PrefixMapping.usage', index=1,
      number=2, type=9, cpp_type=9, label=3,
      has_default_value=False, default_value=[],
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=227,
  serialized_end=273,
)

_PREFIXESRESPONSE = _descriptor.Descriptor(
  name='PrefixesResponse',
  full_name='lorawan.PrefixesResponse',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='prefixes', full_name='lorawan.PrefixesResponse.prefixes', index=0,
      number=1, type=11, cpp_type=10, label=3,
      has_default_value=False, default_value=[],
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[_PREFIXESRESPONSE_PREFIXMAPPING, ],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=148,
  serialized_end=273,
)


_DEVADDRREQUEST = _descriptor.Descriptor(
  name='DevAddrRequest',
  full_name='lorawan.DevAddrRequest',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='usage', full_name='lorawan.DevAddrRequest.usage', index=0,
      number=1, type=9, cpp_type=9, label=3,
      has_default_value=False, default_value=[],
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=275,
  serialized_end=306,
)


_DEVADDRRESPONSE = _descriptor.Descriptor(
  name='DevAddrResponse',
  full_name='lorawan.DevAddrResponse',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='dev_addr', full_name='lorawan.DevAddrResponse.dev_addr', index=0,
      number=1, type=12, cpp_type=9, label=1,
      has_default_value=False, default_value=_b(""),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), _b('\310\336\037\000\332\336\0372github_com/TheThingsNetwork/ttn/core/types.DevAddr'))),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=308,
  serialized_end=403,
)

_PREFIXESRESPONSE_PREFIXMAPPING.containing_type = _PREFIXESRESPONSE
_PREFIXESRESPONSE.fields_by_name['prefixes'].message_type = _PREFIXESRESPONSE_PREFIXMAPPING
DESCRIPTOR.message_types_by_name['PrefixesRequest'] = _PREFIXESREQUEST
DESCRIPTOR.message_types_by_name['PrefixesResponse'] = _PREFIXESRESPONSE
DESCRIPTOR.message_types_by_name['DevAddrRequest'] = _DEVADDRREQUEST
DESCRIPTOR.message_types_by_name['DevAddrResponse'] = _DEVADDRRESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)

PrefixesRequest = _reflection.GeneratedProtocolMessageType('PrefixesRequest', (_message.Message,), dict(
  DESCRIPTOR = _PREFIXESREQUEST,
  __module__ = 'github_com.TheThingsNetwork.api.protocol.lorawan.device_address_pb2'
  # @@protoc_insertion_point(class_scope:lorawan.PrefixesRequest)
  ))
_sym_db.RegisterMessage(PrefixesRequest)

PrefixesResponse = _reflection.GeneratedProtocolMessageType('PrefixesResponse', (_message.Message,), dict(

  PrefixMapping = _reflection.GeneratedProtocolMessageType('PrefixMapping', (_message.Message,), dict(
    DESCRIPTOR = _PREFIXESRESPONSE_PREFIXMAPPING,
    __module__ = 'github_com.TheThingsNetwork.api.protocol.lorawan.device_address_pb2'
    # @@protoc_insertion_point(class_scope:lorawan.PrefixesResponse.PrefixMapping)
    ))
  ,
  DESCRIPTOR = _PREFIXESRESPONSE,
  __module__ = 'github_com.TheThingsNetwork.api.protocol.lorawan.device_address_pb2'
  # @@protoc_insertion_point(class_scope:lorawan.PrefixesResponse)
  ))
_sym_db.RegisterMessage(PrefixesResponse)
_sym_db.RegisterMessage(PrefixesResponse.PrefixMapping)

DevAddrRequest = _reflection.GeneratedProtocolMessageType('DevAddrRequest', (_message.Message,), dict(
  DESCRIPTOR = _DEVADDRREQUEST,
  __module__ = 'github_com.TheThingsNetwork.api.protocol.lorawan.device_address_pb2'
  # @@protoc_insertion_point(class_scope:lorawan.DevAddrRequest)
  ))
_sym_db.RegisterMessage(DevAddrRequest)

DevAddrResponse = _reflection.GeneratedProtocolMessageType('DevAddrResponse', (_message.Message,), dict(
  DESCRIPTOR = _DEVADDRRESPONSE,
  __module__ = 'github_com.TheThingsNetwork.api.protocol.lorawan.device_address_pb2'
  # @@protoc_insertion_point(class_scope:lorawan.DevAddrResponse)
  ))
_sym_db.RegisterMessage(DevAddrResponse)


DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n)org.thethingsnetwork.api.protocol.lorawanB\024LoRaWANProtocolProtoP\001Z0github_com/TheThingsNetwork/api/protocol/lorawan\252\002$TheThingsNetwork.API.LoRaWANProtocol'))
_DEVADDRRESPONSE.fields_by_name['dev_addr'].has_options = True
_DEVADDRRESPONSE.fields_by_name['dev_addr']._options = _descriptor._ParseOptions(descriptor_pb2.FieldOptions(), _b('\310\336\037\000\332\336\0372github_com/TheThingsNetwork/ttn/core/types.DevAddr'))

_DEVADDRMANAGER = _descriptor.ServiceDescriptor(
  name='DevAddrManager',
  full_name='lorawan.DevAddrManager',
  file=DESCRIPTOR,
  index=0,
  options=None,
  serialized_start=406,
  serialized_end=555,
  methods=[
  _descriptor.MethodDescriptor(
    name='GetPrefixes',
    full_name='lorawan.DevAddrManager.GetPrefixes',
    index=0,
    containing_service=None,
    input_type=_PREFIXESREQUEST,
    output_type=_PREFIXESRESPONSE,
    options=None,
  ),
  _descriptor.MethodDescriptor(
    name='GetDevAddr',
    full_name='lorawan.DevAddrManager.GetDevAddr',
    index=1,
    containing_service=None,
    input_type=_DEVADDRREQUEST,
    output_type=_DEVADDRRESPONSE,
    options=None,
  ),
])
_sym_db.RegisterServiceDescriptor(_DEVADDRMANAGER)

DESCRIPTOR.services_by_name['DevAddrManager'] = _DEVADDRMANAGER

try:
  # THESE ELEMENTS WILL BE DEPRECATED.
  # Please use the generated *_pb2_grpc.py files instead.
  import grpc
  from grpc.beta import implementations as beta_implementations
  from grpc.beta import interfaces as beta_interfaces
  from grpc.framework.common import cardinality
  from grpc.framework.interfaces.face import utilities as face_utilities


  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=PrefixesRequest.SerializeToString,
          response_deserializer=PrefixesResponse.FromString,
          )
      self.GetDevAddr = channel.unary_unary(
          '/lorawan.DevAddrManager/GetDevAddr',
          request_serializer=DevAddrRequest.SerializeToString,
          response_deserializer=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=PrefixesRequest.FromString,
            response_serializer=PrefixesResponse.SerializeToString,
        ),
        'GetDevAddr': grpc.unary_unary_rpc_method_handler(
            servicer.GetDevAddr,
            request_deserializer=DevAddrRequest.FromString,
            response_serializer=DevAddrResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'lorawan.DevAddrManager', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


  class BetaDevAddrManagerServicer(object):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This class was generated
    only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0."""
    """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.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
    def GetDevAddr(self, request, context):
      """Request a device address
      """
      context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)


  class BetaDevAddrManagerStub(object):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This class was generated
    only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0."""
    """The Device Addresses in the network are issued by the NetworkServer
    """
    def GetPrefixes(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
      """Get all prefixes that are in use or available
      """
      raise NotImplementedError()
    GetPrefixes.future = None
    def GetDevAddr(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
      """Request a device address
      """
      raise NotImplementedError()
    GetDevAddr.future = None


  def beta_create_DevAddrManager_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('lorawan.DevAddrManager', 'GetDevAddr'): DevAddrRequest.FromString,
      ('lorawan.DevAddrManager', 'GetPrefixes'): PrefixesRequest.FromString,
    }
    response_serializers = {
      ('lorawan.DevAddrManager', 'GetDevAddr'): DevAddrResponse.SerializeToString,
      ('lorawan.DevAddrManager', 'GetPrefixes'): PrefixesResponse.SerializeToString,
    }
    method_implementations = {
      ('lorawan.DevAddrManager', 'GetDevAddr'): face_utilities.unary_unary_inline(servicer.GetDevAddr),
      ('lorawan.DevAddrManager', 'GetPrefixes'): face_utilities.unary_unary_inline(servicer.GetPrefixes),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options)


  def beta_create_DevAddrManager_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_serializers = {
      ('lorawan.DevAddrManager', 'GetDevAddr'): DevAddrRequest.SerializeToString,
      ('lorawan.DevAddrManager', 'GetPrefixes'): PrefixesRequest.SerializeToString,
    }
    response_deserializers = {
      ('lorawan.DevAddrManager', 'GetDevAddr'): DevAddrResponse.FromString,
      ('lorawan.DevAddrManager', 'GetPrefixes'): PrefixesResponse.FromString,
    }
    cardinalities = {
      'GetDevAddr': cardinality.Cardinality.UNARY_UNARY,
      'GetPrefixes': cardinality.Cardinality.UNARY_UNARY,
    }
    stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size)
    return beta_implementations.dynamic_stub(channel, 'lorawan.DevAddrManager', cardinalities, options=stub_options)
except ImportError:
  pass
# @@protoc_insertion_point(module_scope)
