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

from __future__ import annotations
from attio.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
from attio.utils import FieldMetadata, PathParamMetadata
from pydantic import model_serializer
from typing import Literal
from typing_extensions import Annotated, NotRequired, TypedDict


class GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDRequestTypedDict(TypedDict):
    meeting_id: str
    call_recording_id: str


class GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDRequest(BaseModel):
    meeting_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]

    call_recording_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]


GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDNotFoundType = Literal[
    "invalid_request_error",
]


GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDCode = Literal["not_found",]


class GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDIDTypedDict(TypedDict):
    workspace_id: str
    r"""The ID of the workspace this call recording belongs to."""
    meeting_id: str
    r"""The ID of the meeting associated with this call recording."""
    call_recording_id: str
    r"""The call recording ID of the call recording."""


class GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDID(BaseModel):
    workspace_id: str
    r"""The ID of the workspace this call recording belongs to."""

    meeting_id: str
    r"""The ID of the meeting associated with this call recording."""

    call_recording_id: str
    r"""The call recording ID of the call recording."""


GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDStatus = Literal[
    "processing",
    "completed",
    "failed",
]
r"""The status of the call recording. When a call recording is first created, it will have a status of `PROCESSING`. Once the recording is ready, it will transition to `COMPLETED`. If the recording fails for any reason, the status will be `FAILED`."""


GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDCreatedByActorType = Literal[
    "api-token",
    "workspace-member",
    "system",
    "app",
]
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDCreatedByActorTypedDict(
    TypedDict
):
    r"""The actor that created this call recording."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDCreatedByActorType]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDCreatedByActor(BaseModel):
    r"""The actor that created this call recording."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDCreatedByActorType
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = ["id", "type"]
        nullable_fields = ["id", "type"]
        null_default_fields = []

        serialized = handler(self)

        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k)
            serialized.pop(k, None)

            optional_nullable = k in optional_fields and k in nullable_fields
            is_set = (
                self.__pydantic_fields_set__.intersection({n})
                or k in null_default_fields
            )  # pylint: disable=no-member

            if val is not None and val != UNSET_SENTINEL:
                m[k] = val
            elif val != UNSET_SENTINEL and (
                not k in optional_fields or (optional_nullable and is_set)
            ):
                m[k] = val

        return m


class GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDDataTypedDict(TypedDict):
    id: GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDIDTypedDict
    status: GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDStatus
    r"""The status of the call recording. When a call recording is first created, it will have a status of `PROCESSING`. Once the recording is ready, it will transition to `COMPLETED`. If the recording fails for any reason, the status will be `FAILED`."""
    web_url: str
    r"""A URL that links directly to the call recording in the Attio web application."""
    created_by_actor: (
        GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDCreatedByActorTypedDict
    )
    r"""The actor that created this call recording."""
    created_at: str
    r"""The timestamp of when the call recording was created."""


class GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDData(BaseModel):
    id: GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDID

    status: GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDStatus
    r"""The status of the call recording. When a call recording is first created, it will have a status of `PROCESSING`. Once the recording is ready, it will transition to `COMPLETED`. If the recording fails for any reason, the status will be `FAILED`."""

    web_url: str
    r"""A URL that links directly to the call recording in the Attio web application."""

    created_by_actor: GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDCreatedByActor
    r"""The actor that created this call recording."""

    created_at: str
    r"""The timestamp of when the call recording was created."""


class GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDResponseTypedDict(TypedDict):
    r"""Success"""

    data: GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDDataTypedDict


class GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDResponse(BaseModel):
    r"""Success"""

    data: GetV2MeetingsMeetingIDCallRecordingsCallRecordingIDData
