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

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

    long = int
elif six.PY2:
    import __builtin__


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

  YANG Description: State parameters relating to the OSPF virtual link
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__remote_router_id",
        "__priority",
        "__dead_time",
        "__designated_router",
        "__backup_designated_router",
        "__optional_capabilities",
        "__last_established_time",
        "__adjacency_state",
        "__state_changes",
        "__retranmission_queue_length",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__remote_router_id = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?"
                    },
                ),
                restriction_dict={"pattern": "[0-9\\.]*"},
            ),
            is_leaf=True,
            yang_name="remote-router-id",
            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="inet:ipv4-address-no-zone",
            is_config=False,
        )
        self.__priority = YANGDynClass(
            base=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
            ),
            is_leaf=True,
            yang_name="priority",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=False,
        )
        self.__dead_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="dead-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:timeticks64",
            is_config=False,
        )
        self.__designated_router = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
                },
            ),
            is_leaf=True,
            yang_name="designated-router",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="yang:dotted-quad",
            is_config=False,
        )
        self.__backup_designated_router = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
                },
            ),
            is_leaf=True,
            yang_name="backup-designated-router",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="yang:dotted-quad",
            is_config=False,
        )
        self.__optional_capabilities = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={"pattern": "([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?"},
            ),
            is_leaf=True,
            yang_name="optional-capabilities",
            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:hex-string",
            is_config=False,
        )
        self.__last_established_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="last-established-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:timeticks64",
            is_config=False,
        )
        self.__adjacency_state = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "DOWN": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:DOWN": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:DOWN": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "ATTEMPT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:ATTEMPT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:ATTEMPT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "INIT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:INIT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:INIT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "TWO_WAY": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:TWO_WAY": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:TWO_WAY": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "EXSTART": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:EXSTART": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:EXSTART": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "EXCHANGE": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:EXCHANGE": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:EXCHANGE": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "LOADING": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:LOADING": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:LOADING": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "FULL": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:FULL": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:FULL": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                },
            ),
            is_leaf=True,
            yang_name="adjacency-state",
            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="identityref",
            is_config=False,
        )
        self.__state_changes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="state-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="uint32",
            is_config=False,
        )
        self.__retranmission_queue_length = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="retranmission-queue-length",
            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",
                "ospfv2",
                "areas",
                "area",
                "virtual-links",
                "virtual-link",
                "state",
            ]

    def _get_remote_router_id(self):
        """
    Getter method for remote_router_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/remote_router_id (inet:ipv4-address-no-zone)

    YANG Description: The router ID of the device which terminates the remote end
of the virtual link
    """
        return self.__remote_router_id

    def _set_remote_router_id(self, v, load=False):
        """
    Setter method for remote_router_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/remote_router_id (inet:ipv4-address-no-zone)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_remote_router_id is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_remote_router_id() directly.

    YANG Description: The router ID of the device which terminates the remote end
of the virtual link
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=six.text_type,
                        restriction_dict={
                            "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?"
                        },
                    ),
                    restriction_dict={"pattern": "[0-9\\.]*"},
                ),
                is_leaf=True,
                yang_name="remote-router-id",
                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="inet:ipv4-address-no-zone",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """remote_router_id must be of a type compatible with inet:ipv4-address-no-zone""",
                    "defined-type": "inet:ipv4-address-no-zone",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}), restriction_dict={'pattern': '[0-9\\.]*'}), is_leaf=True, yang_name="remote-router-id", 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='inet:ipv4-address-no-zone', is_config=False)""",
                }
            )

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

    def _unset_remote_router_id(self):
        self.__remote_router_id = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?"
                    },
                ),
                restriction_dict={"pattern": "[0-9\\.]*"},
            ),
            is_leaf=True,
            yang_name="remote-router-id",
            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="inet:ipv4-address-no-zone",
            is_config=False,
        )

    def _get_priority(self):
        """
    Getter method for priority, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/priority (uint8)

    YANG Description: The remote system's priority to become the designated
router
    """
        return self.__priority

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

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

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

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

    def _get_dead_time(self):
        """
    Getter method for dead_time, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/dead_time (oc-types:timeticks64)

    YANG Description: The time at which this neighbor's adjacency will be
considered dead. This value is expressed as a number of
seconds since the Unix Epoch
    """
        return self.__dead_time

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

    YANG Description: The time at which this neighbor's adjacency will be
