# -*- 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__

from . import state
from . import aggregator
from . import as_path
from . import as4_path
from . import tunnel_encapsulation
class attr_set(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-bgp - based on the path /bgp/rib/attr-sets/attr-set. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: List of path attributes that may be in use by multiple
routes in the table
  """
  __slots__ = ('_path_helper', '_extmethods', '__index','__state','__aggregator','__as_path','__as4_path','__tunnel_encapsulation',)

  _yang_name = 'attr-set'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', 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 ['bgp', 'rib', 'attr-sets', 'attr-set']

  def _get_index(self):
    """
    Getter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)

    YANG Description: Reference to list key
    """
    return self.__index
      
  def _set_index(self, v, load=False):
    """
    Setter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_index is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_index() directly.

    YANG Description: Reference to list key
    """
    parent = getattr(self, "_parent", None)
    if parent is not None and load is False:
      raise AttributeError("Cannot set keys directly when" +
                             " within an instantiated list")

    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """index must be of a type compatible with leafref""",
          'defined-type': "leafref",
          'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)""",
        })

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

  def _unset_index(self):
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)


  def _get_state(self):
    """
    Getter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)

    YANG Description: Operational state for common path attributes
    """
    return self.__state
      
  def _set_state(self, v, load=False):
    """
    Setter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: Operational state for common path attributes
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """state must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_state(self):
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_aggregator(self):
    """
    Getter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    return self.__aggregator
      
  def _set_aggregator(self, v, load=False):
    """
    Setter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_aggregator is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_aggregator() directly.

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """aggregator must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_aggregator(self):
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as_path(self):
    """
    Getter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    return self.__as_path
      
  def _set_as_path(self, v, load=False):
    """
    Setter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as_path() directly.

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as_path(self):
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as4_path(self):
    """
    Getter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    return self.__as4_path
      
  def _set_as4_path(self, v, load=False):
    """
    Setter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as4_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as4_path() directly.

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as4_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as4_path(self):
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_tunnel_encapsulation(self):
    """
    Getter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    return self.__tunnel_encapsulation
      
  def _set_tunnel_encapsulation(self, v, load=False):
    """
    Setter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tunnel_encapsulation is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tunnel_encapsulation() directly.

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """tunnel_encapsulation must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_tunnel_encapsulation(self):
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)

  index = __builtin__.property(_get_index)
  state = __builtin__.property(_get_state)
  aggregator = __builtin__.property(_get_aggregator)
  as_path = __builtin__.property(_get_as_path)
  as4_path = __builtin__.property(_get_as4_path)
  tunnel_encapsulation = __builtin__.property(_get_tunnel_encapsulation)


  _pyangbind_elements = OrderedDict([('index', index), ('state', state), ('aggregator', aggregator), ('as_path', as_path), ('as4_path', as4_path), ('tunnel_encapsulation', tunnel_encapsulation), ])


from . import state
from . import aggregator
from . import as_path
from . import as4_path
from . import tunnel_encapsulation
class attr_set(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-bgp-common - based on the path /bgp/rib/attr-sets/attr-set. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: List of path attributes that may be in use by multiple
routes in the table
  """
  __slots__ = ('_path_helper', '_extmethods', '__index','__state','__aggregator','__as_path','__as4_path','__tunnel_encapsulation',)

  _yang_name = 'attr-set'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', 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 ['bgp', 'rib', 'attr-sets', 'attr-set']

  def _get_index(self):
    """
    Getter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)

    YANG Description: Reference to list key
    """
    return self.__index
      
  def _set_index(self, v, load=False):
    """
    Setter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_index is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_index() directly.

    YANG Description: Reference to list key
    """
    parent = getattr(self, "_parent", None)
    if parent is not None and load is False:
      raise AttributeError("Cannot set keys directly when" +
                             " within an instantiated list")

    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """index must be of a type compatible with leafref""",
          'defined-type': "leafref",
          'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)""",
        })

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

  def _unset_index(self):
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)


  def _get_state(self):
    """
    Getter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)

    YANG Description: Operational state for common path attributes
    """
    return self.__state
      
  def _set_state(self, v, load=False):
    """
    Setter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: Operational state for common path attributes
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """state must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_state(self):
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_aggregator(self):
    """
    Getter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    return self.__aggregator
      
  def _set_aggregator(self, v, load=False):
    """
    Setter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_aggregator is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_aggregator() directly.

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """aggregator must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_aggregator(self):
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as_path(self):
    """
    Getter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    return self.__as_path
      
  def _set_as_path(self, v, load=False):
    """
    Setter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as_path() directly.

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as_path(self):
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as4_path(self):
    """
    Getter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    return self.__as4_path
      
  def _set_as4_path(self, v, load=False):
    """
    Setter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as4_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as4_path() directly.

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as4_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as4_path(self):
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_tunnel_encapsulation(self):
    """
    Getter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    return self.__tunnel_encapsulation
      
  def _set_tunnel_encapsulation(self, v, load=False):
    """
    Setter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tunnel_encapsulation is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tunnel_encapsulation() directly.

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """tunnel_encapsulation must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_tunnel_encapsulation(self):
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)

  index = __builtin__.property(_get_index)
  state = __builtin__.property(_get_state)
  aggregator = __builtin__.property(_get_aggregator)
  as_path = __builtin__.property(_get_as_path)
  as4_path = __builtin__.property(_get_as4_path)
  tunnel_encapsulation = __builtin__.property(_get_tunnel_encapsulation)


  _pyangbind_elements = OrderedDict([('index', index), ('state', state), ('aggregator', aggregator), ('as_path', as_path), ('as4_path', as4_path), ('tunnel_encapsulation', tunnel_encapsulation), ])


