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

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

    long = int
elif six.PY2:
    import __builtin__


class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/circuit-counters/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: The container defines a list of counters for IS circuit.
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__adj_changes",
        "__init_fails",
        "__rejected_adj",
        "__id_field_len_mismatches",
        "__max_area_address_mismatches",
        "__auth_type_fails",
        "__auth_fails",
        "__lan_dis_changes",
        "__adj_number",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__adj_changes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="adj-changes",
            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="yang:counter32",
            is_config=False,
        )
        self.__init_fails = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="init-fails",
            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="yang:counter32",
            is_config=False,
        )
        self.__rejected_adj = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="rejected-adj",
            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="yang:counter32",
            is_config=False,
        )
        self.__id_field_len_mismatches = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="id-field-len-mismatches",
            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="yang:counter32",
            is_config=False,
        )
        self.__max_area_address_mismatches = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="max-area-address-mismatches",
            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="yang:counter32",
            is_config=False,
        )
        self.__auth_type_fails = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="auth-type-fails",
            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="yang:counter32",
            is_config=False,
        )
        self.__auth_fails = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="auth-fails",
            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="yang:counter32",
            is_config=False,
        )
        self.__lan_dis_changes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="lan-dis-changes",
            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="yang:counter32",
            is_config=False,
        )
        self.__adj_number = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="adj-number",
            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="uint32",
            is_config=False,
        )

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

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "isis",
                "interfaces",
                "interface",
                "circuit-counters",
                "state",
            ]

    def _get_adj_changes(self):
        """
    Getter method for adj_changes, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/adj_changes (yang:counter32)

    YANG Description: Number of times an adjacency state change has occurred on this circuit.
MIB Entry: CircAdjChanges.
    """
        return self.__adj_changes

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

    YANG Description: Number of times an adjacency state change has occurred on this circuit.
MIB Entry: CircAdjChanges.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="adj-changes",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """adj_changes must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="adj-changes", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_adj_changes(self):
        self.__adj_changes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="adj-changes",
            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="yang:counter32",
            is_config=False,
        )

    def _get_init_fails(self):
        """
    Getter method for init_fails, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/init_fails (yang:counter32)

    YANG Description: Number of times initialization of this circuit has failed. This counts
events such as PPP NCP failures. MIB Entry: CircInitFails.
    """
        return self.__init_fails

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

    YANG Description: Number of times initialization of this circuit has failed. This counts
events such as PPP NCP failures. MIB Entry: CircInitFails.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="init-fails",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """init_fails must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="init-fails", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_init_fails(self):
        self.__init_fails = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="init-fails",
            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="yang:counter32",
            is_config=False,
        )

    def _get_rejected_adj(self):
        """
    Getter method for rejected_adj, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/rejected_adj (yang:counter32)

    YANG Description: Number of times an adjacency has been rejected on this circuit. MIB
Entry: CircRejAdjs.
    """
        return self.__rejected_adj

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

    YANG Description: Number of times an adjacency has been rejected on this circuit. MIB
Entry: CircRejAdjs.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="rejected-adj",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """rejected_adj must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="rejected-adj", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_rejected_adj(self):
        self.__rejected_adj = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="rejected-adj",
            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="yang:counter32",
            is_config=False,
        )

    def _get_id_field_len_mismatches(self):
        """
    Getter method for id_field_len_mismatches, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/id_field_len_mismatches (yang:counter32)

    YANG Description: Number of times an IS-IS control PDU with an ID field length different
from that for this system has been received.
MIB Entry: CircIDFieldLenMismatches.
    """
        return self.__id_field_len_mismatches

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

    YANG Description: Number of times an IS-IS control PDU with an ID field length different
from that for this system has been received.
MIB Entry: CircIDFieldLenMismatches.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="id-field-len-mismatches",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """id_field_len_mismatches must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id-field-len-mismatches", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_id_field_len_mismatches(self):
        self.__id_field_len_mismatches = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="id-field-len-mismatches",
            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="yang:counter32",
            is_config=False,
        )

    def _get_max_area_address_mismatches(self):
        """
    Getter method for max_area_address_mismatches, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/max_area_address_mismatches (yang:counter32)

    YANG Description: Number of times an IS-IS control PDU with a max area address field
different from that for this system has been received. MIB Entry:
CircMaxAreaAddrMismatches.
    """
        return self.__max_area_address_mismatches

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

    YANG Description: Number of times an IS-IS control PDU with a max area address field
