"""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 EstateEnrollmentMetadataCreateDividendReinvestmentPlan(
    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 EstateEnrollmentMetadataCreateTypedDict(TypedDict):
    r"""Enrollment metadata for estate enrollments"""

    certificate_of_appointment_document_id: NotRequired[str]
    r"""The document id for the certificate of appointment"""
    dividend_reinvestment_plan: NotRequired[
        EstateEnrollmentMetadataCreateDividendReinvestmentPlan
    ]
    r"""Option to auto-enroll in Dividend Reinvestment; defaults to true"""


class EstateEnrollmentMetadataCreate(BaseModel):
    r"""Enrollment metadata for estate enrollments"""

    certificate_of_appointment_document_id: Optional[str] = None
    r"""The document id for the certificate of appointment"""

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