from . import state
from . import aggregator
from . import as_path
from . import as4_path
from . import tunnel_encapsulation
class attr_set(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-bgp-common-multiprotocol - based on the path /bgp/rib/attr-sets/attr-set. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: List of path attributes that may be in use by multiple
routes in the table
  """
  __slots__ = ('_path_helper', '_extmethods', '__index','__state','__aggregator','__as_path','__as4_path','__tunnel_encapsulation',)

  _yang_name = 'attr-set'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', 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 ['bgp', 'rib', 'attr-sets', 'attr-set']

  def _get_index(self):
    """
    Getter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)

    YANG Description: Reference to list key
    """
    return self.__index
      
  def _set_index(self, v, load=False):
    """
    Setter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_index is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_index() directly.

    YANG Description: Reference to list key
    """
    parent = getattr(self, "_parent", None)
    if parent is not None and load is False:
      raise AttributeError("Cannot set keys directly when" +
                             " within an instantiated list")

    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """index must be of a type compatible with leafref""",
          'defined-type': "leafref",
          'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)""",
        })

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

  def _unset_index(self):
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)


  def _get_state(self):
    """
    Getter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)

    YANG Description: Operational state for common path attributes
    """
    return self.__state
      
  def _set_state(self, v, load=False):
    """
    Setter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: Operational state for common path attributes
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """state must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_state(self):
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_aggregator(self):
    """
    Getter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    return self.__aggregator
      
  def _set_aggregator(self, v, load=False):
    """
    Setter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_aggregator is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_aggregator() directly.

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """aggregator must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_aggregator(self):
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as_path(self):
    """
    Getter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    return self.__as_path
      
  def _set_as_path(self, v, load=False):
    """
    Setter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as_path() directly.

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as_path(self):
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as4_path(self):
    """
    Getter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    return self.__as4_path
      
  def _set_as4_path(self, v, load=False):
    """
    Setter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as4_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as4_path() directly.

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as4_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as4_path(self):
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_tunnel_encapsulation(self):
    """
    Getter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    return self.__tunnel_encapsulation
      
  def _set_tunnel_encapsulation(self, v, load=False):
    """
    Setter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tunnel_encapsulation is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tunnel_encapsulation() directly.

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """tunnel_encapsulation must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_tunnel_encapsulation(self):
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)

  index = __builtin__.property(_get_index)
  state = __builtin__.property(_get_state)
  aggregator = __builtin__.property(_get_aggregator)
  as_path = __builtin__.property(_get_as_path)
  as4_path = __builtin__.property(_get_as4_path)
  tunnel_encapsulation = __builtin__.property(_get_tunnel_encapsulation)


  _pyangbind_elements = OrderedDict([('index', index), ('state', state), ('aggregator', aggregator), ('as_path', as_path), ('as4_path', as4_path), ('tunnel_encapsulation', tunnel_encapsulation), ])


