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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .batch_call_status import BatchCallStatus
from .batch_call_whats_app_params import BatchCallWhatsAppParams
from .outbound_call_recipient_response_model import OutboundCallRecipientResponseModel
from .telephony_call_config import TelephonyCallConfig
from .telephony_provider import TelephonyProvider


class BatchCallDetailedResponse(UncheckedBaseModel):
    """
    Detailed response model for a batch call including all recipients.
    """

    id: str
    phone_number_id: typing.Optional[str] = None
    phone_provider: typing.Optional[TelephonyProvider] = None
    whatsapp_params: typing.Optional[BatchCallWhatsAppParams] = None
    name: str
    agent_id: str
    branch_id: typing.Optional[str] = None
    environment: typing.Optional[str] = None
    created_at_unix: int
    scheduled_time_unix: int
    timezone: typing.Optional[str] = None
    total_calls_dispatched: int
    total_calls_scheduled: int
    total_calls_finished: int
    last_updated_at_unix: int
    status: BatchCallStatus
    retry_count: int
    telephony_call_config: TelephonyCallConfig
    target_concurrency_limit: typing.Optional[int] = pydantic.Field(default=None)
    """
    Maximum number of simultaneous calls for this batch. When set, dispatch is governed by this limit rather than workspace/agent capacity percentages.
    """

    agent_name: str
    branch_name: typing.Optional[str] = None
    recipients: typing.List[OutboundCallRecipientResponseModel]

    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
