"""AGMAGleasonConicalGear"""

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.system_model.part_model.gears import _2806

_AGMA_GLEASON_CONICAL_GEAR = python_net_import(
    "SMT.MastaAPI.SystemModel.PartModel.Gears", "AGMAGleasonConicalGear"
)

if TYPE_CHECKING:
    from typing import Any, Type, TypeVar

    from mastapy._private.system_model import _2453
    from mastapy._private.system_model.part_model import _2716, _2739, _2744
    from mastapy._private.system_model.part_model.gears import (
        _2798,
        _2800,
        _2801,
        _2802,
        _2813,
        _2817,
        _2827,
        _2829,
        _2831,
        _2833,
        _2834,
        _2837,
    )

    Self = TypeVar("Self", bound="AGMAGleasonConicalGear")
    CastSelf = TypeVar(
        "CastSelf", bound="AGMAGleasonConicalGear._Cast_AGMAGleasonConicalGear"
    )


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


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

    __parent__: "AGMAGleasonConicalGear"

    @property
    def conical_gear(self: "CastSelf") -> "_2806.ConicalGear":
        return self.__parent__._cast(_2806.ConicalGear)

    @property
    def gear(self: "CastSelf") -> "_2813.Gear":
        from mastapy._private.system_model.part_model.gears import _2813

        return self.__parent__._cast(_2813.Gear)

    @property
    def mountable_component(self: "CastSelf") -> "_2739.MountableComponent":
        from mastapy._private.system_model.part_model import _2739

        return self.__parent__._cast(_2739.MountableComponent)

    @property
    def component(self: "CastSelf") -> "_2716.Component":
        from mastapy._private.system_model.part_model import _2716

        return self.__parent__._cast(_2716.Component)

    @property
    def part(self: "CastSelf") -> "_2744.Part":
        from mastapy._private.system_model.part_model import _2744

        return self.__parent__._cast(_2744.Part)

    @property
    def design_entity(self: "CastSelf") -> "_2453.DesignEntity":
        from mastapy._private.system_model import _2453

        return self.__parent__._cast(_2453.DesignEntity)

    @property
    def bevel_differential_gear(self: "CastSelf") -> "_2798.BevelDifferentialGear":
        from mastapy._private.system_model.part_model.gears import _2798

        return self.__parent__._cast(_2798.BevelDifferentialGear)

    @property
    def bevel_differential_planet_gear(
        self: "CastSelf",
    ) -> "_2800.BevelDifferentialPlanetGear":
        from mastapy._private.system_model.part_model.gears import _2800

        return self.__parent__._cast(_2800.BevelDifferentialPlanetGear)

    @property
    def bevel_differential_sun_gear(
        self: "CastSelf",
    ) -> "_2801.BevelDifferentialSunGear":
        from mastapy._private.system_model.part_model.gears import _2801

        return self.__parent__._cast(_2801.BevelDifferentialSunGear)

    @property
    def bevel_gear(self: "CastSelf") -> "_2802.BevelGear":
        from mastapy._private.system_model.part_model.gears import _2802

        return self.__parent__._cast(_2802.BevelGear)

    @property
    def hypoid_gear(self: "CastSelf") -> "_2817.HypoidGear":
        from mastapy._private.system_model.part_model.gears import _2817

        return self.__parent__._cast(_2817.HypoidGear)

    @property
    def spiral_bevel_gear(self: "CastSelf") -> "_2827.SpiralBevelGear":
        from mastapy._private.system_model.part_model.gears import _2827

        return self.__parent__._cast(_2827.SpiralBevelGear)

    @property
    def straight_bevel_diff_gear(self: "CastSelf") -> "_2829.StraightBevelDiffGear":
        from mastapy._private.system_model.part_model.gears import _2829

        return self.__parent__._cast(_2829.StraightBevelDiffGear)

    @property
    def straight_bevel_gear(self: "CastSelf") -> "_2831.StraightBevelGear":
        from mastapy._private.system_model.part_model.gears import _2831

        return self.__parent__._cast(_2831.StraightBevelGear)

    @property
    def straight_bevel_planet_gear(self: "CastSelf") -> "_2833.StraightBevelPlanetGear":
        from mastapy._private.system_model.part_model.gears import _2833

        return self.__parent__._cast(_2833.StraightBevelPlanetGear)

    @property
    def straight_bevel_sun_gear(self: "CastSelf") -> "_2834.StraightBevelSunGear":
        from mastapy._private.system_model.part_model.gears import _2834

        return self.__parent__._cast(_2834.StraightBevelSunGear)

    @property
    def zerol_bevel_gear(self: "CastSelf") -> "_2837.ZerolBevelGear":
        from mastapy._private.system_model.part_model.gears import _2837

        return self.__parent__._cast(_2837.ZerolBevelGear)

    @property
    def agma_gleason_conical_gear(self: "CastSelf") -> "AGMAGleasonConicalGear":
        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 AGMAGleasonConicalGear(_2806.ConicalGear):
    """AGMAGleasonConicalGear

    This is a mastapy class.
    """

    TYPE: ClassVar["Type"] = _AGMA_GLEASON_CONICAL_GEAR

    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_AGMAGleasonConicalGear":
        """Cast to another type.

        Returns:
            _Cast_AGMAGleasonConicalGear
        """
        return _Cast_AGMAGleasonConicalGear(self)