from . import state
from . import aggregator
from . import as_path
from . import as4_path
from . import tunnel_encapsulation
class attr_set(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-bgp-common-structure - based on the path /bgp/rib/attr-sets/attr-set. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: List of path attributes that may be in use by multiple
routes in the table
  """
  __slots__ = ('_path_helper', '_extmethods', '__index','__state','__aggregator','__as_path','__as4_path','__tunnel_encapsulation',)

  _yang_name = 'attr-set'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', 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 ['bgp', 'rib', 'attr-sets', 'attr-set']

  def _get_index(self):
    """
    Getter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)

    YANG Description: Reference to list key
    """
    return self.__index
      
  def _set_index(self, v, load=False):
    """
    Setter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_index is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_index() directly.

    YANG Description: Reference to list key
    """
    parent = getattr(self, "_parent", None)
    if parent is not None and load is False:
      raise AttributeError("Cannot set keys directly when" +
                             " within an instantiated list")

    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """index must be of a type compatible with leafref""",
          'defined-type': "leafref",
          'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)""",
        })

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

  def _unset_index(self):
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)


  def _get_state(self):
    """
    Getter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)

    YANG Description: Operational state for common path attributes
    """
    return self.__state
      
  def _set_state(self, v, load=False):
    """
    Setter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: Operational state for common path attributes
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """state must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_state(self):
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_aggregator(self):
    """
    Getter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    return self.__aggregator
      
  def _set_aggregator(self, v, load=False):
    """
    Setter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_aggregator is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_aggregator() directly.

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """aggregator must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_aggregator(self):
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as_path(self):
    """
    Getter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    return self.__as_path
      
  def _set_as_path(self, v, load=False):
    """
    Setter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as_path() directly.

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as_path(self):
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as4_path(self):
    """
    Getter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    return self.__as4_path
      
  def _set_as4_path(self, v, load=False):
    """
    Setter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as4_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as4_path() directly.

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as4_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as4_path(self):
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_tunnel_encapsulation(self):
    """
    Getter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    return self.__tunnel_encapsulation
      
  def _set_tunnel_encapsulation(self, v, load=False):
    """
    Setter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tunnel_encapsulation is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tunnel_encapsulation() directly.

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """tunnel_encapsulation must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_tunnel_encapsulation(self):
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)

  index = __builtin__.property(_get_index)
  state = __builtin__.property(_get_state)
  aggregator = __builtin__.property(_get_aggregator)
  as_path = __builtin__.property(_get_as_path)
  as4_path = __builtin__.property(_get_as4_path)
  tunnel_encapsulation = __builtin__.property(_get_tunnel_encapsulation)


  _pyangbind_elements = OrderedDict([('index', index), ('state', state), ('aggregator', aggregator), ('as_path', as_path), ('as4_path', as4_path), ('tunnel_encapsulation', tunnel_encapsulation), ])


from . import state
from . import aggregator
from . import as_path
from . import as4_path
from . import tunnel_encapsulation
class attr_set(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-bgp-peer-group - based on the path /bgp/rib/attr-sets/attr-set. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: List of path attributes that may be in use by multiple
routes in the table
  """
  __slots__ = ('_path_helper', '_extmethods', '__index','__state','__aggregator','__as_path','__as4_path','__tunnel_encapsulation',)

  _yang_name = 'attr-set'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', 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 ['bgp', 'rib', 'attr-sets', 'attr-set']

  def _get_index(self):
    """
    Getter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)

    YANG Description: Reference to list key
    """
    return self.__index
      
  def _set_index(self, v, load=False):
    """
    Setter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_index is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_index() directly.

    YANG Description: Reference to list key
    """
    parent = getattr(self, "_parent", None)
    if parent is not None and load is False:
      raise AttributeError("Cannot set keys directly when" +
                             " within an instantiated list")

    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """index must be of a type compatible with leafref""",
          'defined-type': "leafref",
          'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)""",
        })

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

  def _unset_index(self):
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)


  def _get_state(self):
    """
    Getter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)

    YANG Description: Operational state for common path attributes
    """
    return self.__state
      
  def _set_state(self, v, load=False):
    """
    Setter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: Operational state for common path attributes
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """state must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_state(self):
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_aggregator(self):
    """
    Getter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    return self.__aggregator
      
  def _set_aggregator(self, v, load=False):
    """
    Setter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_aggregator is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_aggregator() directly.

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """aggregator must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_aggregator(self):
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as_path(self):
    """
    Getter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    return self.__as_path
      
  def _set_as_path(self, v, load=False):
    """
    Setter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as_path() directly.

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as_path(self):
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as4_path(self):
    """
    Getter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    return self.__as4_path
      
  def _set_as4_path(self, v, load=False):
    """
    Setter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as4_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as4_path() directly.

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as4_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as4_path(self):
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_tunnel_encapsulation(self):
    """
    Getter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    return self.__tunnel_encapsulation
      
  def _set_tunnel_encapsulation(self, v, load=False):
    """
    Setter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tunnel_encapsulation is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tunnel_encapsulation() directly.

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """tunnel_encapsulation must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_tunnel_encapsulation(self):
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)

  index = __builtin__.property(_get_index)
  state = __builtin__.property(_get_state)
  aggregator = __builtin__.property(_get_aggregator)
  as_path = __builtin__.property(_get_as_path)
  as4_path = __builtin__.property(_get_as4_path)
  tunnel_encapsulation = __builtin__.property(_get_tunnel_encapsulation)


  _pyangbind_elements = OrderedDict([('index', index), ('state', state), ('aggregator', aggregator), ('as_path', as_path), ('as4_path', as4_path), ('tunnel_encapsulation', tunnel_encapsulation), ])


