# 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 .get_phone_numbers_response_associated_pipeline import GetPhoneNumbersResponseAssociatedPipeline
from .get_phone_numbers_response_provider import GetPhoneNumbersResponseProvider


class GetPhoneNumbersResponse(UncheckedBaseModel):
    provider: typing.Optional[GetPhoneNumbersResponseProvider] = pydantic.Field(default=None)
    """
    Number provider:
    - `byo`: BYO (Bring Your Own)
    - `twilio`: Twilio
    """

    phone_number: typing.Optional[str] = pydantic.Field(default=None)
    """
    A telephone number in E.164 format, used as a unique identifier.
    """

    label: typing.Optional[str] = pydantic.Field(default=None)
    """
    A label used to identify the number.
    """

    inbound: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the number supports inbound calls.
    """

    outbound: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the number supports outbound calls.
    """

    associated_pipeline: typing.Optional[GetPhoneNumbersResponseAssociatedPipeline] = pydantic.Field(default=None)
    """
    The associated pipeline information. Returns `null` if no pipeline is associated.
    """

    inbound_config: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    SIP inbound call configuration details. Returns `null` if not configured.
    """

    outbound_config: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    SIP outbound call configuration details. Returns `null` if not configured.
    """

    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