different from that for this system has been received. MIB Entry:
CircMaxAreaAddrMismatches.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="max-area-address-mismatches",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """max_area_address_mismatches must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="max-area-address-mismatches", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_max_area_address_mismatches(self):
        self.__max_area_address_mismatches = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="max-area-address-mismatches",
            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="yang:counter32",
            is_config=False,
        )

    def _get_auth_type_fails(self):
        """
    Getter method for auth_type_fails, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/auth_type_fails (yang:counter32)

    YANG Description: Number of times an IS-IS control PDU with an auth type field different
from that for this system has been received. MIB Entry:
CircAuthTypeFails.
    """
        return self.__auth_type_fails

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

    YANG Description: Number of times an IS-IS control PDU with an auth type field different
from that for this system has been received. MIB Entry:
CircAuthTypeFails.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="auth-type-fails",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """auth_type_fails must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="auth-type-fails", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_auth_type_fails(self):
        self.__auth_type_fails = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="auth-type-fails",
            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="yang:counter32",
            is_config=False,
        )

    def _get_auth_fails(self):
        """
    Getter method for auth_fails, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/auth_fails (yang:counter32)

    YANG Description: Number of times an IS-IS control PDU with the correct auth type has
failed to pass authentication validation. MIB Entry: CircAuthFails.
    """
        return self.__auth_fails

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

    YANG Description: Number of times an IS-IS control PDU with the correct auth type has
failed to pass authentication validation. MIB Entry: CircAuthFails.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="auth-fails",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """auth_fails must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="auth-fails", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_auth_fails(self):
        self.__auth_fails = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="auth-fails",
            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="yang:counter32",
            is_config=False,
        )

    def _get_lan_dis_changes(self):
        """
    Getter method for lan_dis_changes, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/lan_dis_changes (yang:counter32)

    YANG Description: Number of times the Designated IS has changed on this circuit at this
level. If the circuit is point to point, this count is zero. MIB Entry:
CircLANDesISChanges.
    """
        return self.__lan_dis_changes

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

    YANG Description: Number of times the Designated IS has changed on this circuit at this
level. If the circuit is point to point, this count is zero. MIB Entry:
CircLANDesISChanges.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="lan-dis-changes",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """lan_dis_changes must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="lan-dis-changes", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_lan_dis_changes(self):
        self.__lan_dis_changes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="lan-dis-changes",
            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="yang:counter32",
            is_config=False,
        )

    def _get_adj_number(self):
        """
    Getter method for adj_number, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/adj_number (uint32)

    YANG Description: Number of adjacencies on this circuit.
MIB Entry: CircNumAdj.
    """
        return self.__adj_number

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

    YANG Description: Number of adjacencies on this circuit.
MIB Entry: CircNumAdj.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="adj-number",
                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="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """adj_number must be of a type compatible with uint32""",
                    "defined-type": "uint32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="adj-number", 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='uint32', is_config=False)""",
                }
            )

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

    def _unset_adj_number(self):
        self.__adj_number = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="adj-number",
            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="uint32",
            is_config=False,
        )

    adj_changes = __builtin__.property(_get_adj_changes)
    init_fails = __builtin__.property(_get_init_fails)
    rejected_adj = __builtin__.property(_get_rejected_adj)
    id_field_len_mismatches = __builtin__.property(_get_id_field_len_mismatches)
    max_area_address_mismatches = __builtin__.property(_get_max_area_address_mismatches)
    auth_type_fails = __builtin__.property(_get_auth_type_fails)
    auth_fails = __builtin__.property(_get_auth_fails)
    lan_dis_changes = __builtin__.property(_get_lan_dis_changes)
    adj_number = __builtin__.property(_get_adj_number)

    _pyangbind_elements = OrderedDict(
        [
            ("adj_changes", adj_changes),
            ("init_fails", init_fails),
            ("rejected_adj", rejected_adj),
            ("id_field_len_mismatches", id_field_len_mismatches),
            ("max_area_address_mismatches", max_area_address_mismatches),
            ("auth_type_fails", auth_type_fails),
            ("auth_fails", auth_fails),
            ("lan_dis_changes", lan_dis_changes),
            ("adj_number", adj_number),
        ]
    )


