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

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

    long = int
elif six.PY2:
    import __builtin__

from . import state
from . import router_lsa
from . import network_lsa
from . import summary_lsa
from . import as_external_lsa
from . import nssa_external_lsa
from . import opaque_lsa


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

  YANG Description: List of the LSAs of a specified type in the
LSDB for the specified area
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__link_state_id",
        "__state",
        "__router_lsa",
        "__network_lsa",
        "__summary_lsa",
        "__as_external_lsa",
        "__nssa_external_lsa",
        "__opaque_lsa",
    )

    _yang_name = "lsa"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__link_state_id = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="link-state-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=False,
        )
        self.__state = YANGDynClass(
            base=state.state,
            is_container="container",
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__router_lsa = YANGDynClass(
            base=router_lsa.router_lsa,
            is_container="container",
            yang_name="router-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__network_lsa = YANGDynClass(
            base=network_lsa.network_lsa,
            is_container="container",
            yang_name="network-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__summary_lsa = YANGDynClass(
            base=summary_lsa.summary_lsa,
            is_container="container",
            yang_name="summary-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__as_external_lsa = YANGDynClass(
            base=as_external_lsa.as_external_lsa,
            is_container="container",
            yang_name="as-external-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__nssa_external_lsa = YANGDynClass(
            base=nssa_external_lsa.nssa_external_lsa,
            is_container="container",
            yang_name="nssa-external-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__opaque_lsa = YANGDynClass(
            base=opaque_lsa.opaque_lsa,
            is_container="container",
            yang_name="opaque-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

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

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

    def _get_link_state_id(self):
        """
    Getter method for link_state_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/link_state_id (leafref)

    YANG Description: Reference to the Link State ID of the LSA
    """
        return self.__link_state_id

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

    YANG Description: Reference to the Link State ID of the LSA
    """
        parent = getattr(self, "_parent", None)
        if parent is not None and load is False:
            raise AttributeError(
                "Cannot set keys directly when" + " within an instantiated list"
            )

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

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

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

    def _get_state(self):
        """
    Getter method for state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/state (container)

    YANG Description: Operational state parameters relating to all
LSA types
    """
        return self.__state

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

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

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

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

    def _get_router_lsa(self):
        """
    Getter method for router_lsa, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/router_lsa (container)

    YANG Description: Contents of the router LSA
    """
        return self.__router_lsa

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

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

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

    def _unset_router_lsa(self):
        self.__router_lsa = YANGDynClass(
            base=router_lsa.router_lsa,
            is_container="container",
            yang_name="router-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

    def _get_network_lsa(self):
        """
    Getter method for network_lsa, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/network_lsa (container)

    YANG Description: Contents of the network LSA
    """
        return self.__network_lsa

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

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

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

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

    def _get_summary_lsa(self):
        """
    Getter method for summary_lsa, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/summary_lsa (container)

    YANG Description: Contents of the summary LSA
    """
        return self.__summary_lsa

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

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

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

    def _unset_summary_lsa(self):
        self.__summary_lsa = YANGDynClass(
            base=summary_lsa.summary_lsa,
            is_container="container",
            yang_name="summary-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

    def _get_as_external_lsa(self):
        """
    Getter method for as_external_lsa, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/as_external_lsa (container)

    YANG Description: Contents of the AS External LSA
    """
        return self.__as_external_lsa

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

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

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

    def _unset_as_external_lsa(self):
        self.__as_external_lsa = YANGDynClass(
            base=as_external_lsa.as_external_lsa,
            is_container="container",
            yang_name="as-external-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

    def _get_nssa_external_lsa(self):
        """
    Getter method for nssa_external_lsa, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/nssa_external_lsa (container)

    YANG Description: Contents of the NSSA External LSA
    """
        return self.__nssa_external_lsa

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

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

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

    def _unset_nssa_external_lsa(self):
        self.__nssa_external_lsa = YANGDynClass(
            base=nssa_external_lsa.nssa_external_lsa,
            is_container="container",
            yang_name="nssa-external-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

    def _get_opaque_lsa(self):
        """
    Getter method for opaque_lsa, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa (container)

    YANG Description: Contents of the opaque LSA
    """
        return self.__opaque_lsa

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

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

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

    def _unset_opaque_lsa(self):
        self.__opaque_lsa = YANGDynClass(
            base=opaque_lsa.opaque_lsa,
            is_container="container",
            yang_name="opaque-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

    link_state_id = __builtin__.property(_get_link_state_id)
    state = __builtin__.property(_get_state)
    router_lsa = __builtin__.property(_get_router_lsa)
    network_lsa = __builtin__.property(_get_network_lsa)
    summary_lsa = __builtin__.property(_get_summary_lsa)
    as_external_lsa = __builtin__.property(_get_as_external_lsa)
    nssa_external_lsa = __builtin__.property(_get_nssa_external_lsa)
    opaque_lsa = __builtin__.property(_get_opaque_lsa)

    _pyangbind_elements = OrderedDict(
        [
            ("link_state_id", link_state_id),
            ("state", state),
            ("router_lsa", router_lsa),
            ("network_lsa", network_lsa),
            ("summary_lsa", summary_lsa),
            ("as_external_lsa", as_external_lsa),
            ("nssa_external_lsa", nssa_external_lsa),
            ("opaque_lsa", opaque_lsa),
        ]
    )


from . import state
from . import router_lsa
from . import network_lsa
from . import summary_lsa
from . import as_external_lsa
from . import nssa_external_lsa
from . import opaque_lsa


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

  YANG Description: List of the LSAs of a specified type in the
LSDB for the specified area
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__link_state_id",
        "__state",
        "__router_lsa",
        "__network_lsa",
        "__summary_lsa",
        "__as_external_lsa",
        "__nssa_external_lsa",
        "__opaque_lsa",
    )

    _yang_name = "lsa"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__link_state_id = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="link-state-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=False,
        )
        self.__state = YANGDynClass(
            base=state.state,
            is_container="container",
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__router_lsa = YANGDynClass(
            base=router_lsa.router_lsa,
            is_container="container",
            yang_name="router-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__network_lsa = YANGDynClass(
            base=network_lsa.network_lsa,
            is_container="container",
            yang_name="network-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__summary_lsa = YANGDynClass(
            base=summary_lsa.summary_lsa,
            is_container="container",
            yang_name="summary-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__as_external_lsa = YANGDynClass(
            base=as_external_lsa.as_external_lsa,
            is_container="container",
            yang_name="as-external-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__nssa_external_lsa = YANGDynClass(
            base=nssa_external_lsa.nssa_external_lsa,
            is_container="container",
            yang_name="nssa-external-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__opaque_lsa = YANGDynClass(
            base=opaque_lsa.opaque_lsa,
            is_container="container",
            yang_name="opaque-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

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

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

    def _get_link_state_id(self):
        """
    Getter method for link_state_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/link_state_id (leafref)

    YANG Description: Reference to the Link State ID of the LSA
    """
        return self.__link_state_id

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

    YANG Description: Reference to the Link State ID of the LSA
    """
        parent = getattr(self, "_parent", None)
        if parent is not None and load is False:
            raise AttributeError(
                "Cannot set keys directly when" + " within an instantiated list"
            )

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

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

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

    def _get_state(self):
        """
    Getter method for state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/state (container)

    YANG Description: Operational state parameters relating to all
LSA types
    """
        return self.__state

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

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

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

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

    def _get_router_lsa(self):
        """
    Getter method for router_lsa, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/router_lsa (container)

    YANG Description: Contents of the router LSA
    """
        return self.__router_lsa

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

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

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

    def _unset_router_lsa(self):
        self.__router_lsa = YANGDynClass(
            base=router_lsa.router_lsa,
            is_container="container",
            yang_name="router-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

    def _get_network_lsa(self):
        """
    Getter method for network_lsa, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/network_lsa (container)

    YANG Description: Contents of the network LSA
    """
        return self.__network_lsa

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

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

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

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

    def _get_summary_lsa(self):
        """
    Getter method for summary_lsa, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/summary_lsa (container)

    YANG Description: Contents of the summary LSA
    """
        return self.__summary_lsa

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

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

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

    def _unset_summary_lsa(self):
        self.__summary_lsa = YANGDynClass(
            base=summary_lsa.summary_lsa,
            is_container="container",
            yang_name="summary-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

    def _get_as_external_lsa(self):
        """
    Getter method for as_external_lsa, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/as_external_lsa (container)

    YANG Description: Contents of the AS External LSA
    """
        return self.__as_external_lsa

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

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

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

    def _unset_as_external_lsa(self):
        self.__as_external_lsa = YANGDynClass(
            base=as_external_lsa.as_external_lsa,
            is_container="container",
            yang_name="as-external-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

    def _get_nssa_external_lsa(self):
        """
    Getter method for nssa_external_lsa, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/nssa_external_lsa (container)

    YANG Description: Contents of the NSSA External LSA
    """
        return self.__nssa_external_lsa

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

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

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

    def _unset_nssa_external_lsa(self):
        self.__nssa_external_lsa = YANGDynClass(
            base=nssa_external_lsa.nssa_external_lsa,
            is_container="container",
            yang_name="nssa-external-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

    def _get_opaque_lsa(self):
        """
    Getter method for opaque_lsa, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa (container)

    YANG Description: Contents of the opaque LSA
    """
        return self.__opaque_lsa

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

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

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

    def _unset_opaque_lsa(self):
        self.__opaque_lsa = YANGDynClass(
            base=opaque_lsa.opaque_lsa,
            is_container="container",
            yang_name="opaque-lsa",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

    link_state_id = __builtin__.property(_get_link_state_id)
    state = __builtin__.property(_get_state)
    router_lsa = __builtin__.property(_get_router_lsa)
    network_lsa = __builtin__.property(_get_network_lsa)
    summary_lsa = __builtin__.property(_get_summary_lsa)
    as_external_lsa = __builtin__.property(_get_as_external_lsa)
    nssa_external_lsa = __builtin__.property(_get_nssa_external_lsa)
    opaque_lsa = __builtin__.property(_get_opaque_lsa)

    _pyangbind_elements = OrderedDict(
        [
            ("link_state_id", link_state_id),
            ("state", state),
            ("router_lsa", router_lsa),
            ("network_lsa", network_lsa),
            ("summary_lsa", summary_lsa),
            ("as_external_lsa", as_external_lsa),
            ("nssa_external_lsa", nssa_external_lsa),
            ("opaque_lsa", opaque_lsa),
        ]
    )
