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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .rcs_campaign_schema_agent import RcsCampaignSchemaAgent
from .rcs_campaign_schema_keywords import RcsCampaignSchemaKeywords
from .rcs_campaign_schema_links import RcsCampaignSchemaLinks
from .rcs_campaign_schema_traffic import RcsCampaignSchemaTraffic
from .rcs_campaign_schema_use_case import RcsCampaignSchemaUseCase
from .rcs_messaging_type_enum import RcsMessagingTypeEnum


class RcsCampaign(UniversalBaseModel):
    agent: typing.Optional[RcsCampaignSchemaAgent] = pydantic.Field(default=None)
    """
    Agent configured to the campaign.
    """

    campaign_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="campaignId")] = pydantic.Field(
        default=None
    )
    """
    Unique identifier for the campaign.
    """

    expected_agent_responses: typing_extensions.Annotated[
        typing.Optional[typing.List[str]], FieldMetadata(alias="expectedAgentResponses")
    ] = pydantic.Field(default=None)
    """
    List of what the agent might say to users. See the [Expected Agent Responses](/guides/campaigns/rcs-compliance#expected-agent-responses) section for requirements.
    """

    links: typing.Optional[RcsCampaignSchemaLinks] = pydantic.Field(default=None)
    """
    Legal documentation links.
    """

    use_case: typing_extensions.Annotated[typing.Optional[RcsCampaignSchemaUseCase], FieldMetadata(alias="useCase")] = (
        pydantic.Field(default=None)
    )
    """
    Use case classification for the campaign.
    """

    opt_in_terms_and_conditions: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="optInTermsAndConditions")
    ] = pydantic.Field(default=None)
    """
    Details on how opt-in is acquired. If it is done through a website or app, provide the link. See the [Opt-In Terms and Conditions](/guides/campaigns/rcs-compliance#opt-in-terms-and-conditions) section for requirements.
    """

    messaging_type: typing_extensions.Annotated[
        typing.Optional[RcsMessagingTypeEnum], FieldMetadata(alias="messagingType")
    ] = None
    carrier_description: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="carrierDescription")
    ] = pydantic.Field(default=None)
    """
    Description of the agent's purpose, shown to carriers for approval. See the [Carrier Description](/guides/campaigns/rcs-compliance#carrier-description) section for requirements.
    """

    keywords: typing.Optional[RcsCampaignSchemaKeywords] = None
    traffic: typing.Optional[RcsCampaignSchemaTraffic] = None
    agent_triggers: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="agentTriggers")] = (
        pydantic.Field(default=None)
    )
    """
    Explanation of how the agent is triggered. This includes how the first message is delivered, whether messages follow a schedule or triggered by user actions, and any external triggers. See the [Agent Triggers](/guides/campaigns/rcs-compliance#agent-triggers) section for requirements.
    """

    interaction_description: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="interactionDescription")
    ] = pydantic.Field(default=None)
    """
    Description of all agent interactions, including primary and secondary use cases. See the [Interaction Description](/guides/campaigns/rcs-compliance#interaction-description) section for requirements.
    """

    is_conversational: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="isConversational")] = (
        pydantic.Field(default=None)
    )
    """
    Whether the agent supports conversational flows or respond to P2A messages from the users. Set to false for one-way messages from agent to user.
    """

    cta_language: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="ctaLanguage")] = (
        pydantic.Field(default=None)
    )
    """
    Required text that appears next to the opt-in checkbox for your opt-in form. This checkbox has to be unchecked by default. See the [CTA Language](/guides/campaigns/rcs-compliance#cta-language-opt-in-disclosure) section for requirements.
    """

    demo_trigger: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="demoTrigger")] = (
        pydantic.Field(default=None)
    )
    """
    Instructions on how an external reviewer can trigger messages and an example flow from the agent. This is usually an inbound text message to the agent that will start a flow of messages between the agent and the user. See the [Demo Trigger](/guides/campaigns/rcs-compliance#demo-trigger) section for requirements.
    """

    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