from . import state
from . import aggregator
from . import as_path
from . import as4_path
from . import tunnel_encapsulation
class attr_set(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-bgp-neighbor - based on the path /bgp/rib/attr-sets/attr-set. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: List of path attributes that may be in use by multiple
routes in the table
  """
  __slots__ = ('_path_helper', '_extmethods', '__index','__state','__aggregator','__as_path','__as4_path','__tunnel_encapsulation',)

  _yang_name = 'attr-set'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', 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 ['bgp', 'rib', 'attr-sets', 'attr-set']

  def _get_index(self):
    """
    Getter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)

    YANG Description: Reference to list key
    """
    return self.__index
      
  def _set_index(self, v, load=False):
    """
    Setter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_index is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_index() directly.

    YANG Description: Reference to list key
    """
    parent = getattr(self, "_parent", None)
    if parent is not None and load is False:
      raise AttributeError("Cannot set keys directly when" +
                             " within an instantiated list")

    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """index must be of a type compatible with leafref""",
          'defined-type': "leafref",
          'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)""",
        })

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

  def _unset_index(self):
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)


  def _get_state(self):
    """
    Getter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)

    YANG Description: Operational state for common path attributes
    """
    return self.__state
      
  def _set_state(self, v, load=False):
    """
    Setter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: Operational state for common path attributes
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """state must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_state(self):
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_aggregator(self):
    """
    Getter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    return self.__aggregator
      
  def _set_aggregator(self, v, load=False):
    """
    Setter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_aggregator is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_aggregator() directly.

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """aggregator must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_aggregator(self):
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as_path(self):
    """
    Getter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    return self.__as_path
      
  def _set_as_path(self, v, load=False):
    """
    Setter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as_path() directly.

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as_path(self):
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as4_path(self):
    """
    Getter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    return self.__as4_path
      
  def _set_as4_path(self, v, load=False):
    """
    Setter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as4_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as4_path() directly.

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as4_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as4_path(self):
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_tunnel_encapsulation(self):
    """
    Getter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    return self.__tunnel_encapsulation
      
  def _set_tunnel_encapsulation(self, v, load=False):
    """
    Setter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tunnel_encapsulation is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tunnel_encapsulation() directly.

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """tunnel_encapsulation must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_tunnel_encapsulation(self):
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)

  index = __builtin__.property(_get_index)
  state = __builtin__.property(_get_state)
  aggregator = __builtin__.property(_get_aggregator)
  as_path = __builtin__.property(_get_as_path)
  as4_path = __builtin__.property(_get_as4_path)
  tunnel_encapsulation = __builtin__.property(_get_tunnel_encapsulation)


  _pyangbind_elements = OrderedDict([('index', index), ('state', state), ('aggregator', aggregator), ('as_path', as_path), ('as4_path', as4_path), ('tunnel_encapsulation', tunnel_encapsulation), ])


