"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from ascend_sdk import utils
from ascend_sdk.types import BaseModel
from ascend_sdk.utils import validate_open_enum
from enum import Enum
from pydantic.functional_validators import PlainValidator
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class DistributionConstraintsDistributionTypeInfoType(
    str, Enum, metaclass=utils.OpenEnumMeta
):
    r"""Retirement distribution type"""

    TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED"
    NORMAL = "NORMAL"
    DISABILITY = "DISABILITY"
    SOSEPP = "SOSEPP"
    PREMATURE = "PREMATURE"
    DEATH = "DEATH"
    EXCESS_CONTRIBUTION_REMOVAL_BEFORE_TAX_DEADLINE = (
        "EXCESS_CONTRIBUTION_REMOVAL_BEFORE_TAX_DEADLINE"
    )
    EXCESS_CONTRIBUTION_REMOVAL_AFTER_TAX_DEADLINE = (
        "EXCESS_CONTRIBUTION_REMOVAL_AFTER_TAX_DEADLINE"
    )
    ROLLOVER_TO_QUALIFIED_PLAN = "ROLLOVER_TO_QUALIFIED_PLAN"
    ROLLOVER_TO_IRA = "ROLLOVER_TO_IRA"
    DISTRIBUTION_TRANSFER = "DISTRIBUTION_TRANSFER"
    RECHARACTERIZATION_PRIOR_YEAR = "RECHARACTERIZATION_PRIOR_YEAR"
    RECHARACTERIZATION_CURRENT_YEAR = "RECHARACTERIZATION_CURRENT_YEAR"
    DISTRIBUTION_CONVERSION = "DISTRIBUTION_CONVERSION"
    MANAGEMENT_FEE = "MANAGEMENT_FEE"
    PLAN_LOAN_401_K = "PLAN_LOAN_401K"
    PREMATURE_SIMPLE_IRA_LESS_THAN_2_YEARS = "PREMATURE_SIMPLE_IRA_LESS_THAN_2_YEARS"
    NORMAL_ROTH_IRA_GREATER_THAN_5_YEARS = "NORMAL_ROTH_IRA_GREATER_THAN_5_YEARS"


class DistributionConstraintsDistributionTypeInfoTypedDict(TypedDict):
    r"""Retirement distribution type info"""

    federal_withholding_enabled: NotRequired[bool]
    r"""Whether federal withholding is enabled"""
    state_withholding_enabled: NotRequired[bool]
    r"""Whether state withholding is enabled"""
    type: NotRequired[DistributionConstraintsDistributionTypeInfoType]
    r"""Retirement distribution type"""


class DistributionConstraintsDistributionTypeInfo(BaseModel):
    r"""Retirement distribution type info"""

    federal_withholding_enabled: Optional[bool] = None
    r"""Whether federal withholding is enabled"""

    state_withholding_enabled: Optional[bool] = None
    r"""Whether state withholding is enabled"""

    type: Annotated[
        Optional[DistributionConstraintsDistributionTypeInfoType],
        PlainValidator(validate_open_enum(False)),
    ] = None
    r"""Retirement distribution type"""
