
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from decimal import Decimal
from bitarray import bitarray
import __builtin__
class access_group(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-interface - based on the path /interface/management/ipv6/access-group. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__mgmt_ipv6_access_list','__mgmt_ip_direction',)

  _yang_name = 'access-group'
  _rest_name = 'access-group'

  _pybind_generated_by = 'container'

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

    path_helper_ = kwargs.pop("path_helper", None)
    if path_helper_ is False:
      self._path_helper = False
    elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper):
      self._path_helper = path_helper_
    elif hasattr(self, "_parent"):
      path_helper_ = getattr(self._parent, "_path_helper", False)
      self._path_helper = path_helper_
    else:
      self._path_helper = False

    extmethods = kwargs.pop("extmethods", None)
    if extmethods is False:
      self._extmethods = False
    elif extmethods is not None and isinstance(extmethods, dict):
      self._extmethods = extmethods
    elif hasattr(self, "_parent"):
      extmethods = getattr(self._parent, "_extmethods", None)
      self._extmethods = extmethods
    else:
      self._extmethods = False
    self.__mgmt_ipv6_access_list = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z0-9]{1}([-a-zA-Z0-9_]{0,62})', 'length': [u'1..63']}), is_leaf=True, yang_name="mgmt-ipv6-access-list", rest_name="mgmt-ipv6-access-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'ACL_NAME;; Access List Name (Max 63)', u'cli-drop-node-name': None, u'cli-full-no': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-ipv6-access-list', defining_module='brocade-ipv6-access-list', yang_type='ipv6-l3-acl-policy-name', is_config=True)
    self.__mgmt_ip_direction = YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'in': {'value': 1}},), is_leaf=True, yang_name="mgmt-ip-direction", rest_name="mgmt-ip-direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-ipv6-access-list', defining_module='brocade-ipv6-access-list', yang_type='enumeration', 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'interface', u'management', u'ipv6', u'access-group']

  def _rest_path(self):
    if hasattr(self, "_parent"):
      if self._rest_name:
        return self._parent._rest_path()+[self._rest_name]
      else:
        return self._parent._rest_path()
    else:
      return [u'interface', u'Management', u'ipv6', u'access-group']

  def _get_mgmt_ipv6_access_list(self):
    """
    Getter method for mgmt_ipv6_access_list, mapped from YANG variable /interface/management/ipv6/access_group/mgmt_ipv6_access_list (ipv6-l3-acl-policy-name)
    """
    return self.__mgmt_ipv6_access_list
      
  def _set_mgmt_ipv6_access_list(self, v, load=False):
    """
    Setter method for mgmt_ipv6_access_list, mapped from YANG variable /interface/management/ipv6/access_group/mgmt_ipv6_access_list (ipv6-l3-acl-policy-name)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_mgmt_ipv6_access_list is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_mgmt_ipv6_access_list() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z0-9]{1}([-a-zA-Z0-9_]{0,62})', 'length': [u'1..63']}), is_leaf=True, yang_name="mgmt-ipv6-access-list", rest_name="mgmt-ipv6-access-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'ACL_NAME;; Access List Name (Max 63)', u'cli-drop-node-name': None, u'cli-full-no': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-ipv6-access-list', defining_module='brocade-ipv6-access-list', yang_type='ipv6-l3-acl-policy-name', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """mgmt_ipv6_access_list must be of a type compatible with ipv6-l3-acl-policy-name""",
          'defined-type': "brocade-ipv6-access-list:ipv6-l3-acl-policy-name",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z0-9]{1}([-a-zA-Z0-9_]{0,62})', 'length': [u'1..63']}), is_leaf=True, yang_name="mgmt-ipv6-access-list", rest_name="mgmt-ipv6-access-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'ACL_NAME;; Access List Name (Max 63)', u'cli-drop-node-name': None, u'cli-full-no': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-ipv6-access-list', defining_module='brocade-ipv6-access-list', yang_type='ipv6-l3-acl-policy-name', is_config=True)""",
        })

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

  def _unset_mgmt_ipv6_access_list(self):
    self.__mgmt_ipv6_access_list = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z0-9]{1}([-a-zA-Z0-9_]{0,62})', 'length': [u'1..63']}), is_leaf=True, yang_name="mgmt-ipv6-access-list", rest_name="mgmt-ipv6-access-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'ACL_NAME;; Access List Name (Max 63)', u'cli-drop-node-name': None, u'cli-full-no': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-ipv6-access-list', defining_module='brocade-ipv6-access-list', yang_type='ipv6-l3-acl-policy-name', is_config=True)


  def _get_mgmt_ip_direction(self):
    """
    Getter method for mgmt_ip_direction, mapped from YANG variable /interface/management/ipv6/access_group/mgmt_ip_direction (enumeration)
    """
    return self.__mgmt_ip_direction
      
  def _set_mgmt_ip_direction(self, v, load=False):
    """
    Setter method for mgmt_ip_direction, mapped from YANG variable /interface/management/ipv6/access_group/mgmt_ip_direction (enumeration)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_mgmt_ip_direction is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_mgmt_ip_direction() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'in': {'value': 1}},), is_leaf=True, yang_name="mgmt-ip-direction", rest_name="mgmt-ip-direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-ipv6-access-list', defining_module='brocade-ipv6-access-list', yang_type='enumeration', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """mgmt_ip_direction must be of a type compatible with enumeration""",
          'defined-type': "brocade-ipv6-access-list:enumeration",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'in': {'value': 1}},), is_leaf=True, yang_name="mgmt-ip-direction", rest_name="mgmt-ip-direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-ipv6-access-list', defining_module='brocade-ipv6-access-list', yang_type='enumeration', is_config=True)""",
        })

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

  def _unset_mgmt_ip_direction(self):
    self.__mgmt_ip_direction = YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'in': {'value': 1}},), is_leaf=True, yang_name="mgmt-ip-direction", rest_name="mgmt-ip-direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-ipv6-access-list', defining_module='brocade-ipv6-access-list', yang_type='enumeration', is_config=True)

  mgmt_ipv6_access_list = __builtin__.property(_get_mgmt_ipv6_access_list, _set_mgmt_ipv6_access_list)
  mgmt_ip_direction = __builtin__.property(_get_mgmt_ip_direction, _set_mgmt_ip_direction)


  _pyangbind_elements = {'mgmt_ipv6_access_list': mgmt_ipv6_access_list, 'mgmt_ip_direction': mgmt_ip_direction, }



{'avg_line_length': 67.96835443037975, 'max_line_length': 684, 'alphanum_fraction': 0.7110531706862836, 'licenses': ['Apache-2.0'], 'repository_name': 'extremenetworks/pybind', 'path': 'pybind/nos/v6_0_2f/interface/management/ipv6/access_group/__init__.py', 'size': 10739, 'lang': 'Python'}