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

from __future__ import annotations
from .positioncreate import PositionCreate, PositionCreateTypedDict
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_extensions import Annotated, TypedDict


class AssetCreateType(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""The asset identifier type"""

    IDENTIFIER_TYPE_UNSPECIFIED = "IDENTIFIER_TYPE_UNSPECIFIED"
    CURRENCY_CODE = "CURRENCY_CODE"
    CUSIP = "CUSIP"
    SYMBOL = "SYMBOL"
    ISIN = "ISIN"


class AssetCreateTypedDict(TypedDict):
    r"""The asset being transferred If cash, the asset_id is the currency code (e.g. USD) and the position is the amount"""

    identifier: str
    r"""The asset identifier"""
    position: PositionCreateTypedDict
    r"""The position or amount of the asset"""
    type: AssetCreateType
    r"""The asset identifier type"""


class AssetCreate(BaseModel):
    r"""The asset being transferred If cash, the asset_id is the currency code (e.g. USD) and the position is the amount"""

    identifier: str
    r"""The asset identifier"""

    position: PositionCreate
    r"""The position or amount of the asset"""

    type: Annotated[AssetCreateType, PlainValidator(validate_open_enum(False))]
    r"""The asset identifier type"""