class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/circuit-counters/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: The container defines a list of counters for IS circuit.
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__adj_changes",
        "__init_fails",
        "__rejected_adj",
        "__id_field_len_mismatches",
        "__max_area_address_mismatches",
        "__auth_type_fails",
        "__auth_fails",
        "__lan_dis_changes",
        "__adj_number",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__adj_changes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="adj-changes",
            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="yang:counter32",
            is_config=False,
        )
        self.__init_fails = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="init-fails",
            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="yang:counter32",
            is_config=False,
        )
        self.__rejected_adj = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="rejected-adj",
            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="yang:counter32",
            is_config=False,
        )
        self.__id_field_len_mismatches = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="id-field-len-mismatches",
            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="yang:counter32",
            is_config=False,
        )
        self.__max_area_address_mismatches = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="max-area-address-mismatches",
            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="yang:counter32",
            is_config=False,
        )
        self.__auth_type_fails = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="auth-type-fails",
            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="yang:counter32",
            is_config=False,
        )
        self.__auth_fails = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="auth-fails",
            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="yang:counter32",
            is_config=False,
        )
        self.__lan_dis_changes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="lan-dis-changes",
            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="yang:counter32",
            is_config=False,
        )
        self.__adj_number = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="adj-number",
            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="uint32",
            is_config=False,
        )

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

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "isis",
                "interfaces",
                "interface",
                "circuit-counters",
                "state",
            ]

    def _get_adj_changes(self):
        """
    Getter method for adj_changes, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/adj_changes (yang:counter32)

    YANG Description: Number of times an adjacency state change has occurred on this circuit.
MIB Entry: CircAdjChanges.
    """
        return self.__adj_changes

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

    YANG Description: Number of times an adjacency state change has occurred on this circuit.
MIB Entry: CircAdjChanges.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="adj-changes",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """adj_changes must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="adj-changes", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_adj_changes(self):
        self.__adj_changes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="adj-changes",
            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="yang:counter32",
            is_config=False,
        )

    def _get_init_fails(self):
        """
    Getter method for init_fails, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/init_fails (yang:counter32)

    YANG Description: Number of times initialization of this circuit has failed. This counts
events such as PPP NCP failures. MIB Entry: CircInitFails.
    """
        return self.__init_fails

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

    YANG Description: Number of times initialization of this circuit has failed. This counts
events such as PPP NCP failures. MIB Entry: CircInitFails.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="init-fails",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """init_fails must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="init-fails", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_init_fails(self):
        self.__init_fails = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="init-fails",
            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="yang:counter32",
            is_config=False,
        )

    def _get_rejected_adj(self):
        """
    Getter method for rejected_adj, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/rejected_adj (yang:counter32)

    YANG Description: Number of times an adjacency has been rejected on this circuit. MIB
Entry: CircRejAdjs.
    """
        return self.__rejected_adj

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

    YANG Description: Number of times an adjacency has been rejected on this circuit. MIB
Entry: CircRejAdjs.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="rejected-adj",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """rejected_adj must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="rejected-adj", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_rejected_adj(self):
        self.__rejected_adj = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="rejected-adj",
            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="yang:counter32",
            is_config=False,
        )

    def _get_id_field_len_mismatches(self):
        """
    Getter method for id_field_len_mismatches, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/id_field_len_mismatches (yang:counter32)

    YANG Description: Number of times an IS-IS control PDU with an ID field length different
from that for this system has been received.
MIB Entry: CircIDFieldLenMismatches.
    """
        return self.__id_field_len_mismatches

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

    YANG Description: Number of times an IS-IS control PDU with an ID field length different
from that for this system has been received.
MIB Entry: CircIDFieldLenMismatches.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="id-field-len-mismatches",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """id_field_len_mismatches must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id-field-len-mismatches", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_id_field_len_mismatches(self):
        self.__id_field_len_mismatches = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="id-field-len-mismatches",
            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="yang:counter32",
            is_config=False,
        )

    def _get_max_area_address_mismatches(self):
        """
    Getter method for max_area_address_mismatches, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/max_area_address_mismatches (yang:counter32)

    YANG Description: Number of times an IS-IS control PDU with a max area address field
different from that for this system has been received. MIB Entry:
CircMaxAreaAddrMismatches.
    """
        return self.__max_area_address_mismatches

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

    YANG Description: Number of times an IS-IS control PDU with a max area address field
