# 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 .position_output import PositionOutput
from .transfer_type_enum import TransferTypeEnum
from .workflow_phone_number_node_model_output_custom_sip_headers_item import (
    WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem,
)
from .workflow_phone_number_node_model_output_post_dial_digits import WorkflowPhoneNumberNodeModelOutputPostDialDigits
from .workflow_phone_number_node_model_output_transfer_destination import (
    WorkflowPhoneNumberNodeModelOutputTransferDestination,
)


class WorkflowPhoneNumberNodeModelOutput(UncheckedBaseModel):
    custom_sip_headers: typing.List[WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem] = pydantic.Field()
    """
    Custom SIP headers to include when transferring the call. Each header can be either a static value or a dynamic variable reference.
    """

    transfer_destination: WorkflowPhoneNumberNodeModelOutputTransferDestination
    transfer_type: TransferTypeEnum
    post_dial_digits: typing.Optional[WorkflowPhoneNumberNodeModelOutputPostDialDigits] = pydantic.Field(default=None)
    """
    DTMF digits to send after call connects (e.g., 'ww1234' for extension). Can be either a static value or a dynamic variable reference. Use 'w' for 0.5s pause. Only supported for Twilio transfers.
    """

    position: PositionOutput = pydantic.Field()
    """
    Position of the node in the workflow.
    """

    edge_order: typing.List[str] = pydantic.Field()
    """
    The ids of outgoing edges in the order they should be evaluated.
    """

    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
