# -*- 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 config(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/isis/global/config. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: This container defines ISIS global configuration router.
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__authentication_check",
        "__instance",
        "__net",
        "__maximum_area_addresses",
        "__level_capability",
        "__max_ecmp_paths",
        "__poi_tlv",
        "__iid_tlv",
        "__fast_flooding",
    )

    _yang_name = "config"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__authentication_check = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="authentication-check",
            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=True,
        )
        self.__instance = YANGDynClass(
            base=six.text_type,
            default=six.text_type("0"),
            is_leaf=True,
            yang_name="instance",
            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="string",
            is_config=True,
        )
        self.__net = YANGDynClass(
            base=TypedListType(
                allowed_type=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "[a-fA-F0-9]{2}(\\.[a-fA-F0-9]{4}){3,9}\\.[a-fA-F0-9]{2}"
                    },
                )
            ),
            is_leaf=False,
            yang_name="net",
            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="oc-isis-types:net",
            is_config=True,
        )
        self.__maximum_area_addresses = YANGDynClass(
            base=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
            ),
            default=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
            )(
                3
            ),
            is_leaf=True,
            yang_name="maximum-area-addresses",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=True,
        )
        self.__level_capability = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"LEVEL_1": {}, "LEVEL_2": {}, "LEVEL_1_2": {}},
            ),
            default=six.text_type("LEVEL_1_2"),
            is_leaf=True,
            yang_name="level-capability",
            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="oc-isis-types:level-type",
            is_config=True,
        )
        self.__max_ecmp_paths = YANGDynClass(
            base=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
            ),
            is_leaf=True,
            yang_name="max-ecmp-paths",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=True,
        )
        self.__poi_tlv = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="poi-tlv",
            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=True,
        )
        self.__iid_tlv = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="iid-tlv",
            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=True,
        )
        self.__fast_flooding = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="fast-flooding",
            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=True,
        )

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

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "isis",
                "global",
                "config",
            ]

    def _get_authentication_check(self):
        """
    Getter method for authentication_check, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/authentication_check (boolean)

    YANG Description: When set to true, reject all ISIS protocol PDUs that either have a mismatch
in authentication-type or authentication-key.
    """
        return self.__authentication_check

    def _set_authentication_check(self, v, load=False):
        """
    Setter method for authentication_check, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/authentication_check (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_authentication_check is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_authentication_check() directly.

    YANG Description: When set to true, reject all ISIS protocol PDUs that either have a mismatch
in authentication-type or authentication-key.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("true"),
                is_leaf=True,
                yang_name="authentication-check",
                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=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """authentication_check must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="authentication-check", 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=True)""",
                }
            )

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

    def _unset_authentication_check(self):
        self.__authentication_check = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="authentication-check",
            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=True,
        )

    def _get_instance(self):
        """
    Getter method for instance, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/instance (string)

    YANG Description: ISIS Instance.
    """
        return self.__instance

    def _set_instance(self, v, load=False):
        """
    Setter method for instance, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/instance (string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_instance is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_instance() directly.

    YANG Description: ISIS Instance.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                default=six.text_type("0"),
                is_leaf=True,
                yang_name="instance",
                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="string",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """instance must be of a type compatible with string""",
                    "defined-type": "string",
                    "generated-type": """YANGDynClass(base=six.text_type, default=six.text_type("0"), is_leaf=True, yang_name="instance", 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='string', is_config=True)""",
                }
            )

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

    def _unset_instance(self):
        self.__instance = YANGDynClass(
            base=six.text_type,
            default=six.text_type("0"),
            is_leaf=True,
            yang_name="instance",
            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="string",
            is_config=True,
        )

    def _get_net(self):
        """
    Getter method for net, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/net (oc-isis-types:net)

    YANG Description: ISIS network entity title (NET). The first 8 bits are usually
49 (private AFI), next 16 bits represent area, next 48 bits represent
system id and final 8 bits are set to 0.
    """
        return self.__net

    def _set_net(self, v, load=False):
        """
    Setter method for net, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/net (oc-isis-types:net)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_net is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_net() directly.

    YANG Description: ISIS network entity title (NET). The first 8 bits are usually
49 (private AFI), next 16 bits represent area, next 48 bits represent
system id and final 8 bits are set to 0.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=TypedListType(
                    allowed_type=RestrictedClassType(
                        base_type=six.text_type,
                        restriction_dict={
                            "pattern": "[a-fA-F0-9]{2}(\\.[a-fA-F0-9]{4}){3,9}\\.[a-fA-F0-9]{2}"
                        },
                    )
                ),
                is_leaf=False,
                yang_name="net",
                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="oc-isis-types:net",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """net must be of a type compatible with oc-isis-types:net""",
                    "defined-type": "oc-isis-types:net",
                    "generated-type": """YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[a-fA-F0-9]{2}(\\.[a-fA-F0-9]{4}){3,9}\\.[a-fA-F0-9]{2}'})), is_leaf=False, yang_name="net", 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='oc-isis-types:net', is_config=True)""",
                }
            )

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

    def _unset_net(self):
        self.__net = YANGDynClass(
            base=TypedListType(
                allowed_type=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "[a-fA-F0-9]{2}(\\.[a-fA-F0-9]{4}){3,9}\\.[a-fA-F0-9]{2}"
                    },
                )
            ),
            is_leaf=False,
            yang_name="net",
            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="oc-isis-types:net",
            is_config=True,
        )

    def _get_maximum_area_addresses(self):
        """
    Getter method for maximum_area_addresses, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/maximum_area_addresses (uint8)

    YANG Description: Maximum areas supported.
    """
        return self.__maximum_area_addresses

    def _set_maximum_area_addresses(self, v, load=False):
        """
    Setter method for maximum_area_addresses, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/maximum_area_addresses (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_maximum_area_addresses is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_maximum_area_addresses() directly.

    YANG Description: Maximum areas supported.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                default=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                )(
                    3
                ),
                is_leaf=True,
                yang_name="maximum-area-addresses",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint8",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """maximum_area_addresses must be of a type compatible with uint8""",
                    "defined-type": "uint8",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(3), is_leaf=True, yang_name="maximum-area-addresses", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=True)""",
                }
            )

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

    def _unset_maximum_area_addresses(self):
        self.__maximum_area_addresses = YANGDynClass(
            base=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
            ),
            default=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
            )(
                3
            ),
            is_leaf=True,
            yang_name="maximum-area-addresses",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=True,
        )

    def _get_level_capability(self):
        """
    Getter method for level_capability, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/level_capability (oc-isis-types:level-type)

    YANG Description: ISIS level capability(level-1, level-2,vlevel-1-2).
    """
        return self.__level_capability

    def _set_level_capability(self, v, load=False):
        """
    Setter method for level_capability, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/level_capability (oc-isis-types:level-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_level_capability is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_level_capability() directly.

    YANG Description: ISIS level capability(level-1, level-2,vlevel-1-2).
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={"LEVEL_1": {}, "LEVEL_2": {}, "LEVEL_1_2": {}},
                ),
                default=six.text_type("LEVEL_1_2"),
                is_leaf=True,
                yang_name="level-capability",
                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="oc-isis-types:level-type",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """level_capability must be of a type compatible with oc-isis-types:level-type""",
                    "defined-type": "oc-isis-types:level-type",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'LEVEL_1': {}, 'LEVEL_2': {}, 'LEVEL_1_2': {}},), default=six.text_type("LEVEL_1_2"), is_leaf=True, yang_name="level-capability", 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='oc-isis-types:level-type', is_config=True)""",
                }
            )

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

    def _unset_level_capability(self):
        self.__level_capability = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"LEVEL_1": {}, "LEVEL_2": {}, "LEVEL_1_2": {}},
            ),
            default=six.text_type("LEVEL_1_2"),
            is_leaf=True,
            yang_name="level-capability",
            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="oc-isis-types:level-type",
            is_config=True,
        )

    def _get_max_ecmp_paths(self):
        """
    Getter method for max_ecmp_paths, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/max_ecmp_paths (uint8)

    YANG Description: ISIS max-paths count.
    """
        return self.__max_ecmp_paths

    def _set_max_ecmp_paths(self, v, load=False):
        """
    Setter method for max_ecmp_paths, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/max_ecmp_paths (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_max_ecmp_paths is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_max_ecmp_paths() directly.

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

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

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

    def _get_poi_tlv(self):
        """
    Getter method for poi_tlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/poi_tlv (boolean)

    YANG Description: ISIS purge TLV. When set to true, a TLV is added to purges to record