considered dead. This value is expressed as a number of
seconds since the Unix Epoch
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..18446744073709551615"]},
                    int_size=64,
                ),
                is_leaf=True,
                yang_name="dead-time",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-types:timeticks64",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """dead_time must be of a type compatible with oc-types:timeticks64""",
                    "defined-type": "oc-types:timeticks64",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range':  ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="dead-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-types:timeticks64', is_config=False)""",
                }
            )

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

    def _unset_dead_time(self):
        self.__dead_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="dead-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:timeticks64",
            is_config=False,
        )

    def _get_designated_router(self):
        """
    Getter method for designated_router, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/designated_router (yang:dotted-quad)

    YANG Description: The designated router for the adjacency. This device
advertises the Network LSA for broadcast and NBMA networks.
    """
        return self.__designated_router

    def _set_designated_router(self, v, load=False):
        """
    Setter method for designated_router, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/designated_router (yang:dotted-quad)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_designated_router is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_designated_router() directly.

    YANG Description: The designated router for the adjacency. This device
advertises the Network LSA for broadcast and NBMA networks.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
                    },
                ),
                is_leaf=True,
                yang_name="designated-router",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="yang:dotted-quad",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """designated_router must be of a type compatible with yang:dotted-quad""",
                    "defined-type": "yang:dotted-quad",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="designated-router", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='yang:dotted-quad', is_config=False)""",
                }
            )

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

    def _unset_designated_router(self):
        self.__designated_router = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
                },
            ),
            is_leaf=True,
            yang_name="designated-router",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="yang:dotted-quad",
            is_config=False,
        )

    def _get_backup_designated_router(self):
        """
    Getter method for backup_designated_router, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/backup_designated_router (yang:dotted-quad)

    YANG Description: The backup designated router for the adjacency.
    """
        return self.__backup_designated_router

    def _set_backup_designated_router(self, v, load=False):
        """
    Setter method for backup_designated_router, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/backup_designated_router (yang:dotted-quad)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_backup_designated_router is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_backup_designated_router() directly.

    YANG Description: The backup designated router for the adjacency.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
                    },
                ),
                is_leaf=True,
                yang_name="backup-designated-router",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="yang:dotted-quad",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """backup_designated_router must be of a type compatible with yang:dotted-quad""",
                    "defined-type": "yang:dotted-quad",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="backup-designated-router", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='yang:dotted-quad', is_config=False)""",
                }
            )

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

    def _unset_backup_designated_router(self):
        self.__backup_designated_router = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
                },
            ),
            is_leaf=True,
            yang_name="backup-designated-router",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="yang:dotted-quad",
            is_config=False,
        )

    def _get_optional_capabilities(self):
        """
    Getter method for optional_capabilities, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/optional_capabilities (yang:hex-string)

    YANG Description: The optional capabilities field received in the Hello
message from the neighbor
    """
        return self.__optional_capabilities

    def _set_optional_capabilities(self, v, load=False):
        """
    Setter method for optional_capabilities, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/optional_capabilities (yang:hex-string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_optional_capabilities is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_optional_capabilities() directly.

    YANG Description: The optional capabilities field received in the Hello
message from the neighbor
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={"pattern": "([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?"},
                ),
                is_leaf=True,
                yang_name="optional-capabilities",
                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:hex-string",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """optional_capabilities must be of a type compatible with yang:hex-string""",
                    "defined-type": "yang:hex-string",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="optional-capabilities", 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:hex-string', is_config=False)""",
                }
            )

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

    def _unset_optional_capabilities(self):
        self.__optional_capabilities = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={"pattern": "([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?"},
            ),
            is_leaf=True,
            yang_name="optional-capabilities",
            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:hex-string",
            is_config=False,
        )

    def _get_last_established_time(self):
        """
    Getter method for last_established_time, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/last_established_time (oc-types:timeticks64)

    YANG Description: The time at which the adjacency was last established with
the neighbor. That is to say the time at which the
adjacency last transitioned into the FULL state.

This value is expressed as the number of seconds, relative to
the Unix Epoch (Jan 1, 1970 00:00:00 UTC).
    """
        return self.__last_established_time

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

    YANG Description: The time at which the adjacency was last established with
