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

from __future__ import annotations
import dataclasses
import requests as requests_http
from ...models.components import agentpromptparams as components_agentpromptparams
from ...models.components import callphonenumber as components_callphonenumber
from dataclasses_json import Undefined, dataclass_json
from enum import Enum
from retellclient import utils
from typing import Any, List, Optional


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class PhoneNumber:
    r"""Phone number associated with the call."""
    from_: Any = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }})
    r"""Phone number you purchased in E.164 format. It would have an agent id associated with it."""
    to: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('to') }})
    r"""Callee phone number in E.164 format."""
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class CreatePhoneCallRequestBody:
    phone_number: PhoneNumber = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone_number') }})
    agent_prompt_params: Optional[List[components_agentpromptparams.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."""
    


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

class CreatePhoneCallCallType(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 CreatePhoneCallResponseBody:
    r"""Successfully retrieved an agent."""
    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: CreatePhoneCallCallType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('call_type') }})
    r"""Web call or phone call."""
    phone_number: components_callphonenumber.CallPhoneNumber = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone_number') }})
    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[components_agentpromptparams.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)."""
    



@dataclasses.dataclass
class CreatePhoneCallResponse:
    content_type: str = dataclasses.field()
    r"""HTTP response content type for this operation"""
    raw_response: requests_http.Response = dataclasses.field()
    r"""Raw HTTP response; suitable for custom response parsing"""
    status_code: int = dataclasses.field()
    r"""HTTP response status code for this operation"""
    call_detail: Optional[CreatePhoneCallResponseBody] = dataclasses.field(default=None)
    r"""Successfully retrieved an agent."""
    

