# -*- 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_client_orc_to_wireless__handover_client(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module orc_to_wireless - based on the path /handover/client. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_path_helper', '_extmethods', '__mac_address','__old_mac','__new_mac',)

  _yang_name = 'client'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__old_mac = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="old_mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://wireless.com/orc_to_wireless', defining_module='orc_to_wireless', yang_type='mac-address', is_config=True)
    self.__new_mac = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="new_mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://wireless.com/orc_to_wireless', defining_module='orc_to_wireless', yang_type='mac-address', is_config=True)
    self.__mac_address = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://wireless.com/orc_to_wireless', defining_module='orc_to_wireless', yang_type='mac-address', 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 ['handover', 'client']

  def _get_mac_address(self):
    """
    Getter method for mac_address, mapped from YANG variable /handover/client/mac_address (mac-address)
    """
    return self.__mac_address
      
  def _set_mac_address(self, v, load=False):
    """
    Setter method for mac_address, mapped from YANG variable /handover/client/mac_address (mac-address)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_mac_address is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_mac_address() 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={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://wireless.com/orc_to_wireless', defining_module='orc_to_wireless', yang_type='mac-address', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """mac_address must be of a type compatible with mac-address""",
          'defined-type': "orc_to_wireless:mac-address",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://wireless.com/orc_to_wireless', defining_module='orc_to_wireless', yang_type='mac-address', is_config=True)""",
        })

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

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


  def _get_old_mac(self):
    """
    Getter method for old_mac, mapped from YANG variable /handover/client/old_mac (mac-address)
    """
    return self.__old_mac
      
  def _set_old_mac(self, v, load=False):
    """
    Setter method for old_mac, mapped from YANG variable /handover/client/old_mac (mac-address)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_old_mac is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_old_mac() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="old_mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://wireless.com/orc_to_wireless', defining_module='orc_to_wireless', yang_type='mac-address', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """old_mac must be of a type compatible with mac-address""",
          'defined-type': "orc_to_wireless:mac-address",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="old_mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://wireless.com/orc_to_wireless', defining_module='orc_to_wireless', yang_type='mac-address', is_config=True)""",
        })

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

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


  def _get_new_mac(self):
    """
    Getter method for new_mac, mapped from YANG variable /handover/client/new_mac (mac-address)
    """
    return self.__new_mac
      
  def _set_new_mac(self, v, load=False):
    """
    Setter method for new_mac, mapped from YANG variable /handover/client/new_mac (mac-address)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_new_mac is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_new_mac() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="new_mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://wireless.com/orc_to_wireless', defining_module='orc_to_wireless', yang_type='mac-address', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """new_mac must be of a type compatible with mac-address""",
          'defined-type': "orc_to_wireless:mac-address",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="new_mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://wireless.com/orc_to_wireless', defining_module='orc_to_wireless', yang_type='mac-address', is_config=True)""",
        })

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

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

  mac_address = __builtin__.property(_get_mac_address, _set_mac_address)
  old_mac = __builtin__.property(_get_old_mac, _set_old_mac)
  new_mac = __builtin__.property(_get_new_mac, _set_new_mac)


  _pyangbind_elements = OrderedDict([('mac_address', mac_address), ('old_mac', old_mac), ('new_mac', new_mac), ])


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

  _yang_name = 'handover'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__client = YANGDynClass(base=YANGListType("mac_address",yc_client_orc_to_wireless__handover_client, yang_name="client", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='mac-address', extensions=None), is_container='list', yang_name="client", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://wireless.com/orc_to_wireless', defining_module='orc_to_wireless', 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 ['handover']

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

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

  def _unset_client(self):
    self.__client = YANGDynClass(base=YANGListType("mac_address",yc_client_orc_to_wireless__handover_client, yang_name="client", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='mac-address', extensions=None), is_container='list', yang_name="client", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://wireless.com/orc_to_wireless', defining_module='orc_to_wireless', yang_type='list', is_config=True)

  client = __builtin__.property(_get_client, _set_client)


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


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

  _yang_name = 'orc_to_wireless'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

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

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

  def _unset_handover(self):
    self.__handover = YANGDynClass(base=yc_handover_orc_to_wireless__handover, is_container='container', yang_name="handover", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://wireless.com/orc_to_wireless', defining_module='orc_to_wireless', yang_type='container', is_config=True)

  handover = __builtin__.property(_get_handover, _set_handover)


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