the neighbor. That is to say the time at which the
adjacency last transitioned into the FULL state.

This value is expressed as the number of seconds, relative to
the Unix Epoch (Jan 1, 1970 00:00:00 UTC).
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..18446744073709551615"]},
                    int_size=64,
                ),
                is_leaf=True,
                yang_name="last-established-time",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-types:timeticks64",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """last_established_time must be of a type compatible with oc-types:timeticks64""",
                    "defined-type": "oc-types:timeticks64",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range':  ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-established-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-types:timeticks64', is_config=False)""",
                }
            )

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

    def _unset_last_established_time(self):
        self.__last_established_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="last-established-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:timeticks64",
            is_config=False,
        )

    def _get_adjacency_state(self):
        """
    Getter method for adjacency_state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/adjacency_state (identityref)

    YANG Description: The state of the adjacency with the neighbor.
    """
        return self.__adjacency_state

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

    YANG Description: The state of the adjacency with the neighbor.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "DOWN": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:DOWN": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:DOWN": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "ATTEMPT": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:ATTEMPT": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:ATTEMPT": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "INIT": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:INIT": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:INIT": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "TWO_WAY": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:TWO_WAY": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:TWO_WAY": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "EXSTART": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:EXSTART": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:EXSTART": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "EXCHANGE": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:EXCHANGE": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:EXCHANGE": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "LOADING": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:LOADING": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:LOADING": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "FULL": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:FULL": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:FULL": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                    },
                ),
                is_leaf=True,
                yang_name="adjacency-state",
                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="identityref",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """adjacency_state must be of a type compatible with identityref""",
                    "defined-type": "openconfig-network-instance:identityref",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'DOWN': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:DOWN': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:DOWN': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'ATTEMPT': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:ATTEMPT': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:ATTEMPT': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'INIT': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:INIT': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:INIT': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'TWO_WAY': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:TWO_WAY': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:TWO_WAY': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'EXSTART': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:EXSTART': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:EXSTART': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'EXCHANGE': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:EXCHANGE': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:EXCHANGE': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'LOADING': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:LOADING': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:LOADING': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'FULL': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:FULL': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:FULL': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}},), is_leaf=True, yang_name="adjacency-state", 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='identityref', is_config=False)""",
                }
            )

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

    def _unset_adjacency_state(self):
        self.__adjacency_state = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "DOWN": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:DOWN": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:DOWN": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "ATTEMPT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:ATTEMPT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:ATTEMPT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "INIT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:INIT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:INIT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "TWO_WAY": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:TWO_WAY": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:TWO_WAY": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "EXSTART": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:EXSTART": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:EXSTART": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "EXCHANGE": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:EXCHANGE": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:EXCHANGE": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "LOADING": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:LOADING": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:LOADING": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "FULL": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:FULL": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:FULL": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                },
            ),
            is_leaf=True,
            yang_name="adjacency-state",
            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="identityref",
            is_config=False,
        )

    def _get_state_changes(self):
        """
    Getter method for state_changes, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/state_changes (uint32)

    YANG Description: The number of transitions out of the FULL state that this
