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

from __future__ import annotations
from .beneficiaryenrollmentmetadatacreate import (
    BeneficiaryEnrollmentMetadataCreate,
    BeneficiaryEnrollmentMetadataCreateTypedDict,
)
from .corporationenrollmentmetadatacreate import (
    CorporationEnrollmentMetadataCreate,
    CorporationEnrollmentMetadataCreateTypedDict,
)
from .custodialenrollmentmetadatacreate import (
    CustodialEnrollmentMetadataCreate,
    CustodialEnrollmentMetadataCreateTypedDict,
)
from .estateenrollmentmetadatacreate import (
    EstateEnrollmentMetadataCreate,
    EstateEnrollmentMetadataCreateTypedDict,
)
from .foreignindividualaccountenrollmentmetadatacreate import (
    ForeignIndividualAccountEnrollmentMetadataCreate,
    ForeignIndividualAccountEnrollmentMetadataCreateTypedDict,
)
from .fpslenrollmentmetadatacreate import (
    FPSLEnrollmentMetaDataCreate,
    FPSLEnrollmentMetaDataCreateTypedDict,
)
from .individualenrollmentmetadatacreate import (
    IndividualEnrollmentMetadataCreate,
    IndividualEnrollmentMetadataCreateTypedDict,
)
from .irabeneficiaryenrollmentmetadatacreate import (
    IRABeneficiaryEnrollmentMetadataCreate,
    IRABeneficiaryEnrollmentMetadataCreateTypedDict,
)
from .irarolloverenrollmentmetadatacreate import (
    IRARolloverEnrollmentMetadataCreate,
    IRARolloverEnrollmentMetadataCreateTypedDict,
)
from .irarothenrollmentmetadatacreate import (
    IRARothEnrollmentMetadataCreate,
    IRARothEnrollmentMetadataCreateTypedDict,
)
from .irasepenrollmentmetadatacreate import (
    IRASEPEnrollmentMetadataCreate,
    IRASEPEnrollmentMetadataCreateTypedDict,
)
from .irasimpleenrollmentmetadatacreate import (
    IRASimpleEnrollmentMetadataCreate,
    IRASimpleEnrollmentMetadataCreateTypedDict,
)
from .iratraditionalenrollmentmetadatacreate import (
    IRATraditionalEnrollmentMetadataCreate,
    IRATraditionalEnrollmentMetadataCreateTypedDict,
)
from .jointcommunitypropertyenrollmentmetadatacreate import (
    JointCommunityPropertyEnrollmentMetadataCreate,
    JointCommunityPropertyEnrollmentMetadataCreateTypedDict,
)
from .jointtenantsbyentiretyenrollmentmetadatacreate import (
    JointTenantsByEntiretyEnrollmentMetadataCreate,
    JointTenantsByEntiretyEnrollmentMetadataCreateTypedDict,
)
from .jointtenantsincommonenrollmentmetadatacreate import (
    JointTenantsInCommonEnrollmentMetadataCreate,
    JointTenantsInCommonEnrollmentMetadataCreateTypedDict,
)
from .jointwithrightsofsurvivorshipenrollmentmetadatacreate import (
    JointWithRightsOfSurvivorshipEnrollmentMetadataCreate,
    JointWithRightsOfSurvivorshipEnrollmentMetadataCreateTypedDict,
)
from .llcenrollmentmetadatacreate import (
    LLCEnrollmentMetadataCreate,
    LLCEnrollmentMetadataCreateTypedDict,
)
from .operatingenrollmentmetadatacreate import (
    OperatingEnrollmentMetadataCreate,
    OperatingEnrollmentMetadataCreateTypedDict,
)
from .trustenrollmentmetadatacreate import (
    TrustEnrollmentMetadataCreate,
    TrustEnrollmentMetadataCreateTypedDict,
)
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 EnrollmentCreateConsentMethod(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""The consent method for the enrollment. Defaults to ESIGNATURE."""

    CONSENT_METHOD_UNSPECIFIED = "CONSENT_METHOD_UNSPECIFIED"
    ESIGNATURE = "ESIGNATURE"
    WET_SIGNATURE = "WET_SIGNATURE"
    NEGATIVE_CONSENT_CONVERSION = "NEGATIVE_CONSENT_CONVERSION"


class EnrollmentCreateType(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""Describes the name of the enrollment; Expressed as an enum"""

    ENROLLMENT_TYPE_UNSPECIFIED = "ENROLLMENT_TYPE_UNSPECIFIED"
    REGISTRATION_INDIVIDUAL = "REGISTRATION_INDIVIDUAL"
    LENDING_LIMITED_PURPOSE_MARGIN = "LENDING_LIMITED_PURPOSE_MARGIN"
    LENDING_FULLY_PAID_STOCK_LOAN = "LENDING_FULLY_PAID_STOCK_LOAN"
    BENEFICIARY_DESIGNATION = "BENEFICIARY_DESIGNATION"
    REGISTRATION_JOINT_WROS = "REGISTRATION_JOINT_WROS"
    REGISTRATION_JOINT_TIC = "REGISTRATION_JOINT_TIC"
    REGISTRATION_JOINT_TBE = "REGISTRATION_JOINT_TBE"
    REGISTRATION_JOINT_CP = "REGISTRATION_JOINT_CP"
    REGISTRATION_ESTATE = "REGISTRATION_ESTATE"
    REGISTRATION_IRA_TRADITIONAL = "REGISTRATION_IRA_TRADITIONAL"
    REGISTRATION_IRA_SIMPLE = "REGISTRATION_IRA_SIMPLE"
    REGISTRATION_IRA_SEP = "REGISTRATION_IRA_SEP"
    REGISTRATION_IRA_ROTH = "REGISTRATION_IRA_ROTH"
    REGISTRATION_IRA_ROLLOVER = "REGISTRATION_IRA_ROLLOVER"
    REGISTRATION_TRUST = "REGISTRATION_TRUST"
    REGISTRATION_CORPORATION = "REGISTRATION_CORPORATION"
    CASH_FDIC_CASH_SWEEP = "CASH_FDIC_CASH_SWEEP"
    MARGINS_PDT_RESET = "MARGINS_PDT_RESET"
    RETIREMENT_BENEFICIARY_DESIGNATION = "RETIREMENT_BENEFICIARY_DESIGNATION"
    DIVIDEND_REINVESTMENT_PLAN = "DIVIDEND_REINVESTMENT_PLAN"
    REGISTRATION_IRA_BENEFICIARY_TRADITIONAL = (
        "REGISTRATION_IRA_BENEFICIARY_TRADITIONAL"
    )
    REGISTRATION_IRA_BENEFICIARY_ROTH = "REGISTRATION_IRA_BENEFICIARY_ROTH"
    REGISTRATION_CUSTODIAL = "REGISTRATION_CUSTODIAL"
    REG_T_MARGIN = "REG_T_MARGIN"


class EnrollmentCreateTypedDict(TypedDict):
    r"""An Enrollment represents programs the account may enroll in."""

    principal_approver_id: str
    r"""The ULID is associated with the approver of a given enrollment. The approver you create will contain the CRD Number issued to the person by FINRA. As an RIA, you should use the ULID associated with Apex's approver."""
    type: EnrollmentCreateType
    r"""Describes the name of the enrollment; Expressed as an enum"""
    beneficiary_enrollment_metadata: NotRequired[
        BeneficiaryEnrollmentMetadataCreateTypedDict
    ]
    r"""Enrollment metadata for the BENEFICIARY_DESIGNATION enrollment type."""
    consent_method: NotRequired[EnrollmentCreateConsentMethod]
    r"""The consent method for the enrollment. Defaults to ESIGNATURE."""
    corporation_enrollment_metadata: NotRequired[
        CorporationEnrollmentMetadataCreateTypedDict
    ]
    custodial_enrollment_metadata: NotRequired[
        CustodialEnrollmentMetadataCreateTypedDict
    ]
    r"""Enrollment metadata for the CUSTODIAL enrollment type"""
    estate_enrollment_metadata: NotRequired[EstateEnrollmentMetadataCreateTypedDict]
    r"""Enrollment metadata for estate enrollments"""
    foreign_individual_account_enrollment_metadata: NotRequired[
        ForeignIndividualAccountEnrollmentMetadataCreateTypedDict
    ]
    fpsl_enrollment_metadata: NotRequired[FPSLEnrollmentMetaDataCreateTypedDict]
    r"""Percentages for FPSL Enrollment, must equal 100"""
    individual_enrollment_metadata: NotRequired[
        IndividualEnrollmentMetadataCreateTypedDict
    ]
    r"""Enrollment metadata for Individual accounts enrollment type"""
    ira_beneficiary_enrollment_metadata: NotRequired[
        IRABeneficiaryEnrollmentMetadataCreateTypedDict
    ]
    r"""Enrollment metadata for beneficiary IRA accounts enrollment type"""
    ira_rollover_enrollment_metadata: NotRequired[
        IRARolloverEnrollmentMetadataCreateTypedDict
    ]
    r"""Enrollment metadata for Rollover IRA accounts enrollment type"""
    ira_roth_enrollment_metadata: NotRequired[IRARothEnrollmentMetadataCreateTypedDict]
    r"""Enrollment metadata for ROTH IRA accounts enrollment type"""
    ira_sep_enrollment_metadata: NotRequired[IRASEPEnrollmentMetadataCreateTypedDict]
    r"""Enrollment metadata for IRA SEP_IRA accounts enrollment type"""
    ira_simple_enrollment_metadata: NotRequired[
        IRASimpleEnrollmentMetadataCreateTypedDict
    ]
    r"""Enrollment metadata for Simple IRA accounts enrollment type"""
    ira_traditional_enrollment_metadata: NotRequired[
        IRATraditionalEnrollmentMetadataCreateTypedDict
    ]
    r"""Enrollment metadata for Traditional IRA accounts enrollment type"""
    joint_community_property_enrollment_metadata: NotRequired[
        JointCommunityPropertyEnrollmentMetadataCreateTypedDict
    ]
    r"""Enrollment metadata for the Joint Community Property Registration enrollment type"""
    joint_tenants_by_entirety_enrollment_metadata: NotRequired[
        JointTenantsByEntiretyEnrollmentMetadataCreateTypedDict
    ]
    r"""Enrollment metadata for the Joint Tenants by Entirety Registration enrollment type"""
    joint_tenants_in_common_enrollment_metadata: NotRequired[
        JointTenantsInCommonEnrollmentMetadataCreateTypedDict
    ]
    r"""Enrollment metadata for the Joint Tenants In Common enrollment type"""
    joint_with_rights_of_survivorship_enrollment_metadata: NotRequired[
        JointWithRightsOfSurvivorshipEnrollmentMetadataCreateTypedDict
    ]
    r"""Enrollment metadata for the With Right of Survivorship enrollment type"""
    llc_enrollment_metadata: NotRequired[LLCEnrollmentMetadataCreateTypedDict]
    operating_enrollment_metadata: NotRequired[
        OperatingEnrollmentMetadataCreateTypedDict
    ]
    r"""Enrollment metadata for the REGISTRATION_OPERATING enrollment type."""
    trust_enrollment_metadata: NotRequired[TrustEnrollmentMetadataCreateTypedDict]


class EnrollmentCreate(BaseModel):
    r"""An Enrollment represents programs the account may enroll in."""

    principal_approver_id: str
    r"""The ULID is associated with the approver of a given enrollment. The approver you create will contain the CRD Number issued to the person by FINRA. As an RIA, you should use the ULID associated with Apex's approver."""

    type: Annotated[EnrollmentCreateType, PlainValidator(validate_open_enum(False))]
    r"""Describes the name of the enrollment; Expressed as an enum"""

    beneficiary_enrollment_metadata: Optional[
        BeneficiaryEnrollmentMetadataCreate
    ] = None
    r"""Enrollment metadata for the BENEFICIARY_DESIGNATION enrollment type."""

    consent_method: Annotated[
        Optional[EnrollmentCreateConsentMethod],
        PlainValidator(validate_open_enum(False)),
    ] = None
    r"""The consent method for the enrollment. Defaults to ESIGNATURE."""

    corporation_enrollment_metadata: Optional[
        CorporationEnrollmentMetadataCreate
    ] = None

    custodial_enrollment_metadata: Optional[CustodialEnrollmentMetadataCreate] = None
    r"""Enrollment metadata for the CUSTODIAL enrollment type"""

    estate_enrollment_metadata: Optional[EstateEnrollmentMetadataCreate] = None
    r"""Enrollment metadata for estate enrollments"""

    foreign_individual_account_enrollment_metadata: Optional[
        ForeignIndividualAccountEnrollmentMetadataCreate
    ] = None

    fpsl_enrollment_metadata: Optional[FPSLEnrollmentMetaDataCreate] = None
    r"""Percentages for FPSL Enrollment, must equal 100"""

    individual_enrollment_metadata: Optional[IndividualEnrollmentMetadataCreate] = None
    r"""Enrollment metadata for Individual accounts enrollment type"""

    ira_beneficiary_enrollment_metadata: Optional[
        IRABeneficiaryEnrollmentMetadataCreate
    ] = None
    r"""Enrollment metadata for beneficiary IRA accounts enrollment type"""

    ira_rollover_enrollment_metadata: Optional[
        IRARolloverEnrollmentMetadataCreate
    ] = None
    r"""Enrollment metadata for Rollover IRA accounts enrollment type"""

    ira_roth_enrollment_metadata: Optional[IRARothEnrollmentMetadataCreate] = None
    r"""Enrollment metadata for ROTH IRA accounts enrollment type"""

    ira_sep_enrollment_metadata: Optional[IRASEPEnrollmentMetadataCreate] = None
    r"""Enrollment metadata for IRA SEP_IRA accounts enrollment type"""

    ira_simple_enrollment_metadata: Optional[IRASimpleEnrollmentMetadataCreate] = None
    r"""Enrollment metadata for Simple IRA accounts enrollment type"""

    ira_traditional_enrollment_metadata: Optional[
        IRATraditionalEnrollmentMetadataCreate
    ] = None
    r"""Enrollment metadata for Traditional IRA accounts enrollment type"""

    joint_community_property_enrollment_metadata: Optional[
        JointCommunityPropertyEnrollmentMetadataCreate
    ] = None
    r"""Enrollment metadata for the Joint Community Property Registration enrollment type"""

    joint_tenants_by_entirety_enrollment_metadata: Optional[
        JointTenantsByEntiretyEnrollmentMetadataCreate
    ] = None
    r"""Enrollment metadata for the Joint Tenants by Entirety Registration enrollment type"""

    joint_tenants_in_common_enrollment_metadata: Optional[
        JointTenantsInCommonEnrollmentMetadataCreate
    ] = None
    r"""Enrollment metadata for the Joint Tenants In Common enrollment type"""

    joint_with_rights_of_survivorship_enrollment_metadata: Optional[
        JointWithRightsOfSurvivorshipEnrollmentMetadataCreate
    ] = None
    r"""Enrollment metadata for the With Right of Survivorship enrollment type"""

    llc_enrollment_metadata: Optional[LLCEnrollmentMetadataCreate] = None

    operating_enrollment_metadata: Optional[OperatingEnrollmentMetadataCreate] = None
    r"""Enrollment metadata for the REGISTRATION_OPERATING enrollment type."""

    trust_enrollment_metadata: Optional[TrustEnrollmentMetadataCreate] = None
