# -*- 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 state(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route/unknown-attributes/unknown-attribute/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Operational state for unknown route attributes
  """
  __slots__ = ('_path_helper', '_extmethods', '__optional','__transitive','__partial','__extended','__attr_type','__attr_len','__attr_value',)

  _yang_name = 'state'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__optional = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__transitive = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__partial = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__extended = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__attr_type = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)
    self.__attr_len = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)
    self.__attr_value = YANGDynClass(base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)

    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 ['network-instances', 'network-instance', 'protocols', 'protocol', 'bgp', 'rib', 'afi-safis', 'afi-safi', 'ipv4-unicast', 'loc-rib', 'routes', 'route', 'unknown-attributes', 'unknown-attribute', 'state']

  def _get_optional(self):
    """
    Getter method for optional, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/optional (boolean)

    YANG Description: Defines whether the attribute is optional (if
set to true) or well-known (if set to false).
Set in the high-order bit of the BGP attribute
flags octet.
    """
    return self.__optional
      
  def _set_optional(self, v, load=False):
    """
    Setter method for optional, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/optional (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_optional is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_optional() directly.

    YANG Description: Defines whether the attribute is optional (if
set to true) or well-known (if set to false).
Set in the high-order bit of the BGP attribute
flags octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """optional must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_optional(self):
    self.__optional = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_transitive(self):
    """
    Getter method for transitive, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/transitive (boolean)

    YANG Description: Defines whether an optional attribute is transitive
(if set to true) or non-transitive (if set to false).  For
well-known attributes, the transitive flag MUST be set to
true.  Set in the second high-order bit of the BGP attribute
flags octet.
    """
    return self.__transitive
      
  def _set_transitive(self, v, load=False):
    """
    Setter method for transitive, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/transitive (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_transitive is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_transitive() directly.

    YANG Description: Defines whether an optional attribute is transitive
(if set to true) or non-transitive (if set to false).  For
well-known attributes, the transitive flag MUST be set to
true.  Set in the second high-order bit of the BGP attribute
flags octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """transitive must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_transitive(self):
    self.__transitive = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_partial(self):
    """
    Getter method for partial, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/partial (boolean)

    YANG Description: Defines whether the information contained in the optional
transitive attribute is partial (if set to true) or complete
(if set to false).  For well-known attributes and for
optional non-transitive attributes, the partial flag
must be set to false.  Set in the third high-order bit of
the BGP attribute flags octet.
    """
    return self.__partial
      
  def _set_partial(self, v, load=False):
    """
    Setter method for partial, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/partial (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_partial is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_partial() directly.

    YANG Description: Defines whether the information contained in the optional
transitive attribute is partial (if set to true) or complete
(if set to false).  For well-known attributes and for
optional non-transitive attributes, the partial flag
must be set to false.  Set in the third high-order bit of
the BGP attribute flags octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """partial must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_partial(self):
    self.__partial = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_extended(self):
    """
    Getter method for extended, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/extended (boolean)

    YANG Description: Defines whether the attribute length is one octet
(if set to false) or two octets (if set to true).  Set in
the fourth high-order bit of the BGP attribute flags
octet.
    """
    return self.__extended
      
  def _set_extended(self, v, load=False):
    """
    Setter method for extended, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/extended (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_extended is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_extended() directly.

    YANG Description: Defines whether the attribute length is one octet
(if set to false) or two octets (if set to true).  Set in
the fourth high-order bit of the BGP attribute flags
octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """extended must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_extended(self):
    self.__extended = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_attr_type(self):
    """
    Getter method for attr_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_type (uint8)

    YANG Description: 1-octet value encoding the attribute type code
    """
    return self.__attr_type
      
  def _set_attr_type(self, v, load=False):
    """
    Setter method for attr_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_type (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_attr_type is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_attr_type() directly.

    YANG Description: 1-octet value encoding the attribute type code
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """attr_type must be of a type compatible with uint8""",
          'defined-type': "uint8",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)""",
        })

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

  def _unset_attr_type(self):
    self.__attr_type = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)


  def _get_attr_len(self):
    """
    Getter method for attr_len, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_len (uint16)

    YANG Description: One or two octet attribute length field indicating the
length of the attribute data in octets.  If the Extended
Length attribute flag is set, the length field is 2 octets,
otherwise it is 1 octet
    """
    return self.__attr_len
      
  def _set_attr_len(self, v, load=False):
    """
    Setter method for attr_len, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_len (uint16)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_attr_len is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_attr_len() directly.

    YANG Description: One or two octet attribute length field indicating the
length of the attribute data in octets.  If the Extended
Length attribute flag is set, the length field is 2 octets,
otherwise it is 1 octet
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """attr_len must be of a type compatible with uint16""",
          'defined-type': "uint16",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)""",
        })

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

  def _unset_attr_len(self):
    self.__attr_len = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)


  def _get_attr_value(self):
    """
    Getter method for attr_value, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_value (binary)

    YANG Description: Raw attribute value, not including the attribute
flags, type, or length.  The maximum length
of the attribute value data is 2^16-1 per the max value
of the attr-len field (2 octets).
    """
    return self.__attr_value
      
  def _set_attr_value(self, v, load=False):
    """
    Setter method for attr_value, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_value (binary)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_attr_value is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_attr_value() directly.

    YANG Description: Raw attribute value, not including the attribute
flags, type, or length.  The maximum length
of the attribute value data is 2^16-1 per the max value
of the attr-len field (2 octets).
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """attr_value must be of a type compatible with binary""",
          'defined-type': "binary",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)""",
        })

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

  def _unset_attr_value(self):
    self.__attr_value = YANGDynClass(base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)

  optional = __builtin__.property(_get_optional)
  transitive = __builtin__.property(_get_transitive)
  partial = __builtin__.property(_get_partial)
  extended = __builtin__.property(_get_extended)
  attr_type = __builtin__.property(_get_attr_type)
  attr_len = __builtin__.property(_get_attr_len)
  attr_value = __builtin__.property(_get_attr_value)


  _pyangbind_elements = OrderedDict([('optional', optional), ('transitive', transitive), ('partial', partial), ('extended', extended), ('attr_type', attr_type), ('attr_len', attr_len), ('attr_value', attr_value), ])


class state(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route/unknown-attributes/unknown-attribute/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Operational state for unknown route attributes
  """
  __slots__ = ('_path_helper', '_extmethods', '__optional','__transitive','__partial','__extended','__attr_type','__attr_len','__attr_value',)

  _yang_name = 'state'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__optional = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__transitive = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__partial = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__extended = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__attr_type = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)
    self.__attr_len = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)
    self.__attr_value = YANGDynClass(base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)

    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 ['network-instances', 'network-instance', 'protocols', 'protocol', 'bgp', 'rib', 'afi-safis', 'afi-safi', 'ipv4-unicast', 'loc-rib', 'routes', 'route', 'unknown-attributes', 'unknown-attribute', 'state']

  def _get_optional(self):
    """
    Getter method for optional, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/optional (boolean)

    YANG Description: Defines whether the attribute is optional (if
set to true) or well-known (if set to false).
Set in the high-order bit of the BGP attribute
flags octet.
    """
    return self.__optional
      
  def _set_optional(self, v, load=False):
    """
    Setter method for optional, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/optional (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_optional is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_optional() directly.

    YANG Description: Defines whether the attribute is optional (if
set to true) or well-known (if set to false).
Set in the high-order bit of the BGP attribute
flags octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """optional must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_optional(self):
    self.__optional = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_transitive(self):
    """
    Getter method for transitive, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/transitive (boolean)

    YANG Description: Defines whether an optional attribute is transitive
(if set to true) or non-transitive (if set to false).  For
well-known attributes, the transitive flag MUST be set to
true.  Set in the second high-order bit of the BGP attribute
flags octet.
    """
    return self.__transitive
      
  def _set_transitive(self, v, load=False):
    """
    Setter method for transitive, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/transitive (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_transitive is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_transitive() directly.

    YANG Description: Defines whether an optional attribute is transitive
(if set to true) or non-transitive (if set to false).  For
well-known attributes, the transitive flag MUST be set to
true.  Set in the second high-order bit of the BGP attribute
flags octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """transitive must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_transitive(self):
    self.__transitive = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_partial(self):
    """
    Getter method for partial, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/partial (boolean)

    YANG Description: Defines whether the information contained in the optional
transitive attribute is partial (if set to true) or complete
(if set to false).  For well-known attributes and for
optional non-transitive attributes, the partial flag
must be set to false.  Set in the third high-order bit of
the BGP attribute flags octet.
    """
    return self.__partial
      
  def _set_partial(self, v, load=False):
    """
    Setter method for partial, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/partial (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_partial is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_partial() directly.

    YANG Description: Defines whether the information contained in the optional
transitive attribute is partial (if set to true) or complete
(if set to false).  For well-known attributes and for
optional non-transitive attributes, the partial flag
must be set to false.  Set in the third high-order bit of
the BGP attribute flags octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """partial must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_partial(self):
    self.__partial = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_extended(self):
    """
    Getter method for extended, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/extended (boolean)

    YANG Description: Defines whether the attribute length is one octet
(if set to false) or two octets (if set to true).  Set in
the fourth high-order bit of the BGP attribute flags
octet.
    """
    return self.__extended
      
  def _set_extended(self, v, load=False):
    """
    Setter method for extended, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/extended (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_extended is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_extended() directly.

    YANG Description: Defines whether the attribute length is one octet
(if set to false) or two octets (if set to true).  Set in
the fourth high-order bit of the BGP attribute flags
octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """extended must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_extended(self):
    self.__extended = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_attr_type(self):
    """
    Getter method for attr_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_type (uint8)

    YANG Description: 1-octet value encoding the attribute type code
    """
    return self.__attr_type
      
  def _set_attr_type(self, v, load=False):
    """
    Setter method for attr_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_type (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_attr_type is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_attr_type() directly.

    YANG Description: 1-octet value encoding the attribute type code
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """attr_type must be of a type compatible with uint8""",
          'defined-type': "uint8",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)""",
        })

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

  def _unset_attr_type(self):
    self.__attr_type = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)


  def _get_attr_len(self):
    """
    Getter method for attr_len, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_len (uint16)

    YANG Description: One or two octet attribute length field indicating the
length of the attribute data in octets.  If the Extended
Length attribute flag is set, the length field is 2 octets,
otherwise it is 1 octet
    """
    return self.__attr_len
      
  def _set_attr_len(self, v, load=False):
    """
    Setter method for attr_len, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_len (uint16)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_attr_len is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_attr_len() directly.

    YANG Description: One or two octet attribute length field indicating the
length of the attribute data in octets.  If the Extended
Length attribute flag is set, the length field is 2 octets,
otherwise it is 1 octet
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """attr_len must be of a type compatible with uint16""",
          'defined-type': "uint16",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)""",
        })

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

  def _unset_attr_len(self):
    self.__attr_len = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)


  def _get_attr_value(self):
    """
    Getter method for attr_value, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_value (binary)

    YANG Description: Raw attribute value, not including the attribute
flags, type, or length.  The maximum length
of the attribute value data is 2^16-1 per the max value
of the attr-len field (2 octets).
    """
    return self.__attr_value
      
  def _set_attr_value(self, v, load=False):
    """
    Setter method for attr_value, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_value (binary)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_attr_value is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_attr_value() directly.

    YANG Description: Raw attribute value, not including the attribute
flags, type, or length.  The maximum length
of the attribute value data is 2^16-1 per the max value
of the attr-len field (2 octets).
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """attr_value must be of a type compatible with binary""",
          'defined-type': "binary",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)""",
        })

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

  def _unset_attr_value(self):
    self.__attr_value = YANGDynClass(base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)

  optional = __builtin__.property(_get_optional)
  transitive = __builtin__.property(_get_transitive)
  partial = __builtin__.property(_get_partial)
  extended = __builtin__.property(_get_extended)
  attr_type = __builtin__.property(_get_attr_type)
  attr_len = __builtin__.property(_get_attr_len)
  attr_value = __builtin__.property(_get_attr_value)


  _pyangbind_elements = OrderedDict([('optional', optional), ('transitive', transitive), ('partial', partial), ('extended', extended), ('attr_type', attr_type), ('attr_len', attr_len), ('attr_value', attr_value), ])