the system ID  of the IS generating the purge.
    """
        return self.__poi_tlv

    def _set_poi_tlv(self, v, load=False):
        """
    Setter method for poi_tlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/poi_tlv (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_poi_tlv is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_poi_tlv() directly.

    YANG Description: ISIS purge TLV. When set to true, a TLV is added to purges to record
the system ID  of the IS generating the purge.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="poi-tlv",
                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=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """poi_tlv must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="poi-tlv", 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=True)""",
                }
            )

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

    def _unset_poi_tlv(self):
        self.__poi_tlv = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="poi-tlv",
            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=True,
        )

    def _get_iid_tlv(self):
        """
    Getter method for iid_tlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/iid_tlv (boolean)

    YANG Description: ISIS Instance Identifier TLV. When set to trues, the IID-TLV identifies
the unique instance as well as the topology/topologies to which the
PDU applies.
    """
        return self.__iid_tlv

    def _set_iid_tlv(self, v, load=False):
        """
    Setter method for iid_tlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/iid_tlv (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_iid_tlv is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_iid_tlv() directly.

    YANG Description: ISIS Instance Identifier TLV. When set to trues, the IID-TLV identifies
the unique instance as well as the topology/topologies to which the
PDU applies.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="iid-tlv",
                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=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """iid_tlv must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="iid-tlv", 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=True)""",
                }
            )

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

    def _unset_iid_tlv(self):
        self.__iid_tlv = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="iid-tlv",
            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=True,
        )

    def _get_fast_flooding(self):
        """
    Getter method for fast_flooding, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/fast_flooding (boolean)

    YANG Description: When set to true, IS will always flood the LSP that triggered an SPF
