# -*- 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_switchport_list_interfaces__interface_container_switchport_list(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module interfaces - based on the path /interface-container/switchport-list. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: List of physical switchports
  """
  __slots__ = ('_path_helper', '_extmethods', '__name','__enabled','__vlan',)

  _yang_name = 'switchport-list'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='string', is_config=True)
    self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='boolean', is_config=True)
    self.__vlan = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='vlan-type', 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 ['interface-container', 'switchport-list']

  def _get_name(self):
    """
    Getter method for name, mapped from YANG variable /interface_container/switchport_list/name (string)

    YANG Description: Name of the interface
    """
    return self.__name
      
  def _set_name(self, v, load=False):
    """
    Setter method for name, mapped from YANG variable /interface_container/switchport_list/name (string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_name is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_name() directly.

    YANG Description: Name of the interface
    """
    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=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='string', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """name must be of a type compatible with string""",
          'defined-type': "string",
          'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='string', is_config=True)""",
        })

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

  def _unset_name(self):
    self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='string', is_config=True)


  def _get_enabled(self):
    """
    Getter method for enabled, mapped from YANG variable /interface_container/switchport_list/enabled (boolean)

    YANG Description: True if interface is enabled, false otherwise
    """
    return self.__enabled
      
  def _set_enabled(self, v, load=False):
    """
    Setter method for enabled, mapped from YANG variable /interface_container/switchport_list/enabled (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_enabled is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_enabled() directly.

    YANG Description: True if interface is enabled, false otherwise
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='boolean', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """enabled must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='boolean', is_config=True)""",
        })

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

  def _unset_enabled(self):
    self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='boolean', is_config=True)


  def _get_vlan(self):
    """
    Getter method for vlan, mapped from YANG variable /interface_container/switchport_list/vlan (vlan-type)

    YANG Description: VLAN assigned to switchport
    """
    return self.__vlan
      
  def _set_vlan(self, v, load=False):
    """
    Setter method for vlan, mapped from YANG variable /interface_container/switchport_list/vlan (vlan-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_vlan is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_vlan() directly.

    YANG Description: VLAN assigned to switchport
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='vlan-type', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """vlan must be of a type compatible with vlan-type""",
          'defined-type': "interfaces:vlan-type",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='vlan-type', is_config=True)""",
        })

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

  def _unset_vlan(self):
    self.__vlan = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='vlan-type', is_config=True)

  name = __builtin__.property(_get_name, _set_name)
  enabled = __builtin__.property(_get_enabled, _set_enabled)
  vlan = __builtin__.property(_get_vlan, _set_vlan)


  _pyangbind_elements = OrderedDict([('name', name), ('enabled', enabled), ('vlan', vlan), ])


class yc_virtual_list_interfaces__interface_container_virtual_list(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module interfaces - based on the path /interface-container/virtual-list. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: List of virtual interfaces
  """
  __slots__ = ('_path_helper', '_extmethods', '__name','__enabled','__ip_address',)

  _yang_name = 'virtual-list'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='string', is_config=True)
    self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='boolean', is_config=True)
    self.__ip_address = YANGDynClass(base=six.text_type, default=six.text_type("0.0.0.0"), is_leaf=True, yang_name="ip_address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='string', 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 ['interface-container', 'virtual-list']

  def _get_name(self):
    """
    Getter method for name, mapped from YANG variable /interface_container/virtual_list/name (string)

    YANG Description: Name of the interface
    """
    return self.__name
      
  def _set_name(self, v, load=False):
    """
    Setter method for name, mapped from YANG variable /interface_container/virtual_list/name (string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_name is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_name() directly.

    YANG Description: Name of the interface
    """
    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=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='string', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """name must be of a type compatible with string""",
          'defined-type': "string",
          'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='string', is_config=True)""",
        })

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

  def _unset_name(self):
    self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='string', is_config=True)


  def _get_enabled(self):
    """
    Getter method for enabled, mapped from YANG variable /interface_container/virtual_list/enabled (boolean)

    YANG Description: True if interface is enabled, false otherwise
    """
    return self.__enabled
      
  def _set_enabled(self, v, load=False):
    """
    Setter method for enabled, mapped from YANG variable /interface_container/virtual_list/enabled (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_enabled is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_enabled() directly.

    YANG Description: True if interface is enabled, false otherwise
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='boolean', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """enabled must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='boolean', is_config=True)""",
        })

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

  def _unset_enabled(self):
    self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='boolean', is_config=True)


  def _get_ip_address(self):
    """
    Getter method for ip_address, mapped from YANG variable /interface_container/virtual_list/ip_address (string)

    YANG Description: IP address assigned to interface
    """
    return self.__ip_address
      
  def _set_ip_address(self, v, load=False):
    """
    Setter method for ip_address, mapped from YANG variable /interface_container/virtual_list/ip_address (string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ip_address is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ip_address() directly.

    YANG Description: IP address assigned to interface
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=six.text_type, default=six.text_type("0.0.0.0"), is_leaf=True, yang_name="ip_address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='string', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """ip_address must be of a type compatible with string""",
          'defined-type': "string",
          'generated-type': """YANGDynClass(base=six.text_type, default=six.text_type("0.0.0.0"), is_leaf=True, yang_name="ip_address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='string', is_config=True)""",
        })

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

  def _unset_ip_address(self):
    self.__ip_address = YANGDynClass(base=six.text_type, default=six.text_type("0.0.0.0"), is_leaf=True, yang_name="ip_address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='string', is_config=True)

  name = __builtin__.property(_get_name, _set_name)
  enabled = __builtin__.property(_get_enabled, _set_enabled)
  ip_address = __builtin__.property(_get_ip_address, _set_ip_address)


  _pyangbind_elements = OrderedDict([('name', name), ('enabled', enabled), ('ip_address', ip_address), ])


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

  _yang_name = 'interface-container'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__switchport_list = YANGDynClass(base=YANGListType("name",yc_switchport_list_interfaces__interface_container_switchport_list, yang_name="switchport-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="switchport-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='list', is_config=True)
    self.__virtual_list = YANGDynClass(base=YANGListType("name",yc_virtual_list_interfaces__interface_container_virtual_list, yang_name="virtual-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="virtual-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', 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 ['interface-container']

  def _get_switchport_list(self):
    """
    Getter method for switchport_list, mapped from YANG variable /interface_container/switchport_list (list)

    YANG Description: List of physical switchports
    """
    return self.__switchport_list
      
  def _set_switchport_list(self, v, load=False):
    """
    Setter method for switchport_list, mapped from YANG variable /interface_container/switchport_list (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_switchport_list is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_switchport_list() directly.

    YANG Description: List of physical switchports
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGListType("name",yc_switchport_list_interfaces__interface_container_switchport_list, yang_name="switchport-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="switchport-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='list', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """switchport_list must be of a type compatible with list""",
          'defined-type': "list",
          'generated-type': """YANGDynClass(base=YANGListType("name",yc_switchport_list_interfaces__interface_container_switchport_list, yang_name="switchport-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="switchport-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='list', is_config=True)""",
        })

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

  def _unset_switchport_list(self):
    self.__switchport_list = YANGDynClass(base=YANGListType("name",yc_switchport_list_interfaces__interface_container_switchport_list, yang_name="switchport-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="switchport-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='list', is_config=True)


  def _get_virtual_list(self):
    """
    Getter method for virtual_list, mapped from YANG variable /interface_container/virtual_list (list)

    YANG Description: List of virtual interfaces
    """
    return self.__virtual_list
      
  def _set_virtual_list(self, v, load=False):
    """
    Setter method for virtual_list, mapped from YANG variable /interface_container/virtual_list (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_virtual_list is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_virtual_list() directly.

    YANG Description: List of virtual interfaces
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGListType("name",yc_virtual_list_interfaces__interface_container_virtual_list, yang_name="virtual-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="virtual-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='list', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """virtual_list must be of a type compatible with list""",
          'defined-type': "list",
          'generated-type': """YANGDynClass(base=YANGListType("name",yc_virtual_list_interfaces__interface_container_virtual_list, yang_name="virtual-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="virtual-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='list', is_config=True)""",
        })

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

  def _unset_virtual_list(self):
    self.__virtual_list = YANGDynClass(base=YANGListType("name",yc_virtual_list_interfaces__interface_container_virtual_list, yang_name="virtual-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="virtual-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='list', is_config=True)

  switchport_list = __builtin__.property(_get_switchport_list, _set_switchport_list)
  virtual_list = __builtin__.property(_get_virtual_list, _set_virtual_list)


  _pyangbind_elements = OrderedDict([('switchport_list', switchport_list), ('virtual_list', virtual_list), ])


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

  _yang_name = 'interfaces'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

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

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

  def _unset_interface_container(self):
    self.__interface_container = YANGDynClass(base=yc_interface_container_interfaces__interface_container, is_container='container', yang_name="interface-container", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://yang.globomantics.com/interfaces', defining_module='interfaces', yang_type='container', is_config=True)

  interface_container = __builtin__.property(_get_interface_container, _set_interface_container)


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