class state(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route/unknown-attributes/unknown-attribute/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Operational state for unknown route attributes
  """
  __slots__ = ('_path_helper', '_extmethods', '__optional','__transitive','__partial','__extended','__attr_type','__attr_len','__attr_value',)

  _yang_name = 'state'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__optional = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__transitive = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__partial = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__extended = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__attr_type = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)
    self.__attr_len = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)
    self.__attr_value = YANGDynClass(base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)

    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 ['network-instances', 'network-instance', 'protocols', 'protocol', 'bgp', 'rib', 'afi-safis', 'afi-safi', 'ipv4-unicast', 'loc-rib', 'routes', 'route', 'unknown-attributes', 'unknown-attribute', 'state']

  def _get_optional(self):
    """
    Getter method for optional, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/optional (boolean)

    YANG Description: Defines whether the attribute is optional (if
set to true) or well-known (if set to false).
Set in the high-order bit of the BGP attribute
flags octet.
    """
    return self.__optional
      
  def _set_optional(self, v, load=False):
    """
    Setter method for optional, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/optional (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_optional is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_optional() directly.

    YANG Description: Defines whether the attribute is optional (if
set to true) or well-known (if set to false).
Set in the high-order bit of the BGP attribute
flags octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """optional must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_optional(self):
    self.__optional = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_transitive(self):
    """
    Getter method for transitive, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/transitive (boolean)

    YANG Description: Defines whether an optional attribute is transitive
(if set to true) or non-transitive (if set to false).  For
well-known attributes, the transitive flag MUST be set to
true.  Set in the second high-order bit of the BGP attribute
flags octet.
    """
    return self.__transitive
      
  def _set_transitive(self, v, load=False):
    """
    Setter method for transitive, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/transitive (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_transitive is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_transitive() directly.

    YANG Description: Defines whether an optional attribute is transitive
(if set to true) or non-transitive (if set to false).  For
well-known attributes, the transitive flag MUST be set to
true.  Set in the second high-order bit of the BGP attribute
flags octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """transitive must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_transitive(self):
    self.__transitive = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_partial(self):
    """
    Getter method for partial, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/partial (boolean)

    YANG Description: Defines whether the information contained in the optional
transitive attribute is partial (if set to true) or complete
(if set to false).  For well-known attributes and for
optional non-transitive attributes, the partial flag
must be set to false.  Set in the third high-order bit of
the BGP attribute flags octet.
    """
    return self.__partial
      
  def _set_partial(self, v, load=False):
    """
    Setter method for partial, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/partial (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_partial is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_partial() directly.

    YANG Description: Defines whether the information contained in the optional
transitive attribute is partial (if set to true) or complete
(if set to false).  For well-known attributes and for
optional non-transitive attributes, the partial flag
must be set to false.  Set in the third high-order bit of
the BGP attribute flags octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """partial must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_partial(self):
    self.__partial = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_extended(self):
    """
    Getter method for extended, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/extended (boolean)

    YANG Description: Defines whether the attribute length is one octet
(if set to false) or two octets (if set to true).  Set in
the fourth high-order bit of the BGP attribute flags
octet.
    """
    return self.__extended
      
  def _set_extended(self, v, load=False):
    """
    Setter method for extended, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/extended (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_extended is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_extended() directly.

    YANG Description: Defines whether the attribute length is one octet
(if set to false) or two octets (if set to true).  Set in
the fourth high-order bit of the BGP attribute flags
octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """extended must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_extended(self):
    self.__extended = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_attr_type(self):
    """
    Getter method for attr_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_type (uint8)

    YANG Description: 1-octet value encoding the attribute type code
    """
    return self.__attr_type
      
  def _set_attr_type(self, v, load=False):
    """
    Setter method for attr_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_type (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_attr_type is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_attr_type() directly.

    YANG Description: 1-octet value encoding the attribute type code
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """attr_type must be of a type compatible with uint8""",
          'defined-type': "uint8",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)""",
        })

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

  def _unset_attr_type(self):
    self.__attr_type = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)


  def _get_attr_len(self):
    """
    Getter method for attr_len, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_len (uint16)

    YANG Description: One or two octet attribute length field indicating the
length of the attribute data in octets.  If the Extended
Length attribute flag is set, the length field is 2 octets,
otherwise it is 1 octet
    """
    return self.__attr_len
      
  def _set_attr_len(self, v, load=False):
    """
    Setter method for attr_len, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_len (uint16)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_attr_len is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_attr_len() directly.

    YANG Description: One or two octet attribute length field indicating the
length of the attribute data in octets.  If the Extended
Length attribute flag is set, the length field is 2 octets,
otherwise it is 1 octet
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """attr_len must be of a type compatible with uint16""",
          'defined-type': "uint16",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)""",
        })

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

  def _unset_attr_len(self):
    self.__attr_len = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)


  def _get_attr_value(self):
    """
    Getter method for attr_value, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_value (binary)

    YANG Description: Raw attribute value, not including the attribute
flags, type, or length.  The maximum length
of the attribute value data is 2^16-1 per the max value
of the attr-len field (2 octets).
    """
    return self.__attr_value
      
  def _set_attr_value(self, v, load=False):
    """
    Setter method for attr_value, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_value (binary)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_attr_value is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_attr_value() directly.

    YANG Description: Raw attribute value, not including the attribute
flags, type, or length.  The maximum length
of the attribute value data is 2^16-1 per the max value
of the attr-len field (2 octets).
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """attr_value must be of a type compatible with binary""",
          'defined-type': "binary",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)""",
        })

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

  def _unset_attr_value(self):
    self.__attr_value = YANGDynClass(base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)

  optional = __builtin__.property(_get_optional)
  transitive = __builtin__.property(_get_transitive)
  partial = __builtin__.property(_get_partial)
  extended = __builtin__.property(_get_extended)
  attr_type = __builtin__.property(_get_attr_type)
  attr_len = __builtin__.property(_get_attr_len)
  attr_value = __builtin__.property(_get_attr_value)


  _pyangbind_elements = OrderedDict([('optional', optional), ('transitive', transitive), ('partial', partial), ('extended', extended), ('attr_type', attr_type), ('attr_len', attr_len), ('attr_value', attr_value), ])


class state(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route/unknown-attributes/unknown-attribute/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Operational state for unknown route attributes
  """
  __slots__ = ('_path_helper', '_extmethods', '__optional','__transitive','__partial','__extended','__attr_type','__attr_len','__attr_value',)

  _yang_name = 'state'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__optional = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__transitive = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__partial = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__extended = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    self.__attr_type = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)
    self.__attr_len = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)
    self.__attr_value = YANGDynClass(base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)

    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 ['network-instances', 'network-instance', 'protocols', 'protocol', 'bgp', 'rib', 'afi-safis', 'afi-safi', 'ipv4-unicast', 'loc-rib', 'routes', 'route', 'unknown-attributes', 'unknown-attribute', 'state']

  def _get_optional(self):
    """
    Getter method for optional, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/optional (boolean)

    YANG Description: Defines whether the attribute is optional (if
set to true) or well-known (if set to false).
Set in the high-order bit of the BGP attribute
flags octet.
    """
    return self.__optional
      
  def _set_optional(self, v, load=False):
    """
    Setter method for optional, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/optional (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_optional is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_optional() directly.

    YANG Description: Defines whether the attribute is optional (if
set to true) or well-known (if set to false).
Set in the high-order bit of the BGP attribute
flags octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """optional must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_optional(self):
    self.__optional = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="optional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_transitive(self):
    """
    Getter method for transitive, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/transitive (boolean)

    YANG Description: Defines whether an optional attribute is transitive
(if set to true) or non-transitive (if set to false).  For
well-known attributes, the transitive flag MUST be set to
true.  Set in the second high-order bit of the BGP attribute
flags octet.
    """
    return self.__transitive
      
  def _set_transitive(self, v, load=False):
    """
    Setter method for transitive, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/transitive (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_transitive is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_transitive() directly.

    YANG Description: Defines whether an optional attribute is transitive
(if set to true) or non-transitive (if set to false).  For
well-known attributes, the transitive flag MUST be set to
true.  Set in the second high-order bit of the BGP attribute
flags octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """transitive must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_transitive(self):
    self.__transitive = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transitive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_partial(self):
    """
    Getter method for partial, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/partial (boolean)

    YANG Description: Defines whether the information contained in the optional
transitive attribute is partial (if set to true) or complete
(if set to false).  For well-known attributes and for
optional non-transitive attributes, the partial flag
must be set to false.  Set in the third high-order bit of
the BGP attribute flags octet.
    """
    return self.__partial
      
  def _set_partial(self, v, load=False):
    """
    Setter method for partial, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/partial (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_partial is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_partial() directly.

    YANG Description: Defines whether the information contained in the optional
transitive attribute is partial (if set to true) or complete
(if set to false).  For well-known attributes and for
optional non-transitive attributes, the partial flag
must be set to false.  Set in the third high-order bit of
the BGP attribute flags octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """partial must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_partial(self):
    self.__partial = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="partial", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_extended(self):
    """
    Getter method for extended, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/extended (boolean)

    YANG Description: Defines whether the attribute length is one octet
(if set to false) or two octets (if set to true).  Set in
the fourth high-order bit of the BGP attribute flags
octet.
    """
    return self.__extended
      
  def _set_extended(self, v, load=False):
    """
    Setter method for extended, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/extended (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_extended is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_extended() directly.

    YANG Description: Defines whether the attribute length is one octet
(if set to false) or two octets (if set to true).  Set in
the fourth high-order bit of the BGP attribute flags
octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """extended must be of a type compatible with boolean""",
          'defined-type': "boolean",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
        })

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

  def _unset_extended(self):
    self.__extended = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="extended", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)


  def _get_attr_type(self):
    """
    Getter method for attr_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_type (uint8)

    YANG Description: 1-octet value encoding the attribute type code
    """
    return self.__attr_type
      
  def _set_attr_type(self, v, load=False):
    """
    Setter method for attr_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_type (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_attr_type is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_attr_type() directly.

    YANG Description: 1-octet value encoding the attribute type code
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """attr_type must be of a type compatible with uint8""",
          'defined-type': "uint8",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)""",
        })

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

  def _unset_attr_type(self):
    self.__attr_type = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="attr-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)


  def _get_attr_len(self):
    """
    Getter method for attr_len, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_len (uint16)

    YANG Description: One or two octet attribute length field indicating the
length of the attribute data in octets.  If the Extended
Length attribute flag is set, the length field is 2 octets,
otherwise it is 1 octet
    """
    return self.__attr_len
      
  def _set_attr_len(self, v, load=False):
    """
    Setter method for attr_len, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_len (uint16)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_attr_len is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_attr_len() directly.

    YANG Description: One or two octet attribute length field indicating the
length of the attribute data in octets.  If the Extended
Length attribute flag is set, the length field is 2 octets,
otherwise it is 1 octet
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """attr_len must be of a type compatible with uint16""",
          'defined-type': "uint16",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)""",
        })

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

  def _unset_attr_len(self):
    self.__attr_len = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="attr-len", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)


  def _get_attr_value(self):
    """
    Getter method for attr_value, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_value (binary)

    YANG Description: Raw attribute value, not including the attribute
