"""LoadedNonBarrelRollerBearingElement"""

from __future__ import annotations

from typing import TYPE_CHECKING, ClassVar

from mastapy._private._internal.dataclasses import extended_dataclass
from mastapy._private._internal.exception_bridge import exception_bridge
from mastapy._private._internal.exceptions import CastException
from mastapy._private._internal.python_net import (
    python_net_import,
    pythonnet_property_get,
)

from mastapy._private._internal import constructor, utility
from mastapy._private.bearings.bearing_results.rolling import _2271

_LOADED_NON_BARREL_ROLLER_BEARING_ELEMENT = python_net_import(
    "SMT.MastaAPI.Bearings.BearingResults.Rolling",
    "LoadedNonBarrelRollerBearingElement",
)

if TYPE_CHECKING:
    from typing import Any, Type, TypeVar

    from mastapy._private.bearings.bearing_results.rolling import (
        _2235,
        _2238,
        _2250,
        _2256,
        _2262,
        _2270,
        _2290,
    )

    Self = TypeVar("Self", bound="LoadedNonBarrelRollerBearingElement")
    CastSelf = TypeVar(
        "CastSelf",
        bound="LoadedNonBarrelRollerBearingElement._Cast_LoadedNonBarrelRollerBearingElement",
    )


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


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

    __parent__: "LoadedNonBarrelRollerBearingElement"

    @property
    def loaded_roller_bearing_element(
        self: "CastSelf",
    ) -> "_2271.LoadedRollerBearingElement":
        return self.__parent__._cast(_2271.LoadedRollerBearingElement)

    @property
    def loaded_element(self: "CastSelf") -> "_2256.LoadedElement":
        from mastapy._private.bearings.bearing_results.rolling import _2256

        return self.__parent__._cast(_2256.LoadedElement)

    @property
    def loaded_axial_thrust_cylindrical_roller_bearing_element(
        self: "CastSelf",
    ) -> "_2235.LoadedAxialThrustCylindricalRollerBearingElement":
        from mastapy._private.bearings.bearing_results.rolling import _2235

        return self.__parent__._cast(
            _2235.LoadedAxialThrustCylindricalRollerBearingElement
        )

    @property
    def loaded_axial_thrust_needle_roller_bearing_element(
        self: "CastSelf",
    ) -> "_2238.LoadedAxialThrustNeedleRollerBearingElement":
        from mastapy._private.bearings.bearing_results.rolling import _2238

        return self.__parent__._cast(_2238.LoadedAxialThrustNeedleRollerBearingElement)

    @property
    def loaded_cylindrical_roller_bearing_element(
        self: "CastSelf",
    ) -> "_2250.LoadedCylindricalRollerBearingElement":
        from mastapy._private.bearings.bearing_results.rolling import _2250

        return self.__parent__._cast(_2250.LoadedCylindricalRollerBearingElement)

    @property
    def loaded_needle_roller_bearing_element(
        self: "CastSelf",
    ) -> "_2262.LoadedNeedleRollerBearingElement":
        from mastapy._private.bearings.bearing_results.rolling import _2262

        return self.__parent__._cast(_2262.LoadedNeedleRollerBearingElement)

    @property
    def loaded_taper_roller_bearing_element(
        self: "CastSelf",
    ) -> "_2290.LoadedTaperRollerBearingElement":
        from mastapy._private.bearings.bearing_results.rolling import _2290

        return self.__parent__._cast(_2290.LoadedTaperRollerBearingElement)

    @property
    def loaded_non_barrel_roller_bearing_element(
        self: "CastSelf",
    ) -> "LoadedNonBarrelRollerBearingElement":
        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 LoadedNonBarrelRollerBearingElement(_2271.LoadedRollerBearingElement):
    """LoadedNonBarrelRollerBearingElement

    This is a mastapy class.
    """

    TYPE: ClassVar["Type"] = _LOADED_NON_BARREL_ROLLER_BEARING_ELEMENT

    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
    @exception_bridge
    def minimum_smt_rib_stress_safety_factor(self: "Self") -> "float":
        """float

        Note:
            This property is readonly.
        """
        temp = pythonnet_property_get(self.wrapped, "MinimumSMTRibStressSafetyFactor")

        if temp is None:
            return 0.0

        return temp

    @property
    @exception_bridge
    def rib_results_inner_left(self: "Self") -> "_2270.LoadedRibResults":
        """mastapy.bearings.bearing_results.rolling.LoadedRibResults

        Note:
            This property is readonly.
        """
        temp = pythonnet_property_get(self.wrapped, "RibResultsInnerLeft")

        if temp is None:
            return None

        type_ = temp.GetType()
        return constructor.new(type_.Namespace, type_.Name)(temp)

    @property
    @exception_bridge
    def rib_results_inner_right(self: "Self") -> "_2270.LoadedRibResults":
        """mastapy.bearings.bearing_results.rolling.LoadedRibResults

        Note:
            This property is readonly.
        """
        temp = pythonnet_property_get(self.wrapped, "RibResultsInnerRight")

        if temp is None:
            return None

        type_ = temp.GetType()
        return constructor.new(type_.Namespace, type_.Name)(temp)

    @property
    @exception_bridge
    def rib_results_outer_left(self: "Self") -> "_2270.LoadedRibResults":
        """mastapy.bearings.bearing_results.rolling.LoadedRibResults

        Note:
            This property is readonly.
        """
        temp = pythonnet_property_get(self.wrapped, "RibResultsOuterLeft")

        if temp is None:
            return None

        type_ = temp.GetType()
        return constructor.new(type_.Namespace, type_.Name)(temp)

    @property
    @exception_bridge
    def rib_results_outer_right(self: "Self") -> "_2270.LoadedRibResults":
        """mastapy.bearings.bearing_results.rolling.LoadedRibResults

        Note:
            This property is readonly.
        """
        temp = pythonnet_property_get(self.wrapped, "RibResultsOuterRight")

        if temp is None:
            return None

        type_ = temp.GetType()
        return constructor.new(type_.Namespace, type_.Name)(temp)

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

        Returns:
            _Cast_LoadedNonBarrelRollerBearingElement
        """
        return _Cast_LoadedNonBarrelRollerBearingElement(self)