before the router actually runs the SPF computation.
    """
        return self.__fast_flooding

    def _set_fast_flooding(self, v, load=False):
        """
    Setter method for fast_flooding, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/fast_flooding (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_fast_flooding is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_fast_flooding() directly.

    YANG Description: When set to true, IS will always flood the LSP that triggered an SPF
before the router actually runs the SPF computation.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("true"),
                is_leaf=True,
                yang_name="fast-flooding",
                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=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """fast_flooding must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="fast-flooding", 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=True)""",
                }
            )

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

    def _unset_fast_flooding(self):
        self.__fast_flooding = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="fast-flooding",
            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=True,
        )

    authentication_check = __builtin__.property(
        _get_authentication_check, _set_authentication_check
    )
    instance = __builtin__.property(_get_instance, _set_instance)
    net = __builtin__.property(_get_net, _set_net)
    maximum_area_addresses = __builtin__.property(
        _get_maximum_area_addresses, _set_maximum_area_addresses
    )
    level_capability = __builtin__.property(
        _get_level_capability, _set_level_capability
    )
    max_ecmp_paths = __builtin__.property(_get_max_ecmp_paths, _set_max_ecmp_paths)
    poi_tlv = __builtin__.property(_get_poi_tlv, _set_poi_tlv)
    iid_tlv = __builtin__.property(_get_iid_tlv, _set_iid_tlv)
    fast_flooding = __builtin__.property(_get_fast_flooding, _set_fast_flooding)

    _pyangbind_elements = OrderedDict(
        [
            ("authentication_check", authentication_check),
            ("instance", instance),
            ("net", net),
            ("maximum_area_addresses", maximum_area_addresses),
            ("level_capability", level_capability),
            ("max_ecmp_paths", max_ecmp_paths),
            ("poi_tlv", poi_tlv),
            ("iid_tlv", iid_tlv),
            ("fast_flooding", fast_flooding),
        ]
    )


