"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
from .agentpromptparams import AgentPromptParams
from .callphonenumber import CallPhoneNumber
from dataclasses_json import Undefined, dataclass_json
from enum import Enum
from retellclient import utils
from typing import List, Optional

class CallStatus(str, Enum):
    r"""Status of call."""
    ONGOING = 'ongoing'
    ENDED = 'ended'
    ERROR = 'error'

class CallType(str, Enum):
    r"""Web call or phone call."""
    INBOUND_PHONE_CALL = 'inbound_phone_call'
    OUTBOUND_PHONE_CALL = 'outbound_phone_call'
    WEB_CALL = 'web_call'


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class CallDetail:
    agent_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('agent_id') }})
    r"""Corresponding agent id of this call."""
    call_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('call_id') }})
    r"""Unique id of the call."""
    call_status: CallStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('call_status') }})
    r"""Status of call."""
    call_type: CallType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('call_type') }})
    r"""Web call or phone call."""
    start_timestamp: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('start_timestamp') }})
    r"""Begin timestamp (milliseconds since epoch) of the call."""
    agent_prompt_params: Optional[List[AgentPromptParams]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('agent_prompt_params'), 'exclude': lambda f: f is None }})
    r"""Supply values to your agent prompt parameters. If the given key value cannot match any param in prompt, it would have have any effect. Learn more about [Agent Prompt Parameters](/features/agent-prompt-parameter)."""
    end_timestamp: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('end_timestamp'), 'exclude': lambda f: f is None }})
    r"""End timestamp (milliseconds since epoch) of the call. Available after call ends."""
    phone_number: Optional[CallPhoneNumber] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone_number'), 'exclude': lambda f: f is None }})
    recording_url: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('recording_url'), 'exclude': lambda f: f is None }})
    r"""Recording of the call. Available after call ends."""
    transcript: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('transcript'), 'exclude': lambda f: f is None }})
    r"""Transcription of the call. Available after call ends."""
    

