# 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,
    InputBundle,
    InputClosure,
    InputCollection,
    InputColor,
    InputFloat,
    InputFont,
    InputGeometry,
    InputImage,
    InputInteger,
    InputMaterial,
    InputMatrix,
    InputMenu,
    InputObject,
    InputRotation,
    InputSound,
    InputString,
    InputVector,
    InputAny,
)

from ...builder.socket import (
    BooleanSocket,
    BundleSocket,
    ClosureSocket,
    CollectionSocket,
    ColorSocket,
    FloatSocket,
    FontSocket,
    GeometrySocket,
    ImageSocket,
    IntegerSocket,
    MaterialSocket,
    MatrixSocket,
    MenuSocket,
    ObjectSocket,
    RotationSocket,
    SoundSocket,
    StringSocket,
    VectorSocket,
    _T,
    _S,
)


class DialGizmo(BaseNode):
    """
    Show a dial gizmo in the viewport for a value

    Parameters
    ----------
    value : InputFloat
        Value
    position : InputVector
        Position
    up : InputVector
        Up
    screen_space : InputBoolean
        Screen Space
    radius : InputFloat
        Radius

    Inputs
    ------
    i.value : FloatSocket
        Value
    i.position : VectorSocket
        Position
    i.up : VectorSocket
        Up
    i.screen_space : BooleanSocket
        Screen Space
    i.radius : FloatSocket
        Radius

    Outputs
    -------
    o.transform : GeometrySocket
        Transform
    """

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

    class _Inputs(SocketAccessor):
        value: FloatSocket
        """Value"""
        position: VectorSocket
        """Position"""
        up: VectorSocket
        """Up"""
        screen_space: BooleanSocket
        """Screen Space"""
        radius: FloatSocket
        """Radius"""

    class _Outputs(SocketAccessor):
        transform: GeometrySocket
        """Transform"""

    if TYPE_CHECKING:

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

    def __init__(
        self,
        value: InputFloat = 0.0,
        position: InputVector = None,
        up: InputVector = None,
        screen_space: InputBoolean = True,
        radius: InputFloat = 1.0,
        *,
        color_id: Literal["PRIMARY", "SECONDARY", "X", "Y", "Z"] = "PRIMARY",
    ):
        super().__init__()
        key_args = {
            "Value": value,
            "Position": position,
            "Up": up,
            "Screen Space": screen_space,
            "Radius": radius,
        }
        self.color_id = color_id
        self._establish_links(**key_args)

    @property
    def color_id(self) -> Literal["PRIMARY", "SECONDARY", "X", "Y", "Z"]:
        return self.node.color_id

    @color_id.setter
    def color_id(self, value: Literal["PRIMARY", "SECONDARY", "X", "Y", "Z"]):
        self.node.color_id = value


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",
            "IMAGE",
            "GEOMETRY",
            "COLLECTION",
            "MATERIAL",
            "BUNDLE",
            "CLOSURE",
            "FONT",
            "SOUND",
        ] = "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 image(
        cls, enable: InputBoolean = False, value: InputImage = None
    ) -> "EnableOutput[ImageSocket]":
        """Create Enable Output with operation 'Image'."""
        return EnableOutput(data_type="IMAGE", enable=enable, value=value)

    @classmethod
    def geometry(
        cls, enable: InputBoolean = False, value: InputGeometry = None
    ) -> "EnableOutput[GeometrySocket]":
        """Create Enable Output with operation 'Geometry'."""
        return EnableOutput(data_type="GEOMETRY", enable=enable, value=value)

    @classmethod
    def collection(
        cls, enable: InputBoolean = False, value: InputCollection = None
    ) -> "EnableOutput[CollectionSocket]":
        """Create Enable Output with operation 'Collection'."""
        return EnableOutput(data_type="COLLECTION", enable=enable, value=value)

    @classmethod
    def material(
        cls, enable: InputBoolean = False, value: InputMaterial = None
    ) -> "EnableOutput[MaterialSocket]":
        """Create Enable Output with operation 'Material'."""
        return EnableOutput(data_type="MATERIAL", enable=enable, value=value)

    @classmethod
    def bundle(
        cls, enable: InputBoolean = False, value: InputBundle = None
    ) -> "EnableOutput[BundleSocket]":
        """Create Enable Output with operation 'Bundle'."""
        return EnableOutput(data_type="BUNDLE", enable=enable, value=value)

    @classmethod
    def closure(
        cls, enable: InputBoolean = False, value: InputClosure = None
    ) -> "EnableOutput[ClosureSocket]":
        """Create Enable Output with operation 'Closure'."""
        return EnableOutput(data_type="CLOSURE", 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 sound(
        cls, enable: InputBoolean = False, value: InputSound = None
    ) -> "EnableOutput[SoundSocket]":
        """Create Enable Output with operation 'Sound'."""
        return EnableOutput(data_type="SOUND", enable=enable, value=value)

    @property
    def data_type(
        self,
    ) -> Literal[
        "FLOAT",
        "INT",
        "BOOLEAN",
        "VECTOR",
        "RGBA",
        "ROTATION",
        "MATRIX",
        "STRING",
        "MENU",
        "OBJECT",
        "IMAGE",
        "GEOMETRY",
        "COLLECTION",
        "MATERIAL",
        "BUNDLE",
        "CLOSURE",
        "FONT",
        "SOUND",
    ]:
        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",
            "IMAGE",
            "GEOMETRY",
            "COLLECTION",
            "MATERIAL",
            "BUNDLE",
            "CLOSURE",
            "FONT",
            "SOUND",
        ],
    ):
        self.node.data_type = value