class config(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/isis/global/config. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: This container defines ISIS global configuration router.
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__authentication_check",
        "__instance",
        "__net",
        "__maximum_area_addresses",
        "__level_capability",
        "__max_ecmp_paths",
        "__poi_tlv",
        "__iid_tlv",
        "__fast_flooding",
    )

    _yang_name = "config"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__authentication_check = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="authentication-check",
            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=True,
        )
        self.__instance = YANGDynClass(
            base=six.text_type,
            default=six.text_type("0"),
            is_leaf=True,
            yang_name="instance",
            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="string",
            is_config=True,
        )
        self.__net = YANGDynClass(
            base=TypedListType(
                allowed_type=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "[a-fA-F0-9]{2}(\\.[a-fA-F0-9]{4}){3,9}\\.[a-fA-F0-9]{2}"
                    },
                )
            ),
            is_leaf=False,
            yang_name="net",
            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="oc-isis-types:net",
            is_config=True,
        )
        self.__maximum_area_addresses = YANGDynClass(
            base=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
            ),
            default=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
            )(
                3
            ),
            is_leaf=True,
            yang_name="maximum-area-addresses",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=True,
        )
        self.__level_capability = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"LEVEL_1": {}, "LEVEL_2": {}, "LEVEL_1_2": {}},
            ),
            default=six.text_type("LEVEL_1_2"),
            is_leaf=True,
            yang_name="level-capability",
            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="oc-isis-types:level-type",
            is_config=True,
        )
        self.__max_ecmp_paths = YANGDynClass(
            base=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
            ),
            is_leaf=True,
            yang_name="max-ecmp-paths",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=True,
        )
        self.__poi_tlv = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="poi-tlv",
            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=True,
        )
        self.__iid_tlv = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="iid-tlv",
            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=True,
        )
        self.__fast_flooding = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="fast-flooding",
            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=True,
        )

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

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "isis",
                "global",
                "config",
            ]

    def _get_authentication_check(self):
        """
    Getter method for authentication_check, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/authentication_check (boolean)

    YANG Description: When set to true, reject all ISIS protocol PDUs that either have a mismatch
in authentication-type or authentication-key.
    """
        return self.__authentication_check

    def _set_authentication_check(self, v, load=False):
        """
    Setter method for authentication_check, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/authentication_check (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_authentication_check is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_authentication_check() directly.

    YANG Description: When set to true, reject all ISIS protocol PDUs that either have a mismatch
in authentication-type or authentication-key.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("true"),
                is_leaf=True,
                yang_name="authentication-check",
                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=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """authentication_check must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="authentication-check", 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=True)""",
                }
            )

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

    def _unset_authentication_check(self):
        self.__authentication_check = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="authentication-check",
            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=True,
        )

    def _get_instance(self):
        """
    Getter method for instance, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/instance (string)

    YANG Description: ISIS Instance.
    """
        return self.__instance

    def _set_instance(self, v, load=False):
        """
    Setter method for instance, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/instance (string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_instance is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_instance() directly.

    YANG Description: ISIS Instance.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                default=six.text_type("0"),
                is_leaf=True,
                yang_name="instance",
                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="string",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """instance must be of a type compatible with string""",
                    "defined-type": "string",
                    "generated-type": """YANGDynClass(base=six.text_type, default=six.text_type("0"), is_leaf=True, yang_name="instance", 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='string', is_config=True)""",
                }
            )

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

    def _unset_instance(self):
        self.__instance = YANGDynClass(
            base=six.text_type,
            default=six.text_type("0"),
            is_leaf=True,
            yang_name="instance",
            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="string",
            is_config=True,
        )

    def _get_net(self):
        """
    Getter method for net, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/net (oc-isis-types:net)

    YANG Description: ISIS network entity title (NET). The first 8 bits are usually
49 (private AFI), next 16 bits represent area, next 48 bits represent
system id and final 8 bits are set to 0.
    """
        return self.__net

    def _set_net(self, v, load=False):
        """
    Setter method for net, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/net (oc-isis-types:net)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_net is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_net() directly.

    YANG Description: ISIS network entity title (NET). The first 8 bits are usually
49 (private AFI), next 16 bits represent area, next 48 bits represent
system id and final 8 bits are set to 0.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=TypedListType(
                    allowed_type=RestrictedClassType(
                        base_type=six.text_type,
                        restriction_dict={
                            "pattern": "[a-fA-F0-9]{2}(\\.[a-fA-F0-9]{4}){3,9}\\.[a-fA-F0-9]{2}"
                        },
                    )
                ),
                is_leaf=False,
                yang_name="net",
                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="oc-isis-types:net",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """net must be of a type compatible with oc-isis-types:net""",
                    "defined-type": "oc-isis-types:net",
                    "generated-type": """YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[a-fA-F0-9]{2}(\\.[a-fA-F0-9]{4}){3,9}\\.[a-fA-F0-9]{2}'})), is_leaf=False, yang_name="net", 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='oc-isis-types:net', is_config=True)""",
                }
            )

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

    def _unset_net(self):
        self.__net = YANGDynClass(
            base=TypedListType(
                allowed_type=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "[a-fA-F0-9]{2}(\\.[a-fA-F0-9]{4}){3,9}\\.[a-fA-F0-9]{2}"
                    },
                )
            ),
            is_leaf=False,
            yang_name="net",
            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="oc-isis-types:net",
            is_config=True,
        )

    def _get_maximum_area_addresses(self):
        """
    Getter method for maximum_area_addresses, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/maximum_area_addresses (uint8)

    YANG Description: Maximum areas supported.
    """
        return self.__maximum_area_addresses

    def _set_maximum_area_addresses(self, v, load=False):
        """
    Setter method for maximum_area_addresses, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/maximum_area_addresses (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_maximum_area_addresses is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_maximum_area_addresses() directly.

    YANG Description: Maximum areas supported.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                default=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                )(
                    3
                ),
                is_leaf=True,
                yang_name="maximum-area-addresses",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint8",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """maximum_area_addresses must be of a type compatible with uint8""",
                    "defined-type": "uint8",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(3), is_leaf=True, yang_name="maximum-area-addresses", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=True)""",
                }
            )

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

    def _unset_maximum_area_addresses(self):
        self.__maximum_area_addresses = YANGDynClass(
            base=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
            ),
            default=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
            )(
                3
            ),
            is_leaf=True,
            yang_name="maximum-area-addresses",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=True,
        )

    def _get_level_capability(self):
        """
    Getter method for level_capability, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/level_capability (oc-isis-types:level-type)

    YANG Description: ISIS level capability(level-1, level-2,vlevel-1-2).
    """
        return self.__level_capability

    def _set_level_capability(self, v, load=False):
        """
    Setter method for level_capability, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/level_capability (oc-isis-types:level-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_level_capability is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_level_capability() directly.

    YANG Description: ISIS level capability(level-1, level-2,vlevel-1-2).
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={"LEVEL_1": {}, "LEVEL_2": {}, "LEVEL_1_2": {}},
                ),
                default=six.text_type("LEVEL_1_2"),
                is_leaf=True,
                yang_name="level-capability",
                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="oc-isis-types:level-type",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """level_capability must be of a type compatible with oc-isis-types:level-type""",
                    "defined-type": "oc-isis-types:level-type",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'LEVEL_1': {}, 'LEVEL_2': {}, 'LEVEL_1_2': {}},), default=six.text_type("LEVEL_1_2"), is_leaf=True, yang_name="level-capability", 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='oc-isis-types:level-type', is_config=True)""",
                }
            )

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

    def _unset_level_capability(self):
        self.__level_capability = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"LEVEL_1": {}, "LEVEL_2": {}, "LEVEL_1_2": {}},
            ),
            default=six.text_type("LEVEL_1_2"),
            is_leaf=True,
            yang_name="level-capability",
            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="oc-isis-types:level-type",
            is_config=True,
        )

    def _get_max_ecmp_paths(self):
        """
    Getter method for max_ecmp_paths, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/max_ecmp_paths (uint8)

    YANG Description: ISIS max-paths count.
    """
        return self.__max_ecmp_paths

    def _set_max_ecmp_paths(self, v, load=False):
        """
    Setter method for max_ecmp_paths, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/max_ecmp_paths (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_max_ecmp_paths is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_max_ecmp_paths() directly.

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

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

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

    def _get_poi_tlv(self):
        """
    Getter method for poi_tlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/poi_tlv (boolean)

    YANG Description: ISIS purge TLV. When set to true, a TLV is added to purges to record
