# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.yangtypes import YANGDynClass
from pyangbind.lib.yangtypes import ReferenceType
from pyangbind.lib.base import PybindBase
from collections import OrderedDict
from decimal import Decimal
from bitarray import bitarray
import six

# PY3 support of some PY2 keywords (needs improved)
if six.PY3:
    import builtins as __builtin__

    long = int
elif six.PY2:
    import __builtin__


class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa-types/lsa-type/lsas/lsa/opaque-lsa/router-information/tlvs/tlv/informational-capabilities/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: State parameters of the informational capabilitis of the
RI LSA
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__graceful_restart_capable",
        "__graceful_restart_helper",
        "__stub_router",
        "__traffic_engineering",
        "__point_to_point_over_lan",
        "__experimental_te",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__graceful_restart_capable = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="graceful-restart-capable",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__graceful_restart_helper = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="graceful-restart-helper",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__stub_router = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="stub-router",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__traffic_engineering = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="traffic-engineering",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__point_to_point_over_lan = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="point-to-point-over-lan",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__experimental_te = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="experimental-te",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "ospfv2",
                "areas",
                "area",
                "lsdb",
                "lsa-types",
                "lsa-type",
                "lsas",
                "lsa",
                "opaque-lsa",
                "router-information",
                "tlvs",
                "tlv",
                "informational-capabilities",
                "state",
            ]

    def _get_graceful_restart_capable(self):
        """
    Getter method for graceful_restart_capable, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/graceful_restart_capable (boolean)

    YANG Description: When this leaf is set to true, the advertising system is capable of
OSPF graceful restart.
    """
        return self.__graceful_restart_capable

    def _set_graceful_restart_capable(self, v, load=False):
        """
    Setter method for graceful_restart_capable, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/graceful_restart_capable (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_graceful_restart_capable is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_graceful_restart_capable() directly.

    YANG Description: When this leaf is set to true, the advertising system is capable of
OSPF graceful restart.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="graceful-restart-capable",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """graceful_restart_capable must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="graceful-restart-capable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__graceful_restart_capable = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_graceful_restart_capable(self):
        self.__graceful_restart_capable = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="graceful-restart-capable",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_graceful_restart_helper(self):
        """
    Getter method for graceful_restart_helper, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/graceful_restart_helper (boolean)

    YANG Description: When this leaf is set to true, the advertising system is capable of
being a helper for OSPF graceful restart
    """
        return self.__graceful_restart_helper

    def _set_graceful_restart_helper(self, v, load=False):
        """
    Setter method for graceful_restart_helper, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/graceful_restart_helper (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_graceful_restart_helper is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_graceful_restart_helper() directly.

    YANG Description: When this leaf is set to true, the advertising system is capable of
being a helper for OSPF graceful restart
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="graceful-restart-helper",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """graceful_restart_helper must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="graceful-restart-helper", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__graceful_restart_helper = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_graceful_restart_helper(self):
        self.__graceful_restart_helper = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="graceful-restart-helper",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_stub_router(self):
        """
    Getter method for stub_router, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/stub_router (boolean)

    YANG Description: When this leaf is set to true, the advertising system is able to
advertise its status as a stub router
    """
        return self.__stub_router

    def _set_stub_router(self, v, load=False):
        """
    Setter method for stub_router, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/stub_router (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_stub_router is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_stub_router() directly.

    YANG Description: When this leaf is set to true, the advertising system is able to
advertise its status as a stub router
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="stub-router",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """stub_router must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="stub-router", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__stub_router = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_stub_router(self):
        self.__stub_router = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="stub-router",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_traffic_engineering(self):
        """
    Getter method for traffic_engineering, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/traffic_engineering (boolean)

    YANG Description: When this leaf is set to true, the advertising system supports OSPFv2
traffic engineering capabilities
    """
        return self.__traffic_engineering

    def _set_traffic_engineering(self, v, load=False):
        """
    Setter method for traffic_engineering, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/traffic_engineering (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_traffic_engineering is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_traffic_engineering() directly.

    YANG Description: When this leaf is set to true, the advertising system supports OSPFv2
traffic engineering capabilities
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="traffic-engineering",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """traffic_engineering must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="traffic-engineering", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__traffic_engineering = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_traffic_engineering(self):
        self.__traffic_engineering = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="traffic-engineering",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_point_to_point_over_lan(self):
        """
    Getter method for point_to_point_over_lan, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/point_to_point_over_lan (boolean)

    YANG Description: When this leaf is set to true, the advertising system supports treating
LAN adjacencies as though they were point to point
    """
        return self.__point_to_point_over_lan

    def _set_point_to_point_over_lan(self, v, load=False):
        """
    Setter method for point_to_point_over_lan, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/point_to_point_over_lan (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_point_to_point_over_lan is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_point_to_point_over_lan() directly.

    YANG Description: When this leaf is set to true, the advertising system supports treating
LAN adjacencies as though they were point to point
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="point-to-point-over-lan",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """point_to_point_over_lan must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="point-to-point-over-lan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__point_to_point_over_lan = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_point_to_point_over_lan(self):
        self.__point_to_point_over_lan = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="point-to-point-over-lan",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_experimental_te(self):
        """
    Getter method for experimental_te, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/experimental_te (boolean)

    YANG Description: When this leaf is set to ture, the advertising system supports the
experimental extensions to OSPF for TE described in RFC4973
    """
        return self.__experimental_te

    def _set_experimental_te(self, v, load=False):
        """
    Setter method for experimental_te, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/experimental_te (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_experimental_te is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_experimental_te() directly.

    YANG Description: When this leaf is set to ture, the advertising system supports the
experimental extensions to OSPF for TE described in RFC4973
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="experimental-te",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """experimental_te must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="experimental-te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__experimental_te = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_experimental_te(self):
        self.__experimental_te = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="experimental-te",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    graceful_restart_capable = __builtin__.property(_get_graceful_restart_capable)
    graceful_restart_helper = __builtin__.property(_get_graceful_restart_helper)
    stub_router = __builtin__.property(_get_stub_router)
    traffic_engineering = __builtin__.property(_get_traffic_engineering)
    point_to_point_over_lan = __builtin__.property(_get_point_to_point_over_lan)
    experimental_te = __builtin__.property(_get_experimental_te)

    _pyangbind_elements = OrderedDict(
        [
            ("graceful_restart_capable", graceful_restart_capable),
            ("graceful_restart_helper", graceful_restart_helper),
            ("stub_router", stub_router),
            ("traffic_engineering", traffic_engineering),
            ("point_to_point_over_lan", point_to_point_over_lan),
            ("experimental_te", experimental_te),
        ]
    )


