"""ConcentricConnectionNodalComponentBase"""

from __future__ import annotations

from typing import TYPE_CHECKING, ClassVar

from mastapy._private._internal.dataclasses import extended_dataclass
from mastapy._private._internal.exceptions import CastException
from mastapy._private._internal.python_net import python_net_import

from mastapy._private._internal import utility
from mastapy._private.nodal_analysis.nodal_entities import _176

_CONCENTRIC_CONNECTION_NODAL_COMPONENT_BASE = python_net_import(
    "SMT.MastaAPI.NodalAnalysis.NodalEntities", "ConcentricConnectionNodalComponentBase"
)

if TYPE_CHECKING:
    from typing import Any, Type, TypeVar

    from mastapy._private.nodal_analysis.nodal_entities import (
        _147,
        _148,
        _160,
        _161,
        _173,
        _174,
        _175,
    )

    Self = TypeVar("Self", bound="ConcentricConnectionNodalComponentBase")
    CastSelf = TypeVar(
        "CastSelf",
        bound="ConcentricConnectionNodalComponentBase._Cast_ConcentricConnectionNodalComponentBase",
    )


__docformat__ = "restructuredtext en"
__all__ = ("ConcentricConnectionNodalComponentBase",)


@extended_dataclass(frozen=True, slots=True, weakref_slot=True)
class _Cast_ConcentricConnectionNodalComponentBase:
    """Special nested class for casting ConcentricConnectionNodalComponentBase to subclasses."""

    __parent__: "ConcentricConnectionNodalComponentBase"

    @property
    def two_body_connection_nodal_component(
        self: "CastSelf",
    ) -> "_176.TwoBodyConnectionNodalComponent":
        return self.__parent__._cast(_176.TwoBodyConnectionNodalComponent)

    @property
    def component_nodal_composite_base(
        self: "CastSelf",
    ) -> "_147.ComponentNodalCompositeBase":
        from mastapy._private.nodal_analysis.nodal_entities import _147

        return self.__parent__._cast(_147.ComponentNodalCompositeBase)

    @property
    def nodal_composite(self: "CastSelf") -> "_160.NodalComposite":
        from mastapy._private.nodal_analysis.nodal_entities import _160

        return self.__parent__._cast(_160.NodalComposite)

    @property
    def nodal_entity(self: "CastSelf") -> "_161.NodalEntity":
        from mastapy._private.nodal_analysis.nodal_entities import _161

        return self.__parent__._cast(_161.NodalEntity)

    @property
    def concentric_connection_nodal_component(
        self: "CastSelf",
    ) -> "_148.ConcentricConnectionNodalComponent":
        from mastapy._private.nodal_analysis.nodal_entities import _148

        return self.__parent__._cast(_148.ConcentricConnectionNodalComponent)

    @property
    def torsional_friction_node_pair(
        self: "CastSelf",
    ) -> "_173.TorsionalFrictionNodePair":
        from mastapy._private.nodal_analysis.nodal_entities import _173

        return self.__parent__._cast(_173.TorsionalFrictionNodePair)

    @property
    def torsional_friction_node_pair_base(
        self: "CastSelf",
    ) -> "_174.TorsionalFrictionNodePairBase":
        from mastapy._private.nodal_analysis.nodal_entities import _174

        return self.__parent__._cast(_174.TorsionalFrictionNodePairBase)

    @property
    def torsional_friction_node_pair_simple_locked_stiffness(
        self: "CastSelf",
    ) -> "_175.TorsionalFrictionNodePairSimpleLockedStiffness":
        from mastapy._private.nodal_analysis.nodal_entities import _175

        return self.__parent__._cast(
            _175.TorsionalFrictionNodePairSimpleLockedStiffness
        )

    @property
    def concentric_connection_nodal_component_base(
        self: "CastSelf",
    ) -> "ConcentricConnectionNodalComponentBase":
        return self.__parent__

    def __getattr__(self: "CastSelf", name: str) -> "Any":
        try:
            return self.__getattribute__(name)
        except AttributeError:
            class_name = utility.camel(name)
            raise CastException(
                f'Detected an invalid cast. Cannot cast to type "{class_name}"'
            ) from None


@extended_dataclass(frozen=True, slots=True, weakref_slot=True, eq=False)
class ConcentricConnectionNodalComponentBase(_176.TwoBodyConnectionNodalComponent):
    """ConcentricConnectionNodalComponentBase

    This is a mastapy class.
    """

    TYPE: ClassVar["Type"] = _CONCENTRIC_CONNECTION_NODAL_COMPONENT_BASE

    wrapped: "Any"

    def __post_init__(self: "Self") -> None:
        """Override of the post initialisation magic method."""
        if not hasattr(self.wrapped, "reference_count"):
            self.wrapped.reference_count = 0

        self.wrapped.reference_count += 1

    @property
    def cast_to(self: "Self") -> "_Cast_ConcentricConnectionNodalComponentBase":
        """Cast to another type.

        Returns:
            _Cast_ConcentricConnectionNodalComponentBase
        """
        return _Cast_ConcentricConnectionNodalComponentBase(self)