neighbor has been through
    """
        return self.__state_changes

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

    YANG Description: The number of transitions out of the FULL state that this
neighbor has been through
    """
        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="state-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="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """state_changes 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="state-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='uint32', is_config=False)""",
                }
            )

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

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

    def _get_retranmission_queue_length(self):
        """
    Getter method for retranmission_queue_length, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/retranmission_queue_length (uint32)

    YANG Description: The number of LSAs that are currently in the queue to be
retransmitted to the neighbor
    """
        return self.__retranmission_queue_length

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

    YANG Description: The number of LSAs that are currently in the queue to be
retransmitted to the neighbor
    """
        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="retranmission-queue-length",
                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": """retranmission_queue_length 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="retranmission-queue-length", 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.__retranmission_queue_length = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_retranmission_queue_length(self):
        self.__retranmission_queue_length = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="retranmission-queue-length",
            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,
        )

    remote_router_id = __builtin__.property(_get_remote_router_id)
    priority = __builtin__.property(_get_priority)
    dead_time = __builtin__.property(_get_dead_time)
    designated_router = __builtin__.property(_get_designated_router)
    backup_designated_router = __builtin__.property(_get_backup_designated_router)
    optional_capabilities = __builtin__.property(_get_optional_capabilities)
    last_established_time = __builtin__.property(_get_last_established_time)
    adjacency_state = __builtin__.property(_get_adjacency_state)
    state_changes = __builtin__.property(_get_state_changes)
    retranmission_queue_length = __builtin__.property(_get_retranmission_queue_length)

    _pyangbind_elements = OrderedDict(
        [
            ("remote_router_id", remote_router_id),
            ("priority", priority),
            ("dead_time", dead_time),
            ("designated_router", designated_router),
            ("backup_designated_router", backup_designated_router),
            ("optional_capabilities", optional_capabilities),
            ("last_established_time", last_established_time),
            ("adjacency_state", adjacency_state),
            ("state_changes", state_changes),
            ("retranmission_queue_length", retranmission_queue_length),
        ]
    )


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

  YANG Description: State parameters relating to the OSPF virtual link
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__remote_router_id",
        "__priority",
        "__dead_time",
        "__designated_router",
        "__backup_designated_router",
        "__optional_capabilities",
        "__last_established_time",
        "__adjacency_state",
        "__state_changes",
        "__retranmission_queue_length",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__remote_router_id = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?"
                    },
                ),
                restriction_dict={"pattern": "[0-9\\.]*"},
            ),
            is_leaf=True,
            yang_name="remote-router-id",
            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="inet:ipv4-address-no-zone",
            is_config=False,
        )
        self.__priority = YANGDynClass(
            base=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
            ),
            is_leaf=True,
            yang_name="priority",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=False,
        )
        self.__dead_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="dead-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:timeticks64",
            is_config=False,
        )
        self.__designated_router = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
                },
            ),
            is_leaf=True,
            yang_name="designated-router",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="yang:dotted-quad",
            is_config=False,
        )
        self.__backup_designated_router = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
                },
            ),
            is_leaf=True,
            yang_name="backup-designated-router",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="yang:dotted-quad",
            is_config=False,
        )
        self.__optional_capabilities = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={"pattern": "([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?"},
            ),
            is_leaf=True,
            yang_name="optional-capabilities",
            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:hex-string",
            is_config=False,
        )
        self.__last_established_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="last-established-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:timeticks64",
            is_config=False,
        )
        self.__adjacency_state = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "DOWN": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:DOWN": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:DOWN": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "ATTEMPT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:ATTEMPT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:ATTEMPT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "INIT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:INIT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:INIT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "TWO_WAY": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:TWO_WAY": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:TWO_WAY": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "EXSTART": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:EXSTART": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:EXSTART": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "EXCHANGE": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:EXCHANGE": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:EXCHANGE": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "LOADING": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:LOADING": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:LOADING": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "FULL": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:FULL": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:FULL": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                },
            ),
            is_leaf=True,
            yang_name="adjacency-state",
            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="identityref",
            is_config=False,
        )
        self.__state_changes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="state-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="uint32",
            is_config=False,
        )
        self.__retranmission_queue_length = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="retranmission-queue-length",
            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",
                "ospfv2",
                "areas",
                "area",
                "virtual-links",
                "virtual-link",
                "state",
            ]

    def _get_remote_router_id(self):
        """
    Getter method for remote_router_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/remote_router_id (inet:ipv4-address-no-zone)

    YANG Description: The router ID of the device which terminates the remote end
of the virtual link
    """
        return self.__remote_router_id

    def _set_remote_router_id(self, v, load=False):
        """
    Setter method for remote_router_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/remote_router_id (inet:ipv4-address-no-zone)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_remote_router_id is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_remote_router_id() directly.

    YANG Description: The router ID of the device which terminates the remote end
of the virtual link
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=six.text_type,
                        restriction_dict={
                            "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?"
                        },
                    ),
                    restriction_dict={"pattern": "[0-9\\.]*"},
                ),
                is_leaf=True,
                yang_name="remote-router-id",
                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="inet:ipv4-address-no-zone",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """remote_router_id must be of a type compatible with inet:ipv4-address-no-zone""",
                    "defined-type": "inet:ipv4-address-no-zone",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}), restriction_dict={'pattern': '[0-9\\.]*'}), is_leaf=True, yang_name="remote-router-id", 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='inet:ipv4-address-no-zone', is_config=False)""",
                }
            )

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

    def _unset_remote_router_id(self):
        self.__remote_router_id = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?"
                    },
                ),
                restriction_dict={"pattern": "[0-9\\.]*"},
            ),
            is_leaf=True,
            yang_name="remote-router-id",
            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="inet:ipv4-address-no-zone",
            is_config=False,
        )

    def _get_priority(self):
        """
    Getter method for priority, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/priority (uint8)

    YANG Description: The remote system's priority to become the designated
router
    """
        return self.__priority

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

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

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

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

    def _get_dead_time(self):
        """
    Getter method for dead_time, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/dead_time (oc-types:timeticks64)

    YANG Description: The time at which this neighbor's adjacency will be
considered dead. This value is expressed as a number of
seconds since the Unix Epoch
    """
        return self.__dead_time

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

    YANG Description: The time at which this neighbor's adjacency will be
