"""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 TrustEnrollmentMetadataCreateDividendReinvestmentPlan(
    str, Enum, metaclass=utils.OpenEnumMeta
):
    r"""Option to auto-enroll in Dividend Reinvestment; defaults to true"""

    AUTO_ENROLL_DIVIDEND_REINVESTMENT_UNSPECIFIED = (
        "AUTO_ENROLL_DIVIDEND_REINVESTMENT_UNSPECIFIED"
    )
    DIVIDEND_REINVESTMENT_ENROLL = "DIVIDEND_REINVESTMENT_ENROLL"
    DIVIDEND_REINVESTMENT_DECLINE = "DIVIDEND_REINVESTMENT_DECLINE"


class TrustEnrollmentMetadataCreateFdicCashSweep(
    str, Enum, metaclass=utils.OpenEnumMeta
):
    r"""Option to auto-enroll in FDIC cash sweep; defaults to true"""

    AUTO_ENROLL_FDIC_CASH_SWEEP_UNSPECIFIED = "AUTO_ENROLL_FDIC_CASH_SWEEP_UNSPECIFIED"
    FDIC_CASH_SWEEP_ENROLL = "FDIC_CASH_SWEEP_ENROLL"
    FDIC_CASH_SWEEP_DECLINE = "FDIC_CASH_SWEEP_DECLINE"


class OpenedOnBehalfOf(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""Trust account is opened on behalf of"""

    OPENED_ON_BEHALF_OF_UNSPECIFIED = "OPENED_ON_BEHALF_OF_UNSPECIFIED"
    PERSONAL_TRUST = "PERSONAL_TRUST"
    BUSINESS_TRUST = "BUSINESS_TRUST"
    THIRD_PARTY_ADMINISTRATOR = "THIRD_PARTY_ADMINISTRATOR"


class TrustEnrollmentMetadataCreateTypedDict(TypedDict):
    opened_on_behalf_of: OpenedOnBehalfOf
    r"""Trust account is opened on behalf of"""
    dividend_reinvestment_plan: NotRequired[
        TrustEnrollmentMetadataCreateDividendReinvestmentPlan
    ]
    r"""Option to auto-enroll in Dividend Reinvestment; defaults to true"""
    fdic_cash_sweep: NotRequired[TrustEnrollmentMetadataCreateFdicCashSweep]
    r"""Option to auto-enroll in FDIC cash sweep; defaults to true"""


class TrustEnrollmentMetadataCreate(BaseModel):
    opened_on_behalf_of: Annotated[
        OpenedOnBehalfOf, PlainValidator(validate_open_enum(False))
    ]
    r"""Trust account is opened on behalf of"""

    dividend_reinvestment_plan: Annotated[
        Optional[TrustEnrollmentMetadataCreateDividendReinvestmentPlan],
        PlainValidator(validate_open_enum(False)),
    ] = None
    r"""Option to auto-enroll in Dividend Reinvestment; defaults to true"""

    fdic_cash_sweep: Annotated[
        Optional[TrustEnrollmentMetadataCreateFdicCashSweep],
        PlainValidator(validate_open_enum(False)),
    ] = None
    r"""Option to auto-enroll in FDIC cash sweep; defaults to true"""
