# Path: puresnmp/typevars.py
# class SocketInfo:
# class SocketResponse:


from typing import Any, Iterator, Union
from x690.types import ObjectIdentifier, Type  # type: ignore
from puresnmp.typevars import PyType
    16: "(authorizationError)",
    17: "(notWritable)",
    18: "(inconsistentName)",
}


class VarBind:
    """
    A "VarBind" is a 2-tuple containing an object-identifier and the
    corresponding value.
    """

    # TODO: This class should be split in two for both the raw and pythonic
    #       API, that would simplify the typing of both "oid" and "value"a lot
    #       and keep things explicit
    oid: ObjectIdentifier = ObjectIdentifier(0)
    value: Union[PyType, Type, None] = None

    def __init__(self, oid, value):
        # type: (Union[ObjectIdentifier, str], PyType) -> None
        if not isinstance(oid, (ObjectIdentifier, str)):
            raise TypeError(
                "OIDs for VarBinds must be ObjectIdentifier or str"
                " instances! Your value: %r" % oid
            )
        if isinstance(oid, str):
            oid = ObjectIdentifier.from_string(oid)
        self.oid = oid
        self.value = value


# Path: puresnmp/typevars.py
# class SocketInfo:
# class SocketResponse:


# Path: puresnmp/snmp.py
from typing import Any, Iterator, Union
from x690.types import ObjectIdentifier, Type  # type: ignore
from puresnmp.typevars import PyType

    16: "(authorizationError)",
    17: "(notWritable)",
    18: "(inconsistentName)",
}


class VarBind:
    """
    A "VarBind" is a 2-tuple containing an object-identifier and the
    corresponding value.
    """

    # TODO: This class should be split in two for both the raw and pythonic
    #       API, that would simplify the typing of both "oid" and "value"a lot
    #       and keep things explicit
    oid: ObjectIdentifier = ObjectIdentifier(0)
    value: Union[PyType, Type, None] = None

    def __init__(self, oid, value):
        # type: (Union[ObjectIdentifier, str], PyType) -> None
        if not isinstance(oid, (ObjectIdentifier, str)):
            raise TypeError(
                "OIDs for VarBinds must be ObjectIdentifier or str"
                " instances! Your value: %r" % oid
            )
        if isinstance(oid, str):
            oid = ObjectIdentifier.from_string(oid)
        self.oid = oid
        self.value = value


    def __iter__(self) -> Iterator[Union[ObjectIdentifier, PyType]]: