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

from __future__ import annotations
from .entityupdate import EntityUpdate, EntityUpdateTypedDict
from .personupdate import PersonUpdate, PersonUpdateTypedDict
from .watchlistmatchupdate import WatchlistMatchUpdate, WatchlistMatchUpdateTypedDict
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 List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class InvestigationUpdateIdentityVerification(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""Indicates the current state of identity verification"""

    SCREEN_STATE_UNSPECIFIED = "SCREEN_STATE_UNSPECIFIED"
    PENDING = "PENDING"
    PASSED = "PASSED"
    FAILED = "FAILED"
    NEEDS_REVIEW = "NEEDS_REVIEW"
    DEFERRED_REVIEW = "DEFERRED_REVIEW"
    OUT_OF_SCOPE = "OUT_OF_SCOPE"


class InvestigationUpdateIdentityVerificationScope(
    str, Enum, metaclass=utils.OpenEnumMeta
):
    r"""Used to determine who is responsible for running identity verification checks"""

    IDENTITY_VERIFICATION_SCOPE_UNSPECIFIED = "IDENTITY_VERIFICATION_SCOPE_UNSPECIFIED"
    PERFORMED_BY_APEX = "PERFORMED_BY_APEX"
    PROVIDED_BY_CLIENT = "PROVIDED_BY_CLIENT"


class InvestigationUpdateTypedDict(TypedDict):
    r"""Contains investigation details of corresponding investigation"""

    comment: NotRequired[str]
    r"""Comment relating to why the investigation state was updated"""
    correspondent_id: NotRequired[str]
    r"""A unique identifier referencing a Correspondent"""
    entity: NotRequired[EntityUpdateTypedDict]
    r"""investigation details on an entity"""
    identity_verification: NotRequired[InvestigationUpdateIdentityVerification]
    r"""Indicates the current state of identity verification"""
    identity_verification_scope: NotRequired[
        InvestigationUpdateIdentityVerificationScope
    ]
    r"""Used to determine who is responsible for running identity verification checks"""
    person: NotRequired[PersonUpdateTypedDict]
    r"""investigation details on a person"""
    watchlist_matches: NotRequired[List[WatchlistMatchUpdateTypedDict]]
    r"""A list of watchlist entries matched against the investigation"""


class InvestigationUpdate(BaseModel):
    r"""Contains investigation details of corresponding investigation"""

    comment: Optional[str] = None
    r"""Comment relating to why the investigation state was updated"""

    correspondent_id: Optional[str] = None
    r"""A unique identifier referencing a Correspondent"""

    entity: Optional[EntityUpdate] = None
    r"""investigation details on an entity"""

    identity_verification: Annotated[
        Optional[InvestigationUpdateIdentityVerification],
        PlainValidator(validate_open_enum(False)),
    ] = None
    r"""Indicates the current state of identity verification"""

    identity_verification_scope: Annotated[
        Optional[InvestigationUpdateIdentityVerificationScope],
        PlainValidator(validate_open_enum(False)),
    ] = None
    r"""Used to determine who is responsible for running identity verification checks"""

    person: Optional[PersonUpdate] = None
    r"""investigation details on a person"""

    watchlist_matches: Optional[List[WatchlistMatchUpdate]] = None
    r"""A list of watchlist entries matched against the investigation"""
