# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.yangtypes import YANGDynClass
from pyangbind.lib.yangtypes import ReferenceType
from pyangbind.lib.base import PybindBase
from collections import OrderedDict
from decimal import Decimal
from bitarray import bitarray
import six

# PY3 support of some PY2 keywords (needs improved)
if six.PY3:
  import builtins as __builtin__
  long = int
elif six.PY2:
  import __builtin__

class yc_clients_Ap_to_orc__ApMac_clients(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module Ap_to_orc - based on the path /ApMac/clients. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_path_helper', '_extmethods', '__mac','__ip','__throughput','__Signal',)

  _yang_name = 'clients'

  _pybind_generated_by = 'container'

  def __init__(self, *args, **kwargs):

    self._path_helper = False

    self._extmethods = False
    self.__ip = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}), is_leaf=True, yang_name="ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='ipv4-address', is_config=True)
    self.__mac = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='mac-address', is_config=True)
    self.__throughput = YANGDynClass(base=RestrictedClassType(base_type=Decimal, restriction_dict={u'range': [u'1..3.14', u'10', u'20..max']}), is_leaf=True, yang_name="throughput", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='throughput', is_config=True)
    self.__Signal = YANGDynClass(base=RestrictedClassType(base_type=Decimal, restriction_dict={u'range': [u'1..3.14', u'10', u'20..max']}), is_leaf=True, yang_name="Signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='Signal', is_config=True)

    load = kwargs.pop("load", None)
    if args:
      if len(args) > 1:
        raise TypeError("cannot create a YANG container with >1 argument")
      all_attr = True
      for e in self._pyangbind_elements:
        if not hasattr(args[0], e):
          all_attr = False
          break
      if not all_attr:
        raise ValueError("Supplied object did not have the correct attributes")
      for e in self._pyangbind_elements:
        nobj = getattr(args[0], e)
        if nobj._changed() is False:
          continue
        setmethod = getattr(self, "_set_%s" % e)
        if load is None:
          setmethod(getattr(args[0], e))
        else:
          setmethod(getattr(args[0], e), load=load)

  def _path(self):
    if hasattr(self, "_parent"):
      return self._parent._path()+[self._yang_name]
    else:
      return [u'ApMac', u'clients']

  def _get_mac(self):
    """
    Getter method for mac, mapped from YANG variable /ApMac/clients/mac (mac-address)
    """
    return self.__mac
      
  def _set_mac(self, v, load=False):
    """
    Setter method for mac, mapped from YANG variable /ApMac/clients/mac (mac-address)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_mac is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_mac() directly.
    """
    parent = getattr(self, "_parent", None)
    if parent is not None and load is False:
      raise AttributeError("Cannot set keys directly when" +
                             " within an instantiated list")

    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='mac-address', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """mac must be of a type compatible with mac-address""",
          'defined-type': "Ap_to_orc:mac-address",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='mac-address', is_config=True)""",
        })

    self.__mac = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_mac(self):
    self.__mac = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='mac-address', is_config=True)


  def _get_ip(self):
    """
    Getter method for ip, mapped from YANG variable /ApMac/clients/ip (ipv4-address)
    """
    return self.__ip
      
  def _set_ip(self, v, load=False):
    """
    Setter method for ip, mapped from YANG variable /ApMac/clients/ip (ipv4-address)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ip is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ip() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}), is_leaf=True, yang_name="ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='ipv4-address', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """ip must be of a type compatible with ipv4-address""",
          'defined-type': "Ap_to_orc:ipv4-address",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}), is_leaf=True, yang_name="ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='ipv4-address', is_config=True)""",
        })

    self.__ip = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_ip(self):
    self.__ip = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}), is_leaf=True, yang_name="ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='ipv4-address', is_config=True)


  def _get_throughput(self):
    """
    Getter method for throughput, mapped from YANG variable /ApMac/clients/throughput (throughput)
    """
    return self.__throughput
      
  def _set_throughput(self, v, load=False):
    """
    Setter method for throughput, mapped from YANG variable /ApMac/clients/throughput (throughput)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_throughput is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_throughput() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=Decimal, restriction_dict={u'range': [u'1..3.14', u'10', u'20..max']}), is_leaf=True, yang_name="throughput", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='throughput', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """throughput must be of a type compatible with throughput""",
          'defined-type': "Ap_to_orc:throughput",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=Decimal, restriction_dict={u'range': [u'1..3.14', u'10', u'20..max']}), is_leaf=True, yang_name="throughput", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='throughput', is_config=True)""",
        })

    self.__throughput = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_throughput(self):
    self.__throughput = YANGDynClass(base=RestrictedClassType(base_type=Decimal, restriction_dict={u'range': [u'1..3.14', u'10', u'20..max']}), is_leaf=True, yang_name="throughput", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='throughput', is_config=True)


  def _get_Signal(self):
    """
    Getter method for Signal, mapped from YANG variable /ApMac/clients/Signal (Signal)
    """
    return self.__Signal
      
  def _set_Signal(self, v, load=False):
    """
    Setter method for Signal, mapped from YANG variable /ApMac/clients/Signal (Signal)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_Signal is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_Signal() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=Decimal, restriction_dict={u'range': [u'1..3.14', u'10', u'20..max']}), is_leaf=True, yang_name="Signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='Signal', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """Signal must be of a type compatible with Signal""",
          'defined-type': "Ap_to_orc:Signal",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=Decimal, restriction_dict={u'range': [u'1..3.14', u'10', u'20..max']}), is_leaf=True, yang_name="Signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='Signal', is_config=True)""",
        })

    self.__Signal = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_Signal(self):
    self.__Signal = YANGDynClass(base=RestrictedClassType(base_type=Decimal, restriction_dict={u'range': [u'1..3.14', u'10', u'20..max']}), is_leaf=True, yang_name="Signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='Signal', is_config=True)

  mac = __builtin__.property(_get_mac, _set_mac)
  ip = __builtin__.property(_get_ip, _set_ip)
  throughput = __builtin__.property(_get_throughput, _set_throughput)
  Signal = __builtin__.property(_get_Signal, _set_Signal)


  _pyangbind_elements = OrderedDict([('mac', mac), ('ip', ip), ('throughput', throughput), ('Signal', Signal), ])


class yc_ApMac_Ap_to_orc__ApMac(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module Ap_to_orc - based on the path /ApMac. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_path_helper', '_extmethods', '__clients',)

  _yang_name = 'ApMac'

  _pybind_generated_by = 'container'

  def __init__(self, *args, **kwargs):

    self._path_helper = False

    self._extmethods = False
    self.__clients = YANGDynClass(base=YANGListType("mac",yc_clients_Ap_to_orc__ApMac_clients, yang_name="clients", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='mac', extensions=None), is_container='list', yang_name="clients", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='list', is_config=True)

    load = kwargs.pop("load", None)
    if args:
      if len(args) > 1:
        raise TypeError("cannot create a YANG container with >1 argument")
      all_attr = True
      for e in self._pyangbind_elements:
        if not hasattr(args[0], e):
          all_attr = False
          break
      if not all_attr:
        raise ValueError("Supplied object did not have the correct attributes")
      for e in self._pyangbind_elements:
        nobj = getattr(args[0], e)
        if nobj._changed() is False:
          continue
        setmethod = getattr(self, "_set_%s" % e)
        if load is None:
          setmethod(getattr(args[0], e))
        else:
          setmethod(getattr(args[0], e), load=load)

  def _path(self):
    if hasattr(self, "_parent"):
      return self._parent._path()+[self._yang_name]
    else:
      return [u'ApMac']

  def _get_clients(self):
    """
    Getter method for clients, mapped from YANG variable /ApMac/clients (list)
    """
    return self.__clients
      
  def _set_clients(self, v, load=False):
    """
    Setter method for clients, mapped from YANG variable /ApMac/clients (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_clients is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_clients() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGListType("mac",yc_clients_Ap_to_orc__ApMac_clients, yang_name="clients", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='mac', extensions=None), is_container='list', yang_name="clients", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='list', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """clients must be of a type compatible with list""",
          'defined-type': "list",
          'generated-type': """YANGDynClass(base=YANGListType("mac",yc_clients_Ap_to_orc__ApMac_clients, yang_name="clients", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='mac', extensions=None), is_container='list', yang_name="clients", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='list', is_config=True)""",
        })

    self.__clients = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_clients(self):
    self.__clients = YANGDynClass(base=YANGListType("mac",yc_clients_Ap_to_orc__ApMac_clients, yang_name="clients", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='mac', extensions=None), is_container='list', yang_name="clients", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='list', is_config=True)

  clients = __builtin__.property(_get_clients, _set_clients)


  _pyangbind_elements = OrderedDict([('clients', clients), ])


class Ap_to_orc(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module Ap_to_orc - based on the path /Ap_to_orc. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_path_helper', '_extmethods', '__ApMac',)

  _yang_name = 'Ap_to_orc'

  _pybind_generated_by = 'container'

  def __init__(self, *args, **kwargs):

    self._path_helper = False

    self._extmethods = False
    self.__ApMac = YANGDynClass(base=yc_ApMac_Ap_to_orc__ApMac, is_container='container', yang_name="ApMac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='container', is_config=True)

    load = kwargs.pop("load", None)
    if args:
      if len(args) > 1:
        raise TypeError("cannot create a YANG container with >1 argument")
      all_attr = True
      for e in self._pyangbind_elements:
        if not hasattr(args[0], e):
          all_attr = False
          break
      if not all_attr:
        raise ValueError("Supplied object did not have the correct attributes")
      for e in self._pyangbind_elements:
        nobj = getattr(args[0], e)
        if nobj._changed() is False:
          continue
        setmethod = getattr(self, "_set_%s" % e)
        if load is None:
          setmethod(getattr(args[0], e))
        else:
          setmethod(getattr(args[0], e), load=load)

  def _path(self):
    if hasattr(self, "_parent"):
      return self._parent._path()+[self._yang_name]
    else:
      return []

  def _get_ApMac(self):
    """
    Getter method for ApMac, mapped from YANG variable /ApMac (container)
    """
    return self.__ApMac
      
  def _set_ApMac(self, v, load=False):
    """
    Setter method for ApMac, mapped from YANG variable /ApMac (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ApMac is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ApMac() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=yc_ApMac_Ap_to_orc__ApMac, is_container='container', yang_name="ApMac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """ApMac must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=yc_ApMac_Ap_to_orc__ApMac, is_container='container', yang_name="ApMac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='container', is_config=True)""",
        })

    self.__ApMac = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_ApMac(self):
    self.__ApMac = YANGDynClass(base=yc_ApMac_Ap_to_orc__ApMac, is_container='container', yang_name="ApMac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://Ap.com/Ap_to_orc', defining_module='Ap_to_orc', yang_type='container', is_config=True)

  ApMac = __builtin__.property(_get_ApMac, _set_ApMac)


  _pyangbind_elements = OrderedDict([('ApMac', ApMac), ])