class GroupInput(BaseNode):
    """
    Expose connected data from inside a node group as inputs to its interface
    """

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

    class _Inputs(SocketAccessor):
        pass

    class _Outputs(SocketAccessor):
        pass

    if TYPE_CHECKING:

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

    def __init__(self):
        super().__init__()
        key_args = {}

        self._establish_links(**key_args)


class GroupOutput(BaseNode):
    """
    Output data from inside of a node group
    """

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

    class _Inputs(SocketAccessor):
        pass

    class _Outputs(SocketAccessor):
        pass

    if TYPE_CHECKING:

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

    def __init__(self, is_active_output: bool = False):
        super().__init__()
        key_args = {}
        self.is_active_output = is_active_output
        self._establish_links(**key_args)

    @property
    def is_active_output(self) -> bool:
        return self.node.is_active_output

    @is_active_output.setter
    def is_active_output(self, value: bool):
        self.node.is_active_output = value


class LinearGizmo(BaseNode):
    """
    Show a linear gizmo in the viewport for a value

    Parameters
    ----------
    value : InputFloat
        Value
    position : InputVector
        Position
    direction : InputVector
        Direction

    Inputs
    ------
    i.value : FloatSocket
        Value
    i.position : VectorSocket
        Position
    i.direction : VectorSocket
        Direction

    Outputs
    -------
    o.transform : GeometrySocket
        Transform
    """

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

    class _Inputs(SocketAccessor):
        value: FloatSocket
        """Value"""
        position: VectorSocket
        """Position"""
        direction: VectorSocket
        """Direction"""

    class _Outputs(SocketAccessor):
        transform: GeometrySocket
        """Transform"""

    if TYPE_CHECKING:

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

    def __init__(
        self,
        value: InputFloat = 0.0,
        position: InputVector = None,
        direction: InputVector = None,
        *,
        color_id: Literal["PRIMARY", "SECONDARY", "X", "Y", "Z"] = "PRIMARY",
        draw_style: Literal["ARROW", "CROSS", "BOX"] = "ARROW",
    ):
        super().__init__()
        key_args = {"Value": value, "Position": position, "Direction": direction}
        self.color_id = color_id
        self.draw_style = draw_style
        self._establish_links(**key_args)

    @property
    def color_id(self) -> Literal["PRIMARY", "SECONDARY", "X", "Y", "Z"]:
        return self.node.color_id

    @color_id.setter
    def color_id(self, value: Literal["PRIMARY", "SECONDARY", "X", "Y", "Z"]):
        self.node.color_id = value

    @property
    def draw_style(self) -> Literal["ARROW", "CROSS", "BOX"]:
        return self.node.draw_style

    @draw_style.setter
    def draw_style(self, value: Literal["ARROW", "CROSS", "BOX"]):
        self.node.draw_style = value


