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

from __future__ import annotations
from ascend_sdk.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict


class RestrictionCreateTypedDict(TypedDict):
    r"""An account restriction."""

    create_reason: str
    r"""The plain-text reason set by a person or system explaining why the restriction was set"""
    restriction_code: str
    r"""A enumerated value indicating the nature of a restriction; prefixed by the concerned department (e.g., `MARGIN_CALL_VIOLATION_REG_T`); suspends related entitlements of the account until it is removed; most codes are administrated by the custodian but some are available for use by the integrator"""
    ended_reason: NotRequired[str]
    r"""The plain-text reason set by a person or system explaining why the restriction was removed If the restriction is active, the reason will not be set."""


class RestrictionCreate(BaseModel):
    r"""An account restriction."""

    create_reason: str
    r"""The plain-text reason set by a person or system explaining why the restriction was set"""

    restriction_code: str
    r"""A enumerated value indicating the nature of a restriction; prefixed by the concerned department (e.g., `MARGIN_CALL_VIOLATION_REG_T`); suspends related entitlements of the account until it is removed; most codes are administrated by the custodian but some are available for use by the integrator"""

    ended_reason: Optional[str] = None
    r"""The plain-text reason set by a person or system explaining why the restriction was removed If the restriction is active, the reason will not be set."""
