# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .call_agent import CallAgent
from .call_call_type import CallCallType


class Call(UniversalBaseModel):
    call_id: typing.Optional[str] = None
    call_dtm: typing.Optional[dt.datetime] = None
    agent_id: typing.Optional[str] = None
    agent_name: typing.Optional[str] = None
    call_type: typing.Optional[CallCallType] = None
    caller_phone_number: typing.Optional[str] = None
    agent_phone_number: typing.Optional[str] = None
    duration_sec: typing.Optional[float] = None
    call_end_reason: typing.Optional[str] = None
    call_purpose: typing.Optional[str] = None
    call_summary: typing.Optional[str] = None
    total_cost_usd: typing.Optional[float] = None
    credits_used: typing.Optional[int] = None
    duration_formatted: typing.Optional[str] = None
    tags: typing.Optional[typing.List[str]] = None
    agent: typing.Optional[CallAgent] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