the system ID  of the IS generating the purge.
    """
        return self.__poi_tlv

    def _set_poi_tlv(self, v, load=False):
        """
    Setter method for poi_tlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/poi_tlv (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_poi_tlv is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_poi_tlv() directly.

    YANG Description: ISIS purge TLV. When set to true, a TLV is added to purges to record
the system ID  of the IS generating the purge.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="poi-tlv",
                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=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """poi_tlv must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="poi-tlv", 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=True)""",
                }
            )

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

    def _unset_poi_tlv(self):
        self.__poi_tlv = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="poi-tlv",
            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=True,
        )

    def _get_iid_tlv(self):
        """
    Getter method for iid_tlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/iid_tlv (boolean)

    YANG Description: ISIS Instance Identifier TLV. When set to trues, the IID-TLV identifies
the unique instance as well as the topology/topologies to which the
PDU applies.
    """
        return self.__iid_tlv

    def _set_iid_tlv(self, v, load=False):
        """
    Setter method for iid_tlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/iid_tlv (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_iid_tlv is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_iid_tlv() directly.

    YANG Description: ISIS Instance Identifier TLV. When set to trues, the IID-TLV identifies
the unique instance as well as the topology/topologies to which the
PDU applies.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="iid-tlv",
                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=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """iid_tlv must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="iid-tlv", 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=True)""",
                }
            )

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

    def _unset_iid_tlv(self):
        self.__iid_tlv = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="iid-tlv",
            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=True,
        )

    def _get_fast_flooding(self):
        """
    Getter method for fast_flooding, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/fast_flooding (boolean)

    YANG Description: When set to true, IS will always flood the LSP that triggered an SPF
