# Auto-generated by `python -m gen` — do not edit manually.

from typing import TYPE_CHECKING, Generic, Literal

import bpy

from ...builder import BaseNode, SocketAccessor

from ...types import (
    InputBoolean,
    InputColor,
    InputFloat,
    InputFont,
    InputInteger,
    InputIntegerVector,
    InputMatrix,
    InputMenu,
    InputObject,
    InputRotation,
    InputString,
    InputVector,
    InputAny,
)

from ...builder.socket import (
    BooleanSocket,
    ColorSocket,
    FloatSocket,
    FontSocket,
    IntegerSocket,
    MatrixSocket,
    MenuSocket,
    ObjectSocket,
    RotationSocket,
    StringSocket,
    VectorSocket,
    _T,
    _S,
)


class EnableOutput(BaseNode, Generic[_T]):
    """
    Either pass through the input value or output the fallback value

    Parameters
    ----------
    enable : InputBoolean
        Enable
    value : InputFloat
        Value

    Inputs
    ------
    i.enable : BooleanSocket
        Enable
    i.value : FloatSocket
        Value

    Outputs
    -------
    o.value : FloatSocket
        Value
    """

    _bl_idname = "NodeEnableOutput"
    node: bpy.types.NodeEnableOutput

    class _Inputs(SocketAccessor, Generic[_S]):
        enable: BooleanSocket
        """Enable"""
        value: _S
        """Value"""

    class _Outputs(SocketAccessor, Generic[_S]):
        value: _S
        """Value"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs[_T]: ...
        @property
        def o(self) -> _Outputs[_T]: ...

    def __init__(
        self,
        enable: InputBoolean = False,
        value: InputAny = 0.0,
        *,
        data_type: Literal[
            "FLOAT",
            "INT",
            "BOOLEAN",
            "VECTOR",
            "RGBA",
            "ROTATION",
            "MATRIX",
            "STRING",
            "MENU",
            "OBJECT",
            "FONT",
            "INT_VECTOR",
        ] = "FLOAT",
    ):
        super().__init__()
        key_args = {"Enable": enable, "Value": value}
        self.data_type = data_type
        self._establish_links(**key_args)

    @classmethod
    def float(
        cls, enable: InputBoolean = False, value: InputFloat = 0.0
    ) -> "EnableOutput[FloatSocket]":
        """Create Enable Output with operation 'Float'."""
        return EnableOutput(data_type="FLOAT", enable=enable, value=value)

    @classmethod
    def integer(
        cls, enable: InputBoolean = False, value: InputInteger = 0
    ) -> "EnableOutput[IntegerSocket]":
        """Create Enable Output with operation 'Integer'."""
        return EnableOutput(data_type="INT", enable=enable, value=value)

    @classmethod
    def boolean(
        cls, enable: InputBoolean = False, value: InputBoolean = False
    ) -> "EnableOutput[BooleanSocket]":
        """Create Enable Output with operation 'Boolean'."""
        return EnableOutput(data_type="BOOLEAN", enable=enable, value=value)

    @classmethod
    def vector(
        cls, enable: InputBoolean = False, value: InputVector = None
    ) -> "EnableOutput[VectorSocket]":
        """Create Enable Output with operation 'Vector'."""
        return EnableOutput(data_type="VECTOR", enable=enable, value=value)

    @classmethod
    def color(
        cls, enable: InputBoolean = False, value: InputColor = None
    ) -> "EnableOutput[ColorSocket]":
        """Create Enable Output with operation 'Color'."""
        return EnableOutput(data_type="RGBA", enable=enable, value=value)

    @classmethod
    def rotation(
        cls, enable: InputBoolean = False, value: InputRotation = None
    ) -> "EnableOutput[RotationSocket]":
        """Create Enable Output with operation 'Rotation'."""
        return EnableOutput(data_type="ROTATION", enable=enable, value=value)

    @classmethod
    def matrix(
        cls, enable: InputBoolean = False, value: InputMatrix = None
    ) -> "EnableOutput[MatrixSocket]":
        """Create Enable Output with operation 'Matrix'."""
        return EnableOutput(data_type="MATRIX", enable=enable, value=value)

    @classmethod
    def string(
        cls, enable: InputBoolean = False, value: InputString = ""
    ) -> "EnableOutput[StringSocket]":
        """Create Enable Output with operation 'String'."""
        return EnableOutput(data_type="STRING", enable=enable, value=value)

    @classmethod
    def menu(
        cls, enable: InputBoolean = False, value: InputMenu = None
    ) -> "EnableOutput[MenuSocket]":
        """Create Enable Output with operation 'Menu'."""
        return EnableOutput(data_type="MENU", enable=enable, value=value)

    @classmethod
    def object(
        cls, enable: InputBoolean = False, value: InputObject = None
    ) -> "EnableOutput[ObjectSocket]":
        """Create Enable Output with operation 'Object'."""
        return EnableOutput(data_type="OBJECT", enable=enable, value=value)

    @classmethod
    def font(
        cls, enable: InputBoolean = False, value: InputFont = None
    ) -> "EnableOutput[FontSocket]":
        """Create Enable Output with operation 'Font'."""
        return EnableOutput(data_type="FONT", enable=enable, value=value)

    @classmethod
    def integer_vector(
        cls, enable: InputBoolean = False, value: InputIntegerVector = None
    ) -> "EnableOutput[IntegerSocket]":
        """Create Enable Output with operation 'Integer Vector'."""
        return EnableOutput(data_type="INT_VECTOR", enable=enable, value=value)

    @property
    def data_type(
        self,
    ) -> Literal[
        "FLOAT",
        "INT",
        "BOOLEAN",
        "VECTOR",
        "RGBA",
        "ROTATION",
        "MATRIX",
        "STRING",
        "MENU",
        "OBJECT",
        "FONT",
        "INT_VECTOR",
    ]:
        return self.node.data_type  # ty: ignore[invalid-return-type]

    @data_type.setter
    def data_type(
        self,
        value: Literal[
            "FLOAT",
            "INT",
            "BOOLEAN",
            "VECTOR",
            "RGBA",
            "ROTATION",
            "MATRIX",
            "STRING",
            "MENU",
            "OBJECT",
            "FONT",
            "INT_VECTOR",
        ],
    ):
        self.node.data_type = value
