# -*- 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 tag
from . import tag64
from . import flags
from . import ipv4_source_router_id
from . import ipv6_source_router_id
from . import prefix_sid


class subTLVs(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/isis/levels/level/link-state-database/lsp/tlvs/tlv/mt-ipv6-reachability/prefixes/prefix/subTLVs/subTLVs. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: List of subTLV types in the LSDB for the specified TLV.
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__subtlv_type",
        "__state",
        "__tag",
        "__tag64",
        "__flags",
        "__ipv4_source_router_id",
        "__ipv6_source_router_id",
        "__prefix_sid",
    )

    _yang_name = "subTLVs"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__subtlv_type = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="subtlv-type",
            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.__tag = YANGDynClass(
            base=tag.tag,
            is_container="container",
            yang_name="tag",
            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.__tag64 = YANGDynClass(
            base=tag64.tag64,
            is_container="container",
            yang_name="tag64",
            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.__flags = YANGDynClass(
            base=flags.flags,
            is_container="container",
            yang_name="flags",
            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.__ipv4_source_router_id = YANGDynClass(
            base=ipv4_source_router_id.ipv4_source_router_id,
            is_container="container",
            yang_name="ipv4-source-router-id",
            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.__ipv6_source_router_id = YANGDynClass(
            base=ipv6_source_router_id.ipv6_source_router_id,
            is_container="container",
            yang_name="ipv6-source-router-id",
            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.__prefix_sid = YANGDynClass(
            base=prefix_sid.prefix_sid,
            is_container="container",
            yang_name="prefix-sid",
            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",
                "isis",
                "levels",
                "level",
                "link-state-database",
                "lsp",
                "tlvs",
                "tlv",
                "mt-ipv6-reachability",
                "prefixes",
                "prefix",
                "subTLVs",
                "subTLVs",
            ]

    def _get_subtlv_type(self):
        """
    Getter method for subtlv_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/subtlv_type (leafref)

    YANG Description: A reference for the TLV type being described within
the LSDB
    """
        return self.__subtlv_type

    def _set_subtlv_type(self, v, load=False):
        """
    Setter method for subtlv_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/subtlv_type (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_subtlv_type is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_subtlv_type() directly.

    YANG Description: A reference for the TLV type being described within
the LSDB
    """
        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="subtlv-type",
                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": """subtlv_type must be of a type compatible with leafref""",
                    "defined-type": "leafref",
                    "generated-type": """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subtlv-type", 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.__subtlv_type = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_subtlv_type(self):
        self.__subtlv_type = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="subtlv-type",
            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/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/state (container)

    YANG Description: State parameters for a prefix.
    """
        return self.__state

    def _set_state(self, v, load=False):
        """
    Setter method for state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/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: State parameters for a prefix.
    """
        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_tag(self):
        """
    Getter method for tag, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/tag (container)

    YANG Description: This container defines sub-TLV 1.
    """
        return self.__tag

    def _set_tag(self, v, load=False):
        """
    Setter method for tag, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/tag (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tag is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tag() directly.

    YANG Description: This container defines sub-TLV 1.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=tag.tag,
                is_container="container",
                yang_name="tag",
                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": """tag must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=tag.tag, is_container='container', yang_name="tag", 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.__tag = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_tag(self):
        self.__tag = YANGDynClass(
            base=tag.tag,
            is_container="container",
            yang_name="tag",
            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_tag64(self):
        """
    Getter method for tag64, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/tag64 (container)

    YANG Description: This container defines sub-TLV 2.
    """
        return self.__tag64

    def _set_tag64(self, v, load=False):
        """
    Setter method for tag64, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/tag64 (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tag64 is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tag64() directly.

    YANG Description: This container defines sub-TLV 2.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=tag64.tag64,
                is_container="container",
                yang_name="tag64",
                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": """tag64 must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=tag64.tag64, is_container='container', yang_name="tag64", 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.__tag64 = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_tag64(self):
        self.__tag64 = YANGDynClass(
            base=tag64.tag64,
            is_container="container",
            yang_name="tag64",
            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_flags(self):
        """
    Getter method for flags, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/flags (container)

    YANG Description: This container defines sub-TLV 4.
    """
        return self.__flags

    def _set_flags(self, v, load=False):
        """
    Setter method for flags, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/flags (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_flags is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_flags() directly.

    YANG Description: This container defines sub-TLV 4.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=flags.flags,
                is_container="container",
                yang_name="flags",
                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": """flags must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=flags.flags, is_container='container', yang_name="flags", 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.__flags = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_flags(self):
        self.__flags = YANGDynClass(
            base=flags.flags,
            is_container="container",
            yang_name="flags",
            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_ipv4_source_router_id(self):
        """
    Getter method for ipv4_source_router_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/ipv4_source_router_id (container)

    YANG Description: This container defines sub-TLV 11.
    """
        return self.__ipv4_source_router_id

    def _set_ipv4_source_router_id(self, v, load=False):
        """
    Setter method for ipv4_source_router_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/ipv4_source_router_id (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ipv4_source_router_id is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ipv4_source_router_id() directly.

    YANG Description: This container defines sub-TLV 11.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=ipv4_source_router_id.ipv4_source_router_id,
                is_container="container",
                yang_name="ipv4-source-router-id",
                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": """ipv4_source_router_id must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=ipv4_source_router_id.ipv4_source_router_id, is_container='container', yang_name="ipv4-source-router-id", 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.__ipv4_source_router_id = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_ipv4_source_router_id(self):
        self.__ipv4_source_router_id = YANGDynClass(
            base=ipv4_source_router_id.ipv4_source_router_id,
            is_container="container",
            yang_name="ipv4-source-router-id",
            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_ipv6_source_router_id(self):
        """
    Getter method for ipv6_source_router_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/ipv6_source_router_id (container)

    YANG Description: This container defines sub-TLV 12.
    """
        return self.__ipv6_source_router_id

    def _set_ipv6_source_router_id(self, v, load=False):
        """
    Setter method for ipv6_source_router_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/ipv6_source_router_id (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ipv6_source_router_id is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ipv6_source_router_id() directly.

    YANG Description: This container defines sub-TLV 12.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=ipv6_source_router_id.ipv6_source_router_id,
                is_container="container",
                yang_name="ipv6-source-router-id",
                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": """ipv6_source_router_id must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=ipv6_source_router_id.ipv6_source_router_id, is_container='container', yang_name="ipv6-source-router-id", 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.__ipv6_source_router_id = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_ipv6_source_router_id(self):
        self.__ipv6_source_router_id = YANGDynClass(
            base=ipv6_source_router_id.ipv6_source_router_id,
            is_container="container",
            yang_name="ipv6-source-router-id",
            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_prefix_sid(self):
        """
    Getter method for prefix_sid, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/prefix_sid (container)

    YANG Description: This container defines segment routing extensions for prefixes.
    """
        return self.__prefix_sid

    def _set_prefix_sid(self, v, load=False):
        """
    Setter method for prefix_sid, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/prefix_sid (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_prefix_sid is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_prefix_sid() directly.

    YANG Description: This container defines segment routing extensions for prefixes.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=prefix_sid.prefix_sid,
                is_container="container",
                yang_name="prefix-sid",
                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": """prefix_sid must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=prefix_sid.prefix_sid, is_container='container', yang_name="prefix-sid", 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.__prefix_sid = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_prefix_sid(self):
        self.__prefix_sid = YANGDynClass(
            base=prefix_sid.prefix_sid,
            is_container="container",
            yang_name="prefix-sid",
            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,
        )

    subtlv_type = __builtin__.property(_get_subtlv_type)
    state = __builtin__.property(_get_state)
    tag = __builtin__.property(_get_tag)
    tag64 = __builtin__.property(_get_tag64)
    flags = __builtin__.property(_get_flags)
    ipv4_source_router_id = __builtin__.property(_get_ipv4_source_router_id)
    ipv6_source_router_id = __builtin__.property(_get_ipv6_source_router_id)
    prefix_sid = __builtin__.property(_get_prefix_sid)

    _pyangbind_elements = OrderedDict(
        [
            ("subtlv_type", subtlv_type),
            ("state", state),
            ("tag", tag),
            ("tag64", tag64),
            ("flags", flags),
            ("ipv4_source_router_id", ipv4_source_router_id),
            ("ipv6_source_router_id", ipv6_source_router_id),
            ("prefix_sid", prefix_sid),
        ]
    )


from . import state
from . import tag
from . import tag64
from . import flags
from . import ipv4_source_router_id
from . import ipv6_source_router_id
from . import prefix_sid


class subTLVs(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/isis/levels/level/link-state-database/lsp/tlvs/tlv/mt-ipv6-reachability/prefixes/prefix/subTLVs/subTLVs. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: List of subTLV types in the LSDB for the specified TLV.
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__subtlv_type",
        "__state",
        "__tag",
        "__tag64",
        "__flags",
        "__ipv4_source_router_id",
        "__ipv6_source_router_id",
        "__prefix_sid",
    )

    _yang_name = "subTLVs"

    _pybind_generated_by = "container"

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

        self._path_helper = False

        self._extmethods = False
        self.__subtlv_type = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="subtlv-type",
            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.__tag = YANGDynClass(
            base=tag.tag,
            is_container="container",
            yang_name="tag",
            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.__tag64 = YANGDynClass(
            base=tag64.tag64,
            is_container="container",
            yang_name="tag64",
            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.__flags = YANGDynClass(
            base=flags.flags,
            is_container="container",
            yang_name="flags",
            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.__ipv4_source_router_id = YANGDynClass(
            base=ipv4_source_router_id.ipv4_source_router_id,
            is_container="container",
            yang_name="ipv4-source-router-id",
            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.__ipv6_source_router_id = YANGDynClass(
            base=ipv6_source_router_id.ipv6_source_router_id,
            is_container="container",
            yang_name="ipv6-source-router-id",
            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.__prefix_sid = YANGDynClass(
            base=prefix_sid.prefix_sid,
            is_container="container",
            yang_name="prefix-sid",
            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",
                "isis",
                "levels",
                "level",
                "link-state-database",
                "lsp",
                "tlvs",
                "tlv",
                "mt-ipv6-reachability",
                "prefixes",
                "prefix",
                "subTLVs",
                "subTLVs",
            ]

    def _get_subtlv_type(self):
        """
    Getter method for subtlv_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/subtlv_type (leafref)

    YANG Description: A reference for the TLV type being described within
the LSDB
    """
        return self.__subtlv_type

    def _set_subtlv_type(self, v, load=False):
        """
    Setter method for subtlv_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/subtlv_type (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_subtlv_type is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_subtlv_type() directly.

    YANG Description: A reference for the TLV type being described within
the LSDB
    """
        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="subtlv-type",
                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": """subtlv_type must be of a type compatible with leafref""",
                    "defined-type": "leafref",
                    "generated-type": """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subtlv-type", 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.__subtlv_type = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_subtlv_type(self):
        self.__subtlv_type = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="subtlv-type",
            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/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/state (container)

    YANG Description: State parameters for a prefix.
    """
        return self.__state

    def _set_state(self, v, load=False):
        """
    Setter method for state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/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: State parameters for a prefix.
    """
        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_tag(self):
        """
    Getter method for tag, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/tag (container)

    YANG Description: This container defines sub-TLV 1.
    """
        return self.__tag

    def _set_tag(self, v, load=False):
        """
    Setter method for tag, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/tag (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tag is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tag() directly.

    YANG Description: This container defines sub-TLV 1.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=tag.tag,
                is_container="container",
                yang_name="tag",
                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": """tag must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=tag.tag, is_container='container', yang_name="tag", 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.__tag = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_tag(self):
        self.__tag = YANGDynClass(
            base=tag.tag,
            is_container="container",
            yang_name="tag",
            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_tag64(self):
        """
    Getter method for tag64, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/tag64 (container)

    YANG Description: This container defines sub-TLV 2.
    """
        return self.__tag64

    def _set_tag64(self, v, load=False):
        """
    Setter method for tag64, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/tag64 (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tag64 is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tag64() directly.

    YANG Description: This container defines sub-TLV 2.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=tag64.tag64,
                is_container="container",
                yang_name="tag64",
                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": """tag64 must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=tag64.tag64, is_container='container', yang_name="tag64", 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.__tag64 = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_tag64(self):
        self.__tag64 = YANGDynClass(
            base=tag64.tag64,
            is_container="container",
            yang_name="tag64",
            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_flags(self):
        """
    Getter method for flags, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/flags (container)

    YANG Description: This container defines sub-TLV 4.
    """
        return self.__flags

    def _set_flags(self, v, load=False):
        """
    Setter method for flags, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/flags (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_flags is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_flags() directly.

    YANG Description: This container defines sub-TLV 4.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=flags.flags,
                is_container="container",
                yang_name="flags",
                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": """flags must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=flags.flags, is_container='container', yang_name="flags", 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.__flags = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_flags(self):
        self.__flags = YANGDynClass(
            base=flags.flags,
            is_container="container",
            yang_name="flags",
            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_ipv4_source_router_id(self):
        """
    Getter method for ipv4_source_router_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/ipv4_source_router_id (container)

    YANG Description: This container defines sub-TLV 11.
    """
        return self.__ipv4_source_router_id

    def _set_ipv4_source_router_id(self, v, load=False):
        """
    Setter method for ipv4_source_router_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/ipv4_source_router_id (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ipv4_source_router_id is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ipv4_source_router_id() directly.

    YANG Description: This container defines sub-TLV 11.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=ipv4_source_router_id.ipv4_source_router_id,
                is_container="container",
                yang_name="ipv4-source-router-id",
                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": """ipv4_source_router_id must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=ipv4_source_router_id.ipv4_source_router_id, is_container='container', yang_name="ipv4-source-router-id", 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.__ipv4_source_router_id = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_ipv4_source_router_id(self):
        self.__ipv4_source_router_id = YANGDynClass(
            base=ipv4_source_router_id.ipv4_source_router_id,
            is_container="container",
            yang_name="ipv4-source-router-id",
            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_ipv6_source_router_id(self):
        """
    Getter method for ipv6_source_router_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/ipv6_source_router_id (container)

    YANG Description: This container defines sub-TLV 12.
    """
        return self.__ipv6_source_router_id

    def _set_ipv6_source_router_id(self, v, load=False):
        """
    Setter method for ipv6_source_router_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/ipv6_source_router_id (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ipv6_source_router_id is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ipv6_source_router_id() directly.

    YANG Description: This container defines sub-TLV 12.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=ipv6_source_router_id.ipv6_source_router_id,
                is_container="container",
                yang_name="ipv6-source-router-id",
                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": """ipv6_source_router_id must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=ipv6_source_router_id.ipv6_source_router_id, is_container='container', yang_name="ipv6-source-router-id", 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.__ipv6_source_router_id = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_ipv6_source_router_id(self):
        self.__ipv6_source_router_id = YANGDynClass(
            base=ipv6_source_router_id.ipv6_source_router_id,
            is_container="container",
            yang_name="ipv6-source-router-id",
            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_prefix_sid(self):
        """
    Getter method for prefix_sid, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/prefix_sid (container)

    YANG Description: This container defines segment routing extensions for prefixes.
    """
        return self.__prefix_sid

    def _set_prefix_sid(self, v, load=False):
        """
    Setter method for prefix_sid, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv6_reachability/prefixes/prefix/subTLVs/subTLVs/prefix_sid (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_prefix_sid is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_prefix_sid() directly.

    YANG Description: This container defines segment routing extensions for prefixes.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=prefix_sid.prefix_sid,
                is_container="container",
                yang_name="prefix-sid",
                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": """prefix_sid must be of a type compatible with container""",
                    "defined-type": "container",
                    "generated-type": """YANGDynClass(base=prefix_sid.prefix_sid, is_container='container', yang_name="prefix-sid", 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.__prefix_sid = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_prefix_sid(self):
        self.__prefix_sid = YANGDynClass(
            base=prefix_sid.prefix_sid,
            is_container="container",
            yang_name="prefix-sid",
            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,
        )

    subtlv_type = __builtin__.property(_get_subtlv_type)
    state = __builtin__.property(_get_state)
    tag = __builtin__.property(_get_tag)
    tag64 = __builtin__.property(_get_tag64)
    flags = __builtin__.property(_get_flags)
    ipv4_source_router_id = __builtin__.property(_get_ipv4_source_router_id)
    ipv6_source_router_id = __builtin__.property(_get_ipv6_source_router_id)
    prefix_sid = __builtin__.property(_get_prefix_sid)

    _pyangbind_elements = OrderedDict(
        [
            ("subtlv_type", subtlv_type),
            ("state", state),
            ("tag", tag),
            ("tag64", tag64),
            ("flags", flags),
            ("ipv4_source_router_id", ipv4_source_router_id),
            ("ipv6_source_router_id", ipv6_source_router_id),
            ("prefix_sid", prefix_sid),
        ]
    )