before the router actually runs the SPF computation.
    """
        return self.__fast_flooding

    def _set_fast_flooding(self, v, load=False):
        """
    Setter method for fast_flooding, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/config/fast_flooding (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_fast_flooding is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_fast_flooding() directly.

    YANG Description: When set to true, IS will always flood the LSP that triggered an SPF
before the router actually runs the SPF computation.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("true"),
                is_leaf=True,
                yang_name="fast-flooding",
                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=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """fast_flooding must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="fast-flooding", 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=True)""",
                }
            )

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

    def _unset_fast_flooding(self):
        self.__fast_flooding = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="fast-flooding",
            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=True,
        )

    authentication_check = __builtin__.property(
        _get_authentication_check, _set_authentication_check
    )
    instance = __builtin__.property(_get_instance, _set_instance)
    net = __builtin__.property(_get_net, _set_net)
    maximum_area_addresses = __builtin__.property(
        _get_maximum_area_addresses, _set_maximum_area_addresses
    )
    level_capability = __builtin__.property(
        _get_level_capability, _set_level_capability
    )
    max_ecmp_paths = __builtin__.property(_get_max_ecmp_paths, _set_max_ecmp_paths)
    poi_tlv = __builtin__.property(_get_poi_tlv, _set_poi_tlv)
    iid_tlv = __builtin__.property(_get_iid_tlv, _set_iid_tlv)
    fast_flooding = __builtin__.property(_get_fast_flooding, _set_fast_flooding)

    _pyangbind_elements = OrderedDict(
        [
            ("authentication_check", authentication_check),
            ("instance", instance),
            ("net", net),
            ("maximum_area_addresses", maximum_area_addresses),
            ("level_capability", level_capability),
            ("max_ecmp_paths", max_ecmp_paths),
            ("poi_tlv", poi_tlv),
            ("iid_tlv", iid_tlv),
            ("fast_flooding", fast_flooding),
        ]
    )