class TransformGizmo(BaseNode):
    """
    Show a transform gizmo in the viewport

    Parameters
    ----------
    value : InputMatrix
        Value
    position : InputVector
        Position
    rotation : InputRotation
        Rotation

    Inputs
    ------
    i.value : MatrixSocket
        Value
    i.position : VectorSocket
        Position
    i.rotation : RotationSocket
        Rotation

    Outputs
    -------
    o.transform : GeometrySocket
        Transform
    """

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

    class _Inputs(SocketAccessor):
        value: MatrixSocket
        """Value"""
        position: VectorSocket
        """Position"""
        rotation: RotationSocket
        """Rotation"""

    class _Outputs(SocketAccessor):
        transform: GeometrySocket
        """Transform"""

    if TYPE_CHECKING:

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

    def __init__(
        self,
        value: InputMatrix = None,
        position: InputVector = None,
        rotation: InputRotation = None,
        *,
        use_translation_x: bool = False,
        use_translation_y: bool = False,
        use_translation_z: bool = False,
        use_rotation_x: bool = False,
        use_rotation_y: bool = False,
        use_rotation_z: bool = False,
        use_scale_x: bool = False,
        use_scale_y: bool = False,
        use_scale_z: bool = False,
    ):
        super().__init__()
        key_args = {"Value": value, "Position": position, "Rotation": rotation}
        self.use_translation_x = use_translation_x
        self.use_translation_y = use_translation_y
        self.use_translation_z = use_translation_z
        self.use_rotation_x = use_rotation_x
        self.use_rotation_y = use_rotation_y
        self.use_rotation_z = use_rotation_z
        self.use_scale_x = use_scale_x
        self.use_scale_y = use_scale_y
        self.use_scale_z = use_scale_z
        self._establish_links(**key_args)

    @property
    def use_translation_x(self) -> bool:
        return self.node.use_translation_x

    @use_translation_x.setter
    def use_translation_x(self, value: bool):
        self.node.use_translation_x = value

    @property
    def use_translation_y(self) -> bool:
        return self.node.use_translation_y

    @use_translation_y.setter
    def use_translation_y(self, value: bool):
        self.node.use_translation_y = value

    @property
    def use_translation_z(self) -> bool:
        return self.node.use_translation_z

    @use_translation_z.setter
    def use_translation_z(self, value: bool):
        self.node.use_translation_z = value

    @property
    def use_rotation_x(self) -> bool:
        return self.node.use_rotation_x

    @use_rotation_x.setter
    def use_rotation_x(self, value: bool):
        self.node.use_rotation_x = value

    @property
    def use_rotation_y(self) -> bool:
        return self.node.use_rotation_y

    @use_rotation_y.setter
    def use_rotation_y(self, value: bool):
        self.node.use_rotation_y = value

    @property
    def use_rotation_z(self) -> bool:
        return self.node.use_rotation_z

    @use_rotation_z.setter
    def use_rotation_z(self, value: bool):
        self.node.use_rotation_z = value

    @property
    def use_scale_x(self) -> bool:
        return self.node.use_scale_x

    @use_scale_x.setter
    def use_scale_x(self, value: bool):
        self.node.use_scale_x = value

    @property
    def use_scale_y(self) -> bool:
        return self.node.use_scale_y

    @use_scale_y.setter
    def use_scale_y(self, value: bool):
        self.node.use_scale_y = value

    @property
    def use_scale_z(self) -> bool:
        return self.node.use_scale_z

    @use_scale_z.setter
    def use_scale_z(self, value: bool):
        self.node.use_scale_z = value


class Warning(BaseNode):
    """
    Create custom warnings in node groups

    Parameters
    ----------
    show : InputBoolean
        Show
    message : InputString
        Message

    Inputs
    ------
    i.show : BooleanSocket
        Show
    i.message : StringSocket
        Message

    Outputs
    -------
    o.show : BooleanSocket
        Show
    """

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

    class _Inputs(SocketAccessor):
        show: BooleanSocket
        """Show"""
        message: StringSocket
        """Message"""

    class _Outputs(SocketAccessor):
        show: BooleanSocket
        """Show"""

    if TYPE_CHECKING:

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

    def __init__(
        self,
        show: InputBoolean = True,
        message: InputString = "",
        *,
        warning_type: Literal["ERROR", "WARNING", "INFO"] = "ERROR",
    ):
        super().__init__()
        key_args = {"Show": show, "Message": message}
        self.warning_type = warning_type
        self._establish_links(**key_args)

    @classmethod
    def error(cls, show: InputBoolean = True, message: InputString = "") -> "Warning":
        """Create Warning with operation 'Error'."""
        return cls(warning_type="ERROR", show=show, message=message)

    @classmethod
    def warning(cls, show: InputBoolean = True, message: InputString = "") -> "Warning":
        """Create Warning with operation 'Warning'."""
        return cls(warning_type="WARNING", show=show, message=message)

    @classmethod
    def info(cls, show: InputBoolean = True, message: InputString = "") -> "Warning":
        """Create Warning with operation 'Info'."""
        return cls(warning_type="INFO", show=show, message=message)

    @property
    def warning_type(self) -> Literal["ERROR", "WARNING", "INFO"]:
        return self.node.warning_type

    @warning_type.setter
    def warning_type(self, value: Literal["ERROR", "WARNING", "INFO"]):
        self.node.warning_type = value