considered dead. This value is expressed as a number of
seconds since the Unix Epoch
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..18446744073709551615"]},
                    int_size=64,
                ),
                is_leaf=True,
                yang_name="dead-time",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-types:timeticks64",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """dead_time must be of a type compatible with oc-types:timeticks64""",
                    "defined-type": "oc-types:timeticks64",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range':  ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="dead-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-types:timeticks64', is_config=False)""",
                }
            )

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

    def _unset_dead_time(self):
        self.__dead_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="dead-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:timeticks64",
            is_config=False,
        )

    def _get_designated_router(self):
        """
    Getter method for designated_router, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/designated_router (yang:dotted-quad)

    YANG Description: The designated router for the adjacency. This device
advertises the Network LSA for broadcast and NBMA networks.
    """
        return self.__designated_router

    def _set_designated_router(self, v, load=False):
        """
    Setter method for designated_router, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/designated_router (yang:dotted-quad)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_designated_router is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_designated_router() directly.

    YANG Description: The designated router for the adjacency. This device
advertises the Network LSA for broadcast and NBMA networks.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
                    },
                ),
                is_leaf=True,
                yang_name="designated-router",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="yang:dotted-quad",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """designated_router must be of a type compatible with yang:dotted-quad""",
                    "defined-type": "yang:dotted-quad",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="designated-router", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='yang:dotted-quad', is_config=False)""",
                }
            )

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

    def _unset_designated_router(self):
        self.__designated_router = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
                },
            ),
            is_leaf=True,
            yang_name="designated-router",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="yang:dotted-quad",
            is_config=False,
        )

    def _get_backup_designated_router(self):
        """
    Getter method for backup_designated_router, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/backup_designated_router (yang:dotted-quad)

    YANG Description: The backup designated router for the adjacency.
    """
        return self.__backup_designated_router

    def _set_backup_designated_router(self, v, load=False):
        """
    Setter method for backup_designated_router, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/backup_designated_router (yang:dotted-quad)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_backup_designated_router is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_backup_designated_router() directly.

    YANG Description: The backup designated router for the adjacency.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
                    },
                ),
                is_leaf=True,
                yang_name="backup-designated-router",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="yang:dotted-quad",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """backup_designated_router must be of a type compatible with yang:dotted-quad""",
                    "defined-type": "yang:dotted-quad",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="backup-designated-router", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='yang:dotted-quad', is_config=False)""",
                }
            )

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

    def _unset_backup_designated_router(self):
        self.__backup_designated_router = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
                },
            ),
            is_leaf=True,
            yang_name="backup-designated-router",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="yang:dotted-quad",
            is_config=False,
        )

    def _get_optional_capabilities(self):
        """
    Getter method for optional_capabilities, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/optional_capabilities (yang:hex-string)

    YANG Description: The optional capabilities field received in the Hello
message from the neighbor
    """
        return self.__optional_capabilities

    def _set_optional_capabilities(self, v, load=False):
        """
    Setter method for optional_capabilities, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/optional_capabilities (yang:hex-string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_optional_capabilities is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_optional_capabilities() directly.

    YANG Description: The optional capabilities field received in the Hello
message from the neighbor
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={"pattern": "([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?"},
                ),
                is_leaf=True,
                yang_name="optional-capabilities",
                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:hex-string",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """optional_capabilities must be of a type compatible with yang:hex-string""",
                    "defined-type": "yang:hex-string",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="optional-capabilities", 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:hex-string', is_config=False)""",
                }
            )

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

    def _unset_optional_capabilities(self):
        self.__optional_capabilities = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={"pattern": "([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?"},
            ),
            is_leaf=True,
            yang_name="optional-capabilities",
            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:hex-string",
            is_config=False,
        )

    def _get_last_established_time(self):
        """
    Getter method for last_established_time, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/last_established_time (oc-types:timeticks64)

    YANG Description: The time at which the adjacency was last established with
the neighbor. That is to say the time at which the
adjacency last transitioned into the FULL state.

This value is expressed as the number of seconds, relative to
the Unix Epoch (Jan 1, 1970 00:00:00 UTC).
    """
        return self.__last_established_time

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

    YANG Description: The time at which the adjacency was last established with
