"""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 TemporalTaxYear(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""A temporal tax year value. This will always evaluate to a year based on the date the transfer was initiated."""

    TEMPORAL_TAX_YEAR_UNSPECIFIED = "TEMPORAL_TAX_YEAR_UNSPECIFIED"
    CURRENT_CALENDAR_YEAR = "CURRENT_CALENDAR_YEAR"
    MINIMUM_TAX_YEAR = "MINIMUM_TAX_YEAR"


class ScheduledRetirementContributionCreateType(
    str, Enum, metaclass=utils.OpenEnumMeta
):
    r"""The type of retirement contribution."""

    TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED"
    REGULAR = "REGULAR"
    EMPLOYEE = "EMPLOYEE"
    EMPLOYER = "EMPLOYER"
    RECHARACTERIZATION = "RECHARACTERIZATION"
    ROLLOVER_60_DAY = "ROLLOVER_60_DAY"
    ROLLOVER_DIRECT = "ROLLOVER_DIRECT"
    TRANSFER = "TRANSFER"
    TRUSTEE_FEE = "TRUSTEE_FEE"
    CONVERSION = "CONVERSION"
    REPAYMENT = "REPAYMENT"


class ScheduledRetirementContributionCreateTypedDict(TypedDict):
    r"""The retirement contribution details for a scheduled deposit"""

    type: ScheduledRetirementContributionCreateType
    r"""The type of retirement contribution."""
    tax_year: NotRequired[int]
    r"""An explicit tax year value. The current year is always valid; and the prior year is valid only before the tax deadline. Must be in \"YYYY\" format."""
    temporal_tax_year: NotRequired[TemporalTaxYear]
    r"""A temporal tax year value. This will always evaluate to a year based on the date the transfer was initiated."""


class ScheduledRetirementContributionCreate(BaseModel):
    r"""The retirement contribution details for a scheduled deposit"""

    type: Annotated[
        ScheduledRetirementContributionCreateType,
        PlainValidator(validate_open_enum(False)),
    ]
    r"""The type of retirement contribution."""

    tax_year: Optional[int] = None
    r"""An explicit tax year value. The current year is always valid; and the prior year is valid only before the tax deadline. Must be in \"YYYY\" format."""

    temporal_tax_year: Annotated[
        Optional[TemporalTaxYear], PlainValidator(validate_open_enum(False))
    ] = None
    r"""A temporal tax year value. This will always evaluate to a year based on the date the transfer was initiated."""