class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa-types/lsa-type/lsas/lsa/opaque-lsa/router-information/tlvs/tlv/informational-capabilities/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: State parameters of the informational capabilitis of the
RI LSA
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__graceful_restart_capable",
        "__graceful_restart_helper",
        "__stub_router",
        "__traffic_engineering",
        "__point_to_point_over_lan",
        "__experimental_te",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__graceful_restart_capable = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="graceful-restart-capable",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__graceful_restart_helper = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="graceful-restart-helper",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__stub_router = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="stub-router",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__traffic_engineering = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="traffic-engineering",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__point_to_point_over_lan = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="point-to-point-over-lan",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__experimental_te = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="experimental-te",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "ospfv2",
                "areas",
                "area",
                "lsdb",
                "lsa-types",
                "lsa-type",
                "lsas",
                "lsa",
                "opaque-lsa",
                "router-information",
                "tlvs",
                "tlv",
                "informational-capabilities",
                "state",
            ]

    def _get_graceful_restart_capable(self):
        """
    Getter method for graceful_restart_capable, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/graceful_restart_capable (boolean)

    YANG Description: When this leaf is set to true, the advertising system is capable of
OSPF graceful restart.
    """
        return self.__graceful_restart_capable

    def _set_graceful_restart_capable(self, v, load=False):
        """
    Setter method for graceful_restart_capable, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/graceful_restart_capable (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_graceful_restart_capable is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_graceful_restart_capable() directly.

    YANG Description: When this leaf is set to true, the advertising system is capable of
OSPF graceful restart.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="graceful-restart-capable",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """graceful_restart_capable must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="graceful-restart-capable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__graceful_restart_capable = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_graceful_restart_capable(self):
        self.__graceful_restart_capable = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="graceful-restart-capable",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_graceful_restart_helper(self):
        """
    Getter method for graceful_restart_helper, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/graceful_restart_helper (boolean)

    YANG Description: When this leaf is set to true, the advertising system is capable of
being a helper for OSPF graceful restart
    """
        return self.__graceful_restart_helper

    def _set_graceful_restart_helper(self, v, load=False):
        """
    Setter method for graceful_restart_helper, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/graceful_restart_helper (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_graceful_restart_helper is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_graceful_restart_helper() directly.

    YANG Description: When this leaf is set to true, the advertising system is capable of
being a helper for OSPF graceful restart
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="graceful-restart-helper",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """graceful_restart_helper must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="graceful-restart-helper", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__graceful_restart_helper = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_graceful_restart_helper(self):
        self.__graceful_restart_helper = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="graceful-restart-helper",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_stub_router(self):
        """
    Getter method for stub_router, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/stub_router (boolean)

    YANG Description: When this leaf is set to true, the advertising system is able to
advertise its status as a stub router
    """
        return self.__stub_router

    def _set_stub_router(self, v, load=False):
        """
    Setter method for stub_router, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/stub_router (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_stub_router is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_stub_router() directly.

    YANG Description: When this leaf is set to true, the advertising system is able to
advertise its status as a stub router
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="stub-router",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """stub_router must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="stub-router", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__stub_router = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_stub_router(self):
        self.__stub_router = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="stub-router",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_traffic_engineering(self):
        """
    Getter method for traffic_engineering, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/traffic_engineering (boolean)

    YANG Description: When this leaf is set to true, the advertising system supports OSPFv2
traffic engineering capabilities
    """
        return self.__traffic_engineering

    def _set_traffic_engineering(self, v, load=False):
        """
    Setter method for traffic_engineering, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/traffic_engineering (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_traffic_engineering is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_traffic_engineering() directly.

    YANG Description: When this leaf is set to true, the advertising system supports OSPFv2
traffic engineering capabilities
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="traffic-engineering",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """traffic_engineering must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="traffic-engineering", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__traffic_engineering = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_traffic_engineering(self):
        self.__traffic_engineering = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="traffic-engineering",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_point_to_point_over_lan(self):
        """
    Getter method for point_to_point_over_lan, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/point_to_point_over_lan (boolean)

    YANG Description: When this leaf is set to true, the advertising system supports treating
LAN adjacencies as though they were point to point
    """
        return self.__point_to_point_over_lan

    def _set_point_to_point_over_lan(self, v, load=False):
        """
    Setter method for point_to_point_over_lan, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/point_to_point_over_lan (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_point_to_point_over_lan is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_point_to_point_over_lan() directly.

    YANG Description: When this leaf is set to true, the advertising system supports treating
LAN adjacencies as though they were point to point
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="point-to-point-over-lan",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """point_to_point_over_lan must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="point-to-point-over-lan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__point_to_point_over_lan = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_point_to_point_over_lan(self):
        self.__point_to_point_over_lan = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="point-to-point-over-lan",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_experimental_te(self):
        """
    Getter method for experimental_te, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/experimental_te (boolean)

    YANG Description: When this leaf is set to ture, the advertising system supports the
experimental extensions to OSPF for TE described in RFC4973
    """
        return self.__experimental_te

    def _set_experimental_te(self, v, load=False):
        """
    Setter method for experimental_te, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/informational_capabilities/state/experimental_te (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_experimental_te is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_experimental_te() directly.

    YANG Description: When this leaf is set to ture, the advertising system supports the
experimental extensions to OSPF for TE described in RFC4973
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="experimental-te",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """experimental_te must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="experimental-te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__experimental_te = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_experimental_te(self):
        self.__experimental_te = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="experimental-te",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    graceful_restart_capable = __builtin__.property(_get_graceful_restart_capable)
    graceful_restart_helper = __builtin__.property(_get_graceful_restart_helper)
    stub_router = __builtin__.property(_get_stub_router)
    traffic_engineering = __builtin__.property(_get_traffic_engineering)
    point_to_point_over_lan = __builtin__.property(_get_point_to_point_over_lan)
    experimental_te = __builtin__.property(_get_experimental_te)

    _pyangbind_elements = OrderedDict(
        [
            ("graceful_restart_capable", graceful_restart_capable),
            ("graceful_restart_helper", graceful_restart_helper),
            ("stub_router", stub_router),
            ("traffic_engineering", traffic_engineering),
            ("point_to_point_over_lan", point_to_point_over_lan),
            ("experimental_te", experimental_te),
        ]
    )
