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

from __future__ import annotations

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
from ..core.unchecked_base_model import UncheckedBaseModel
from .agent_metadata_response_model import AgentMetadataResponseModel
from .agent_platform_settings_response_model import AgentPlatformSettingsResponseModel
from .agent_workflow_response_model import AgentWorkflowResponseModel
from .conversational_config import ConversationalConfig
from .get_whats_app_account_response import GetWhatsAppAccountResponse
from .merge_preview_response_model_phone_numbers_item import MergePreviewResponseModelPhoneNumbersItem
from .resource_access_info import ResourceAccessInfo


class MergePreviewResponseModel(UncheckedBaseModel):
    agent_id: str = pydantic.Field()
    """
    The ID of the agent
    """

    name: str = pydantic.Field()
    """
    The name of the agent
    """

    conversation_config: ConversationalConfig = pydantic.Field()
    """
    The conversation configuration of the agent
    """

    metadata: AgentMetadataResponseModel = pydantic.Field()
    """
    The metadata of the agent
    """

    platform_settings: typing.Optional[AgentPlatformSettingsResponseModel] = pydantic.Field(default=None)
    """
    The platform settings of the agent
    """

    phone_numbers: typing.Optional[typing.List[MergePreviewResponseModelPhoneNumbersItem]] = pydantic.Field(
        default=None
    )
    """
    The phone numbers of the agent
    """

    whatsapp_accounts: typing.Optional[typing.List[GetWhatsAppAccountResponse]] = pydantic.Field(default=None)
    """
    WhatsApp accounts assigned to the agent
    """

    workflow: typing.Optional[AgentWorkflowResponseModel] = pydantic.Field(default=None)
    """
    The workflow of the agent
    """

    access_info: typing.Optional[ResourceAccessInfo] = pydantic.Field(default=None)
    """
    The access information of the agent for the user
    """

    tags: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Agent tags used to categorize the agent
    """

    version_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the version the agent is on
    """

    branch_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the branch the agent is on
    """

    main_branch_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the main branch for this agent
    """

    overridden_fields: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Dot-paths of config fields where both branches modified the same field relative to their common ancestor (conflicts). Present regardless of which side wins the conflict.
    """

    source_identical_to_target: typing.Optional[bool] = pydantic.Field(default=None)
    """
    True when the merge/rebase would be a no-op, i.e. the merged result is identical to the source branch tip. The rebase endpoint rejects in this case.
    """

    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


update_forward_refs(MergePreviewResponseModel)