the neighbor. That is to say the time at which the
adjacency last transitioned into the FULL state.

This value is expressed as the number of seconds, relative to
the Unix Epoch (Jan 1, 1970 00:00:00 UTC).
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..18446744073709551615"]},
                    int_size=64,
                ),
                is_leaf=True,
                yang_name="last-established-time",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-types:timeticks64",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """last_established_time must be of a type compatible with oc-types:timeticks64""",
                    "defined-type": "oc-types:timeticks64",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range':  ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-established-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-types:timeticks64', is_config=False)""",
                }
            )

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

    def _unset_last_established_time(self):
        self.__last_established_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="last-established-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:timeticks64",
            is_config=False,
        )

    def _get_adjacency_state(self):
        """
    Getter method for adjacency_state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/adjacency_state (identityref)

    YANG Description: The state of the adjacency with the neighbor.
    """
        return self.__adjacency_state

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

    YANG Description: The state of the adjacency with the neighbor.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "DOWN": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:DOWN": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:DOWN": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "ATTEMPT": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:ATTEMPT": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:ATTEMPT": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "INIT": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:INIT": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:INIT": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "TWO_WAY": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:TWO_WAY": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:TWO_WAY": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "EXSTART": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:EXSTART": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:EXSTART": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "EXCHANGE": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:EXCHANGE": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:EXCHANGE": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "LOADING": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:LOADING": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:LOADING": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "FULL": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospf-types:FULL": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                        "oc-ospft:FULL": {
                            "@module": "openconfig-ospf-types",
                            "@namespace": "http://openconfig.net/yang/ospf-types",
                        },
                    },
                ),
                is_leaf=True,
                yang_name="adjacency-state",
                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="identityref",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """adjacency_state must be of a type compatible with identityref""",
                    "defined-type": "openconfig-network-instance:identityref",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'DOWN': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:DOWN': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:DOWN': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'ATTEMPT': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:ATTEMPT': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:ATTEMPT': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'INIT': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:INIT': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:INIT': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'TWO_WAY': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:TWO_WAY': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:TWO_WAY': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'EXSTART': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:EXSTART': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:EXSTART': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'EXCHANGE': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:EXCHANGE': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:EXCHANGE': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'LOADING': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:LOADING': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:LOADING': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'FULL': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospf-types:FULL': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}, 'oc-ospft:FULL': {'@module': 'openconfig-ospf-types', '@namespace': 'http://openconfig.net/yang/ospf-types'}},), is_leaf=True, yang_name="adjacency-state", 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='identityref', is_config=False)""",
                }
            )

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

    def _unset_adjacency_state(self):
        self.__adjacency_state = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "DOWN": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:DOWN": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:DOWN": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "ATTEMPT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:ATTEMPT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:ATTEMPT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "INIT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:INIT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:INIT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "TWO_WAY": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:TWO_WAY": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:TWO_WAY": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "EXSTART": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:EXSTART": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:EXSTART": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "EXCHANGE": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:EXCHANGE": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:EXCHANGE": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "LOADING": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:LOADING": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:LOADING": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "FULL": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:FULL": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:FULL": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                },
            ),
            is_leaf=True,
            yang_name="adjacency-state",
            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="identityref",
            is_config=False,
        )

    def _get_state_changes(self):
        """
    Getter method for state_changes, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/state_changes (uint32)

    YANG Description: The number of transitions out of the FULL state that this
neighbor has been through
    """
        return self.__state_changes

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

    YANG Description: The number of transitions out of the FULL state that this
