"""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 CostBasisLotDisposalMethod(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""A method of determining the cost basis of an asset that has been sold or disposed of, by identifying which specific lot of the asset was sold and using the cost of that lot to calculate the cost basis; this method is commonly used for tax purposes to determine the amount of reportable capital gains or losses By default, this is set to `COST_BASIS_LOT_DISPOSAL_MIN_TAX_TERM`"""

    COST_BASIS_LOT_DISPOSAL_METHOD_UNSPECIFIED = (
        "COST_BASIS_LOT_DISPOSAL_METHOD_UNSPECIFIED"
    )
    COST_BASIS_LOT_DISPOSAL_FIFO = "COST_BASIS_LOT_DISPOSAL_FIFO"
    COST_BASIS_LOT_DISPOSAL_LIFO = "COST_BASIS_LOT_DISPOSAL_LIFO"
    COST_BASIS_LOT_DISPOSAL_HIGH_COST = "COST_BASIS_LOT_DISPOSAL_HIGH_COST"
    COST_BASIS_LOT_DISPOSAL_HIGH_COST_LONG_TERM = (
        "COST_BASIS_LOT_DISPOSAL_HIGH_COST_LONG_TERM"
    )
    COST_BASIS_LOT_DISPOSAL_HIGH_COST_SHORT_TERM = (
        "COST_BASIS_LOT_DISPOSAL_HIGH_COST_SHORT_TERM"
    )
    COST_BASIS_LOT_DISPOSAL_LOW_COST = "COST_BASIS_LOT_DISPOSAL_LOW_COST"
    COST_BASIS_LOT_DISPOSAL_LOW_COST_LONG_TERM = (
        "COST_BASIS_LOT_DISPOSAL_LOW_COST_LONG_TERM"
    )
    COST_BASIS_LOT_DISPOSAL_LOW_COST_SHORT_TERM = (
        "COST_BASIS_LOT_DISPOSAL_LOW_COST_SHORT_TERM"
    )
    COST_BASIS_LOT_DISPOSAL_MIN_TAX_TERM = "COST_BASIS_LOT_DISPOSAL_MIN_TAX_TERM"


class AccountTaxProfileCreateTypedDict(TypedDict):
    r"""The account tax profile."""

    cost_basis_lot_disposal_method: NotRequired[CostBasisLotDisposalMethod]
    r"""A method of determining the cost basis of an asset that has been sold or disposed of, by identifying which specific lot of the asset was sold and using the cost of that lot to calculate the cost basis; this method is commonly used for tax purposes to determine the amount of reportable capital gains or losses By default, this is set to `COST_BASIS_LOT_DISPOSAL_MIN_TAX_TERM`"""
    section_475_election: NotRequired[bool]
    r"""Indicates if the account is eligible to mark-to-market their securities and commodities holdings; Named after the related section of the IRS tax code"""


class AccountTaxProfileCreate(BaseModel):
    r"""The account tax profile."""

    cost_basis_lot_disposal_method: Annotated[
        Optional[CostBasisLotDisposalMethod], PlainValidator(validate_open_enum(False))
    ] = None
    r"""A method of determining the cost basis of an asset that has been sold or disposed of, by identifying which specific lot of the asset was sold and using the cost of that lot to calculate the cost basis; this method is commonly used for tax purposes to determine the amount of reportable capital gains or losses By default, this is set to `COST_BASIS_LOT_DISPOSAL_MIN_TAX_TERM`"""

    section_475_election: Optional[bool] = None
    r"""Indicates if the account is eligible to mark-to-market their securities and commodities holdings; Named after the related section of the IRS tax code"""