from . import state
from . import aggregator
from . import as_path
from . import as4_path
from . import tunnel_encapsulation
class attr_set(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-bgp-global - based on the path /bgp/rib/attr-sets/attr-set. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: List of path attributes that may be in use by multiple
routes in the table
  """
  __slots__ = ('_path_helper', '_extmethods', '__index','__state','__aggregator','__as_path','__as4_path','__tunnel_encapsulation',)

  _yang_name = 'attr-set'

  _pybind_generated_by = 'container'

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

    self._path_helper = False

    self._extmethods = False
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', 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 ['bgp', 'rib', 'attr-sets', 'attr-set']

  def _get_index(self):
    """
    Getter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)

    YANG Description: Reference to list key
    """
    return self.__index
      
  def _set_index(self, v, load=False):
    """
    Setter method for index, mapped from YANG variable /bgp/rib/attr_sets/attr_set/index (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_index is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_index() directly.

    YANG Description: Reference to list key
    """
    parent = getattr(self, "_parent", None)
    if parent is not None and load is False:
      raise AttributeError("Cannot set keys directly when" +
                             " within an instantiated list")

    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """index must be of a type compatible with leafref""",
          'defined-type': "leafref",
          'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)""",
        })

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

  def _unset_index(self):
    self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='leafref', is_config=False)


  def _get_state(self):
    """
    Getter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)

    YANG Description: Operational state for common path attributes
    """
    return self.__state
      
  def _set_state(self, v, load=False):
    """
    Setter method for state, mapped from YANG variable /bgp/rib/attr_sets/attr_set/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: Operational state for common path attributes
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """state must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_state(self):
    self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_aggregator(self):
    """
    Getter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    return self.__aggregator
      
  def _set_aggregator(self, v, load=False):
    """
    Setter method for aggregator, mapped from YANG variable /bgp/rib/attr_sets/attr_set/aggregator (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_aggregator is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_aggregator() directly.

    YANG Description: BGP attribute indicating the prefix has been aggregated by
the specified AS and router.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """aggregator must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_aggregator(self):
    self.__aggregator = YANGDynClass(base=aggregator.aggregator, is_container='container', yang_name="aggregator", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as_path(self):
    """
    Getter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    return self.__as_path
      
  def _set_as_path(self, v, load=False):
    """
    Setter method for as_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as_path() directly.

    YANG Description: Enclosing container for the list of AS path segments.

In the Adj-RIB-In or Adj-RIB-Out, this list should show
the received or sent AS_PATH, respectively.  For
example, if the local router is not 4-byte capable, this
value should consist of 2-octet ASNs or the AS_TRANS
(AS 23456) values received or sent in route updates.

In the Loc-RIB, this list should reflect the effective
AS path for the route, e.g., a 4-octet value if the
local router is 4-octet capable.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as_path(self):
    self.__as_path = YANGDynClass(base=as_path.as_path, is_container='container', yang_name="as-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_as4_path(self):
    """
    Getter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    return self.__as4_path
      
  def _set_as4_path(self, v, load=False):
    """
    Setter method for as4_path, mapped from YANG variable /bgp/rib/attr_sets/attr_set/as4_path (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_as4_path is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_as4_path() directly.

    YANG Description: This is the path encoded with 4-octet
AS numbers in the optional transitive AS4_PATH attribute.
This value is populated with the received or sent attribute
in Adj-RIB-In or Adj-RIB-Out, respectively.  It should not
be populated in Loc-RIB since the Loc-RIB is expected to
store the effective AS-Path in the as-path leaf regardless
of being 4-octet or 2-octet.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """as4_path must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_as4_path(self):
    self.__as4_path = YANGDynClass(base=as4_path.as4_path, is_container='container', yang_name="as4-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)


  def _get_tunnel_encapsulation(self):
    """
    Getter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    return self.__tunnel_encapsulation
      
  def _set_tunnel_encapsulation(self, v, load=False):
    """
    Setter method for tunnel_encapsulation, mapped from YANG variable /bgp/rib/attr_sets/attr_set/tunnel_encapsulation (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tunnel_encapsulation is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tunnel_encapsulation() directly.

    YANG Description: The Tunnel Encapsulation attribute specifies a set of
tunnels to a remote destination. The attribute is TLV
based and allows description of a tunnel type, and the
relevant information to create the tunnel to the remote
destination.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """tunnel_encapsulation must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)""",
        })

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

  def _unset_tunnel_encapsulation(self):
    self.__tunnel_encapsulation = YANGDynClass(base=tunnel_encapsulation.tunnel_encapsulation, is_container='container', yang_name="tunnel-encapsulation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='container', is_config=False)

  index = __builtin__.property(_get_index)
  state = __builtin__.property(_get_state)
  aggregator = __builtin__.property(_get_aggregator)
  as_path = __builtin__.property(_get_as_path)
  as4_path = __builtin__.property(_get_as4_path)
  tunnel_encapsulation = __builtin__.property(_get_tunnel_encapsulation)


  _pyangbind_elements = OrderedDict([('index', index), ('state', state), ('aggregator', aggregator), ('as_path', as_path), ('as4_path', as4_path), ('tunnel_encapsulation', tunnel_encapsulation), ])