neighbor has been through
    """
        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="state-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="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """state_changes 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="state-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='uint32', is_config=False)""",
                }
            )

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

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

    def _get_retranmission_queue_length(self):
        """
    Getter method for retranmission_queue_length, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/virtual_links/virtual_link/state/retranmission_queue_length (uint32)

    YANG Description: The number of LSAs that are currently in the queue to be
retransmitted to the neighbor
    """
        return self.__retranmission_queue_length

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

    YANG Description: The number of LSAs that are currently in the queue to be
retransmitted to the neighbor
    """
        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="retranmission-queue-length",
                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": """retranmission_queue_length 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="retranmission-queue-length", 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.__retranmission_queue_length = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_retranmission_queue_length(self):
        self.__retranmission_queue_length = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="retranmission-queue-length",
            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,
        )

    remote_router_id = __builtin__.property(_get_remote_router_id)
    priority = __builtin__.property(_get_priority)
    dead_time = __builtin__.property(_get_dead_time)
    designated_router = __builtin__.property(_get_designated_router)
    backup_designated_router = __builtin__.property(_get_backup_designated_router)
    optional_capabilities = __builtin__.property(_get_optional_capabilities)
    last_established_time = __builtin__.property(_get_last_established_time)
    adjacency_state = __builtin__.property(_get_adjacency_state)
    state_changes = __builtin__.property(_get_state_changes)
    retranmission_queue_length = __builtin__.property(_get_retranmission_queue_length)

    _pyangbind_elements = OrderedDict(
        [
            ("remote_router_id", remote_router_id),
            ("priority", priority),
            ("dead_time", dead_time),
            ("designated_router", designated_router),
            ("backup_designated_router", backup_designated_router),
            ("optional_capabilities", optional_capabilities),
            ("last_established_time", last_established_time),
            ("adjacency_state", adjacency_state),
            ("state_changes", state_changes),
            ("retranmission_queue_length", retranmission_queue_length),
        ]
    )
