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

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

    long = int
elif six.PY2:
    import __builtin__

from . import config
from . import state
from . import circuit_counters
from . import authentication
from . import afi_safi
from . import levels
from . import timers
from . import bfd
from . import interface_ref


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

  YANG Description: This list contains ISIS interfaces.
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__interface_id",
        "__config",
        "__state",
        "__circuit_counters",
        "__authentication",
        "__afi_safi",
        "__levels",
        "__timers",
        "__bfd",
        "__interface_ref",
    )

    _yang_name = "interface"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__interface_id = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="interface-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=True,
        )
        self.__config = YANGDynClass(
            base=config.config,
            is_container="container",
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__state = YANGDynClass(
            base=state.state,
            is_container="container",
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__circuit_counters = YANGDynClass(
            base=circuit_counters.circuit_counters,
            is_container="container",
            yang_name="circuit-counters",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__authentication = YANGDynClass(
            base=authentication.authentication,
            is_container="container",
            yang_name="authentication",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__afi_safi = YANGDynClass(
            base=afi_safi.afi_safi,
            is_container="container",
            yang_name="afi-safi",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__levels = YANGDynClass(
            base=levels.levels,
            is_container="container",
            yang_name="levels",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__timers = YANGDynClass(
            base=timers.timers,
            is_container="container",
            yang_name="timers",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__bfd = YANGDynClass(
            base=bfd.bfd,
            is_container="container",
            yang_name="bfd",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__interface_ref = YANGDynClass(
            base=interface_ref.interface_ref,
            is_container="container",
            yang_name="interface-ref",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            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",
                "interfaces",
                "interface",
            ]

    def _get_interface_id(self):
        """
    Getter method for interface_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/interface_id (leafref)

    YANG Description: Reference to interface-id
    """
        return self.__interface_id

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

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

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

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

    def _unset_interface_id(self):
        self.__interface_id = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="interface-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=True,
        )

    def _get_config(self):
        """
    Getter method for config, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/config (container)

    YANG Description: This container defines ISIS interface configuration.
    """
        return self.__config

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

    YANG Description: This container defines ISIS interface configuration.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=config.config,
                is_container="container",
                yang_name="config",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """config must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
                }
            )

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

    def _unset_config(self):
        self.__config = YANGDynClass(
            base=config.config,
            is_container="container",
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_state(self):
        """
    Getter method for state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/state (container)

    YANG Description: This container defines state information for ISIS interfaces.
    """
        return self.__state

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

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

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

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

    def _get_circuit_counters(self):
        """
    Getter method for circuit_counters, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters (container)

    YANG Description: This container defines state information for ISIS circuit counters.
    """
        return self.__circuit_counters

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

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

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

    def _unset_circuit_counters(self):
        self.__circuit_counters = YANGDynClass(
            base=circuit_counters.circuit_counters,
            is_container="container",
            yang_name="circuit-counters",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_authentication(self):
        """
    Getter method for authentication, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/authentication (container)

    YANG Description: This container defines ISIS authentication.
    """
        return self.__authentication

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

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

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

    def _unset_authentication(self):
        self.__authentication = YANGDynClass(
            base=authentication.authentication,
            is_container="container",
            yang_name="authentication",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_afi_safi(self):
        """
    Getter method for afi_safi, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/afi_safi (container)

    YANG Description: This container defines address-family specific configuration
and state information.
    """
        return self.__afi_safi

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

    YANG Description: This container defines address-family specific configuration
and state information.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=afi_safi.afi_safi,
                is_container="container",
                yang_name="afi-safi",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """afi_safi must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=afi_safi.afi_safi, is_container='container', yang_name="afi-safi", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
                }
            )

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

    def _unset_afi_safi(self):
        self.__afi_safi = YANGDynClass(
            base=afi_safi.afi_safi,
            is_container="container",
            yang_name="afi-safi",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_levels(self):
        """
    Getter method for levels, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/levels (container)

    YANG Description: This container defines ISIS level specific configuration and
state information.
    """
        return self.__levels

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

    YANG Description: This container defines ISIS level specific configuration and
state information.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=levels.levels,
                is_container="container",
                yang_name="levels",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """levels must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=levels.levels, is_container='container', yang_name="levels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
                }
            )

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

    def _unset_levels(self):
        self.__levels = YANGDynClass(
            base=levels.levels,
            is_container="container",
            yang_name="levels",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_timers(self):
        """
    Getter method for timers, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/timers (container)

    YANG Description: This container describes ISIS interface timers configuration
    """
        return self.__timers

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

    YANG Description: This container describes ISIS interface timers configuration
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=timers.timers,
                is_container="container",
                yang_name="timers",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """timers must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=timers.timers, is_container='container', yang_name="timers", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
                }
            )

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

    def _unset_timers(self):
        self.__timers = YANGDynClass(
            base=timers.timers,
            is_container="container",
            yang_name="timers",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_bfd(self):
        """
    Getter method for bfd, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/bfd (container)

    YANG Description: This container defines BFD.
    """
        return self.__bfd

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

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

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

    def _unset_bfd(self):
        self.__bfd = YANGDynClass(
            base=bfd.bfd,
            is_container="container",
            yang_name="bfd",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_interface_ref(self):
        """
    Getter method for interface_ref, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/interface_ref (container)

    YANG Description: Reference to an interface or subinterface
    """
        return self.__interface_ref

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

    YANG Description: Reference to an interface or subinterface
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=interface_ref.interface_ref,
                is_container="container",
                yang_name="interface-ref",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """interface_ref must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=interface_ref.interface_ref, is_container='container', yang_name="interface-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
                }
            )

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

    def _unset_interface_ref(self):
        self.__interface_ref = YANGDynClass(
            base=interface_ref.interface_ref,
            is_container="container",
            yang_name="interface-ref",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    interface_id = __builtin__.property(_get_interface_id, _set_interface_id)
    config = __builtin__.property(_get_config, _set_config)
    state = __builtin__.property(_get_state, _set_state)
    circuit_counters = __builtin__.property(
        _get_circuit_counters, _set_circuit_counters
    )
    authentication = __builtin__.property(_get_authentication, _set_authentication)
    afi_safi = __builtin__.property(_get_afi_safi, _set_afi_safi)
    levels = __builtin__.property(_get_levels, _set_levels)
    timers = __builtin__.property(_get_timers, _set_timers)
    bfd = __builtin__.property(_get_bfd, _set_bfd)
    interface_ref = __builtin__.property(_get_interface_ref, _set_interface_ref)

    _pyangbind_elements = OrderedDict(
        [
            ("interface_id", interface_id),
            ("config", config),
            ("state", state),
            ("circuit_counters", circuit_counters),
            ("authentication", authentication),
            ("afi_safi", afi_safi),
            ("levels", levels),
            ("timers", timers),
            ("bfd", bfd),
            ("interface_ref", interface_ref),
        ]
    )


from . import config
from . import state
from . import circuit_counters
from . import authentication
from . import afi_safi
from . import levels
from . import timers
from . import bfd
from . import interface_ref


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

  YANG Description: This list contains ISIS interfaces.
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__interface_id",
        "__config",
        "__state",
        "__circuit_counters",
        "__authentication",
        "__afi_safi",
        "__levels",
        "__timers",
        "__bfd",
        "__interface_ref",
    )

    _yang_name = "interface"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__interface_id = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="interface-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=True,
        )
        self.__config = YANGDynClass(
            base=config.config,
            is_container="container",
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__state = YANGDynClass(
            base=state.state,
            is_container="container",
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__circuit_counters = YANGDynClass(
            base=circuit_counters.circuit_counters,
            is_container="container",
            yang_name="circuit-counters",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__authentication = YANGDynClass(
            base=authentication.authentication,
            is_container="container",
            yang_name="authentication",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__afi_safi = YANGDynClass(
            base=afi_safi.afi_safi,
            is_container="container",
            yang_name="afi-safi",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__levels = YANGDynClass(
            base=levels.levels,
            is_container="container",
            yang_name="levels",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__timers = YANGDynClass(
            base=timers.timers,
            is_container="container",
            yang_name="timers",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__bfd = YANGDynClass(
            base=bfd.bfd,
            is_container="container",
            yang_name="bfd",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__interface_ref = YANGDynClass(
            base=interface_ref.interface_ref,
            is_container="container",
            yang_name="interface-ref",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            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",
                "interfaces",
                "interface",
            ]

    def _get_interface_id(self):
        """
    Getter method for interface_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/interface_id (leafref)

    YANG Description: Reference to interface-id
    """
        return self.__interface_id

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

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

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

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

    def _unset_interface_id(self):
        self.__interface_id = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="interface-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=True,
        )

    def _get_config(self):
        """
    Getter method for config, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/config (container)

    YANG Description: This container defines ISIS interface configuration.
    """
        return self.__config

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

    YANG Description: This container defines ISIS interface configuration.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=config.config,
                is_container="container",
                yang_name="config",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """config must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
                }
            )

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

    def _unset_config(self):
        self.__config = YANGDynClass(
            base=config.config,
            is_container="container",
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_state(self):
        """
    Getter method for state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/state (container)

    YANG Description: This container defines state information for ISIS interfaces.
    """
        return self.__state

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

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

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

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

    def _get_circuit_counters(self):
        """
    Getter method for circuit_counters, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters (container)

    YANG Description: This container defines state information for ISIS circuit counters.
    """
        return self.__circuit_counters

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

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

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

    def _unset_circuit_counters(self):
        self.__circuit_counters = YANGDynClass(
            base=circuit_counters.circuit_counters,
            is_container="container",
            yang_name="circuit-counters",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_authentication(self):
        """
    Getter method for authentication, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/authentication (container)

    YANG Description: This container defines ISIS authentication.
    """
        return self.__authentication

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

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

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

    def _unset_authentication(self):
        self.__authentication = YANGDynClass(
            base=authentication.authentication,
            is_container="container",
            yang_name="authentication",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_afi_safi(self):
        """
    Getter method for afi_safi, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/afi_safi (container)

    YANG Description: This container defines address-family specific configuration
and state information.
    """
        return self.__afi_safi

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

    YANG Description: This container defines address-family specific configuration
and state information.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=afi_safi.afi_safi,
                is_container="container",
                yang_name="afi-safi",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """afi_safi must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=afi_safi.afi_safi, is_container='container', yang_name="afi-safi", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
                }
            )

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

    def _unset_afi_safi(self):
        self.__afi_safi = YANGDynClass(
            base=afi_safi.afi_safi,
            is_container="container",
            yang_name="afi-safi",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_levels(self):
        """
    Getter method for levels, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/levels (container)

    YANG Description: This container defines ISIS level specific configuration and
state information.
    """
        return self.__levels

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

    YANG Description: This container defines ISIS level specific configuration and
state information.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=levels.levels,
                is_container="container",
                yang_name="levels",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """levels must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=levels.levels, is_container='container', yang_name="levels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
                }
            )

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

    def _unset_levels(self):
        self.__levels = YANGDynClass(
            base=levels.levels,
            is_container="container",
            yang_name="levels",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_timers(self):
        """
    Getter method for timers, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/timers (container)

    YANG Description: This container describes ISIS interface timers configuration
    """
        return self.__timers

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

    YANG Description: This container describes ISIS interface timers configuration
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=timers.timers,
                is_container="container",
                yang_name="timers",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """timers must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=timers.timers, is_container='container', yang_name="timers", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
                }
            )

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

    def _unset_timers(self):
        self.__timers = YANGDynClass(
            base=timers.timers,
            is_container="container",
            yang_name="timers",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_bfd(self):
        """
    Getter method for bfd, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/bfd (container)

    YANG Description: This container defines BFD.
    """
        return self.__bfd

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

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

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

    def _unset_bfd(self):
        self.__bfd = YANGDynClass(
            base=bfd.bfd,
            is_container="container",
            yang_name="bfd",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_interface_ref(self):
        """
    Getter method for interface_ref, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/interface_ref (container)

    YANG Description: Reference to an interface or subinterface
    """
        return self.__interface_ref

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

    YANG Description: Reference to an interface or subinterface
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=interface_ref.interface_ref,
                is_container="container",
                yang_name="interface-ref",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """interface_ref must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=interface_ref.interface_ref, is_container='container', yang_name="interface-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
                }
            )

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

    def _unset_interface_ref(self):
        self.__interface_ref = YANGDynClass(
            base=interface_ref.interface_ref,
            is_container="container",
            yang_name="interface-ref",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    interface_id = __builtin__.property(_get_interface_id, _set_interface_id)
    config = __builtin__.property(_get_config, _set_config)
    state = __builtin__.property(_get_state, _set_state)
    circuit_counters = __builtin__.property(
        _get_circuit_counters, _set_circuit_counters
    )
    authentication = __builtin__.property(_get_authentication, _set_authentication)
    afi_safi = __builtin__.property(_get_afi_safi, _set_afi_safi)
    levels = __builtin__.property(_get_levels, _set_levels)
    timers = __builtin__.property(_get_timers, _set_timers)
    bfd = __builtin__.property(_get_bfd, _set_bfd)
    interface_ref = __builtin__.property(_get_interface_ref, _set_interface_ref)

    _pyangbind_elements = OrderedDict(
        [
            ("interface_id", interface_id),
            ("config", config),
            ("state", state),
            ("circuit_counters", circuit_counters),
            ("authentication", authentication),
            ("afi_safi", afi_safi),
            ("levels", levels),
            ("timers", timers),
            ("bfd", bfd),
            ("interface_ref", interface_ref),
        ]
    )