different from that for this system has been received. MIB Entry:
CircMaxAreaAddrMismatches.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="max-area-address-mismatches",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """max_area_address_mismatches must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="max-area-address-mismatches", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_max_area_address_mismatches(self):
        self.__max_area_address_mismatches = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="max-area-address-mismatches",
            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="yang:counter32",
            is_config=False,
        )

    def _get_auth_type_fails(self):
        """
    Getter method for auth_type_fails, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/auth_type_fails (yang:counter32)

    YANG Description: Number of times an IS-IS control PDU with an auth type field different
from that for this system has been received. MIB Entry:
CircAuthTypeFails.
    """
        return self.__auth_type_fails

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

    YANG Description: Number of times an IS-IS control PDU with an auth type field different
from that for this system has been received. MIB Entry:
CircAuthTypeFails.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="auth-type-fails",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """auth_type_fails must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="auth-type-fails", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_auth_type_fails(self):
        self.__auth_type_fails = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="auth-type-fails",
            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="yang:counter32",
            is_config=False,
        )

    def _get_auth_fails(self):
        """
    Getter method for auth_fails, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/auth_fails (yang:counter32)

    YANG Description: Number of times an IS-IS control PDU with the correct auth type has
failed to pass authentication validation. MIB Entry: CircAuthFails.
    """
        return self.__auth_fails

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

    YANG Description: Number of times an IS-IS control PDU with the correct auth type has
failed to pass authentication validation. MIB Entry: CircAuthFails.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="auth-fails",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """auth_fails must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="auth-fails", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_auth_fails(self):
        self.__auth_fails = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="auth-fails",
            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="yang:counter32",
            is_config=False,
        )

    def _get_lan_dis_changes(self):
        """
    Getter method for lan_dis_changes, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/lan_dis_changes (yang:counter32)

    YANG Description: Number of times the Designated IS has changed on this circuit at this
level. If the circuit is point to point, this count is zero. MIB Entry:
CircLANDesISChanges.
    """
        return self.__lan_dis_changes

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

    YANG Description: Number of times the Designated IS has changed on this circuit at this
level. If the circuit is point to point, this count is zero. MIB Entry:
CircLANDesISChanges.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="lan-dis-changes",
                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="yang:counter32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """lan_dis_changes must be of a type compatible with yang:counter32""",
                    "defined-type": "yang:counter32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="lan-dis-changes", 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='yang:counter32', is_config=False)""",
                }
            )

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

    def _unset_lan_dis_changes(self):
        self.__lan_dis_changes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="lan-dis-changes",
            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="yang:counter32",
            is_config=False,
        )

    def _get_adj_number(self):
        """
    Getter method for adj_number, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/circuit_counters/state/adj_number (uint32)

    YANG Description: Number of adjacencies on this circuit.
MIB Entry: CircNumAdj.
    """
        return self.__adj_number

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

    YANG Description: Number of adjacencies on this circuit.
MIB Entry: CircNumAdj.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="adj-number",
                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="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """adj_number must be of a type compatible with uint32""",
                    "defined-type": "uint32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="adj-number", 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='uint32', is_config=False)""",
                }
            )

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

    def _unset_adj_number(self):
        self.__adj_number = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="adj-number",
            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="uint32",
            is_config=False,
        )

    adj_changes = __builtin__.property(_get_adj_changes)
    init_fails = __builtin__.property(_get_init_fails)
    rejected_adj = __builtin__.property(_get_rejected_adj)
    id_field_len_mismatches = __builtin__.property(_get_id_field_len_mismatches)
    max_area_address_mismatches = __builtin__.property(_get_max_area_address_mismatches)
    auth_type_fails = __builtin__.property(_get_auth_type_fails)
    auth_fails = __builtin__.property(_get_auth_fails)
    lan_dis_changes = __builtin__.property(_get_lan_dis_changes)
    adj_number = __builtin__.property(_get_adj_number)

    _pyangbind_elements = OrderedDict(
        [
            ("adj_changes", adj_changes),
            ("init_fails", init_fails),
            ("rejected_adj", rejected_adj),
            ("id_field_len_mismatches", id_field_len_mismatches),
            ("max_area_address_mismatches", max_area_address_mismatches),
            ("auth_type_fails", auth_type_fails),
            ("auth_fails", auth_fails),
            ("lan_dis_changes", lan_dis_changes),
            ("adj_number", adj_number),
        ]
    )