flags, type, or length.  The maximum length
of the attribute value data is 2^16-1 per the max value
of the attr-len field (2 octets).
    """
    return self.__attr_value
      
  def _set_attr_value(self, v, load=False):
    """
    Setter method for attr_value, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/rib/afi_safis/afi_safi/ipv4_unicast/loc_rib/routes/route/unknown_attributes/unknown_attribute/state/attr_value (binary)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_attr_value is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_attr_value() directly.

    YANG Description: Raw attribute value, not including the attribute
flags, type, or length.  The maximum length
of the attribute value data is 2^16-1 per the max value
of the attr-len field (2 octets).
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """attr_value must be of a type compatible with binary""",
          'defined-type': "binary",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)""",
        })

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

  def _unset_attr_value(self):
    self.__attr_value = YANGDynClass(base=RestrictedClassType(base_type=bitarray, restriction_dict={'length': ['1..65535']}), is_leaf=True, yang_name="attr-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='binary', is_config=False)

  optional = __builtin__.property(_get_optional)
  transitive = __builtin__.property(_get_transitive)
  partial = __builtin__.property(_get_partial)
  extended = __builtin__.property(_get_extended)
  attr_type = __builtin__.property(_get_attr_type)
  attr_len = __builtin__.property(_get_attr_len)
  attr_value = __builtin__.property(_get_attr_value)


  _pyangbind_elements = OrderedDict([('optional', optional), ('transitive', transitive), ('partial', partial), ('extended', extended), ('attr_type', attr_type), ('attr_len', attr_len), ('attr_value', attr_value), ])


