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

import typing

from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ...core.request_options import RequestOptions
from ...types.campaign_submission_result import CampaignSubmissionResult
from ...types.campaign_validation_result import CampaignValidationResult
from ...types.extended_rcs_campaign import ExtendedRcsCampaign
from ...types.rcs_messaging_type_enum import RcsMessagingTypeEnum
from .raw_client import AsyncRawRcsClient, RawRcsClient
from .types.rcs_agent import RcsAgent
from .types.rcs_autofill_response import RcsAutofillResponse
from .types.rcs_campaign_keywords import RcsCampaignKeywords
from .types.rcs_campaign_traffic import RcsCampaignTraffic
from .types.rcs_links import RcsLinks
from .types.rcs_use_case import RcsUseCase

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class RcsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawRcsClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> RawRcsClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawRcsClient
        """
        return self._raw_client

    def autofill(
        self,
        *,
        additional_info: typing.Optional[str] = OMIT,
        campaign_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> RcsAutofillResponse:
        """
        Generate campaign details based off existing campaign and the brand it's connected to.

        Parameters
        ----------
        additional_info : typing.Optional[str]
            Any additional information you want to provide.

        campaign_id : typing.Optional[str]
            Unique identifier for the campaign.
            - When autofilling 10DLC campaigns, it must begin with the prefix `dlc_` (e.g., `dlc_1234567890`)
            - When autofilling Toll-Free campaigns, it must begin with the prefix `tf_` (e.g., `tf_1234567890`)
            - When autofilling RCS campaigns, it must begin with the prefix `rcs_` (e.g., `rcs_1234567890`)

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RcsAutofillResponse
            Returns autofilled RCS information.

        Examples
        --------
        from rcs import Pinnacle

        client = Pinnacle(
            api_key="YOUR_API_KEY",
        )
        client.campaigns.rcs.autofill(
            additional_info="Please autofill missing campaign fields using my brand profile",
            campaign_id="dlc_1234567890",
        )
        """
        _response = self._raw_client.autofill(
            additional_info=additional_info, campaign_id=campaign_id, request_options=request_options
        )
        return _response.data

    def get(self, campaign_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ExtendedRcsCampaign:
        """
        Retrieve RCS campaign.

        Parameters
        ----------
        campaign_id : str
            Unique identifier of the RCS campaign. Must begin with the prefix `rcs_`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ExtendedRcsCampaign
            Successfully retrieved.

        Examples
        --------
        from rcs import Pinnacle

        client = Pinnacle(
            api_key="YOUR_API_KEY",
        )
        client.campaigns.rcs.get(
            campaign_id="rcs_1234567890",
        )
        """
        _response = self._raw_client.get(campaign_id, request_options=request_options)
        return _response.data

    def submit(
        self, campaign_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> CampaignSubmissionResult:
        """
        Submit your RCS campaign for approval and activation with carriers.

        Parameters
        ----------
        campaign_id : str
            Unique identifier of the RCS campaign to retrieve. Must begin with the prefix `rcs_`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        CampaignSubmissionResult
            Successfully submitted RCS campaign for approval.

        Examples
        --------
        from rcs import Pinnacle

        client = Pinnacle(
            api_key="YOUR_API_KEY",
        )
        client.campaigns.rcs.submit(
            campaign_id="rcs_1234567890",
        )
        """
        _response = self._raw_client.submit(campaign_id, request_options=request_options)
        return _response.data

    def upsert(
        self,
        *,
        agent: typing.Optional[RcsAgent] = OMIT,
        brand: typing.Optional[str] = OMIT,
        campaign_id: typing.Optional[str] = OMIT,
        expected_agent_responses: typing.Optional[typing.Sequence[str]] = OMIT,
        links: typing.Optional[RcsLinks] = OMIT,
        use_case: typing.Optional[RcsUseCase] = OMIT,
        opt_in_terms_and_conditions: typing.Optional[str] = OMIT,
        messaging_type: typing.Optional[RcsMessagingTypeEnum] = OMIT,
        carrier_description: typing.Optional[str] = OMIT,
        keywords: typing.Optional[RcsCampaignKeywords] = OMIT,
        traffic: typing.Optional[RcsCampaignTraffic] = OMIT,
        agent_triggers: typing.Optional[str] = OMIT,
        interaction_description: typing.Optional[str] = OMIT,
        is_conversational: typing.Optional[bool] = OMIT,
        cta_language: typing.Optional[str] = OMIT,
        demo_trigger: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ExtendedRcsCampaign:
        """
        Create a new RCS campaign or update an existing one.

        <Note>
        **To create a new campaign:** Omit `campaignId` — one will be generated automatically.

        **Before you start:** Create a [brand](/api-reference/brands/upsert) first — you'll need its `id` for the [`brand`](#request.body.brand) field.

        All fields are **required** unless specified otherwise, and will be validated when [submitted](/api-reference/campaigns/rcs/submit).
        </Note>

        Parameters
        ----------
        agent : typing.Optional[RcsAgent]
            Create an agent for the campaign.

        brand : typing.Optional[str]
            Unique identifier for the brand.

        campaign_id : typing.Optional[str]
            Unique identifier for the campaign.

        expected_agent_responses : typing.Optional[typing.Sequence[str]]
            List of what the agent might say to users. See the [Expected Agent Responses](/guides/campaigns/rcs-compliance#expected-agent-responses) section for requirements. <br><br>
            **Limit:** 1 to 5

        links : typing.Optional[RcsLinks]
            Legal documentation links.

        use_case : typing.Optional[RcsUseCase]
            Use case classification for the campaign.

        opt_in_terms_and_conditions : typing.Optional[str]
            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.Optional[RcsMessagingTypeEnum]

        carrier_description : typing.Optional[str]
            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[RcsCampaignKeywords]

        traffic : typing.Optional[RcsCampaignTraffic]

        agent_triggers : typing.Optional[str]
            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.Optional[str]
            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.Optional[bool]
            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.Optional[str]
            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.Optional[str]
            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.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ExtendedRcsCampaign
            Successfully created or updated RCS campaign.

        Examples
        --------
        from rcs import Pinnacle
        from rcs.campaigns.rcs import (
            RcsAgent,
            RcsAgentEmail,
            RcsAgentPhone,
            RcsAgentWebsite,
            RcsCampaignHelpKeywords,
            RcsCampaignKeywords,
            RcsCampaignOptInKeywords,
            RcsCampaignOptOutKeywords,
            RcsCampaignTraffic,
            RcsLinks,
            RcsUseCase,
        )

        client = Pinnacle(
            api_key="YOUR_API_KEY",
        )
        client.campaigns.rcs.upsert(
            agent=RcsAgent(
                color="#000000",
                description="Experience the power of RCS messaging with interactive demos. Test rich features like carousels, suggested replies, and media sharing. Get started with our developer-friendly APIs.",
                emails=[
                    RcsAgentEmail(
                        email="founders@trypinnacle.app",
                        label="Email Us",
                    )
                ],
                hero_url="https://pncl.to/D6pDSqGxqgfbCfQmw4gXdnlHu4uSB4",
                icon_url="https://pncl.to/mq_tdIDenRb5eYpJiM8-3THCaUBrZP",
                name="Pinnacle - RCS Demo",
                phones=[
                    RcsAgentPhone(
                        label="Contact us directly",
                        phone="+14154467821",
                    )
                ],
                websites=[
                    RcsAgentWebsite(
                        label="Get started with Pinnacle",
                        url="https://www.trypinnacle.app/",
                    )
                ],
            ),
            brand="b_1234567890",
            campaign_id="rcs_1234567890",
            expected_agent_responses=[
                "Here are the things I can help you with.",
                "I can assist you with booking an appointment, or you may choose to book manually.",
                "Here are the available times to connect with a representative tomorrow.",
                "Your appointment has been scheduled.",
            ],
            links=RcsLinks(
                privacy_policy="https://www.trypinnacle.app/privacy",
                terms_of_service="https://www.trypinnacle.app/terms",
            ),
            use_case=RcsUseCase(
                behavior="Pinnacle is a developer-focused RCS assistant that helps teams design, test, and optimize rich messaging experiences across SMS, MMS, and RCS. The agent acts as both an “onboarding guide” for new customers and a “best-practices coach” for existing teams exploring higher-value RCS workflows like rich cards, carousels, and suggested actions.<br>\nThe agent delivers a mix of operational updates and educational content (2–6 messages/month). Content includes important platform notices (e.g., deliverability or throughput changes), implementation tips with sample RCS templates, and personalized recommendations on how to upgrade existing SMS campaigns into richer, higher-converting RCS conversations.\n",
                value="OTHER",
            ),
            opt_in_terms_and_conditions="We ensure consent through an explicit opt-in process that follows 10DLC best practices.Users must agree to receive messages from Pinnacle before the agent sends them any messages.<br>\nUsers agree to these messages by signing an opt-in paper form that they can be found online at https://www.pinnacle.sh/opt-in. We only send messages once users have filled out the form and submitted it to us via email or through the dashboard.\n",
            messaging_type="MULTI_USE",
            carrier_description="Demonstrate the power of RCS to medium and large companies already sending massive SMS/MMS volumes through our platform. These clients send conversational messages in industries such as commerce, appointments, and customer support.",
            keywords=RcsCampaignKeywords(
                help=RcsCampaignHelpKeywords(
                    message="Email founders@trypinnacle.app for support.",
                    keywords=["HELP", "SUPPORT"],
                ),
                opt_in=RcsCampaignOptInKeywords(
                    message="Welcome back to Pinnacle!<br>\n🔔 You're now subscribed to Pinnacle - RCS Demo and will continue receiving important updates and news. Feel free to contact this us at any time for help.<br>\n\nReply STOP to opt out and HELP for support. Message & rates may apply.\n",
                    keywords=["START", "SUBSCRIBE"],
                ),
                opt_out=RcsCampaignOptOutKeywords(
                    message="You've been unsubscribed from Pinnacle - RCS Demo and will no longer receive notifications. If you ever change your mind, reply START or SUBSCRIBE to rejoin anytime.",
                    keywords=["STOP", "UNSUBSCRIBE", "END"],
                ),
            ),
            traffic=RcsCampaignTraffic(
                monthly_website=10000,
                monthly_rcs_estimate=10000,
            ),
            agent_triggers="The agent sends the first message when the user subscribes to Pinnacle. Messages are based on user actions such as pressing suggestion buttons. External triggers such as reminders can be setup by users in advance for a later time.",
            interaction_description="The agent's primary interaction will be customer service — helping users with questions, troubleshooting issues, and providing quick assistance through chat. Other interactions include appointment management and sending notifications to the user.",
            is_conversational=True,
            cta_language="By checking this box and submitting this form, you consent to receive transactional text messages for support, appointment, and reminder messages from Pinnacle Software Development Inc. Reply STOP to opt out. Reply HELP for help. Standard message and data rates may apply. Message frequency may vary. View our Terms and Conditions at https://www.pinnacle.sh/terms. View our Privacy Policy at https://www.pinnacle.sh/privacy.",
            demo_trigger='Text "START" to trigger the flow.',
        )
        """
        _response = self._raw_client.upsert(
            agent=agent,
            brand=brand,
            campaign_id=campaign_id,
            expected_agent_responses=expected_agent_responses,
            links=links,
            use_case=use_case,
            opt_in_terms_and_conditions=opt_in_terms_and_conditions,
            messaging_type=messaging_type,
            carrier_description=carrier_description,
            keywords=keywords,
            traffic=traffic,
            agent_triggers=agent_triggers,
            interaction_description=interaction_description,
            is_conversational=is_conversational,
            cta_language=cta_language,
            demo_trigger=demo_trigger,
            request_options=request_options,
        )
        return _response.data

    def validate(
        self,
        *,
        campaign_id: str,
        additional_info: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CampaignValidationResult:
        """
        Validate your RCS campaign configuration against carrier requirements and compliance rules.

        Parameters
        ----------
        campaign_id : str
            Unique identifier for the campaign.
            - When validating 10DLC campaigns, it must begin with the prefix `dlc_` (e.g., `dlc_1234567890`)
            - When validating toll-free campaigns, it must begin with the prefix `tf_` (e.g., `tf_1234567890`)
            - When validating RCS campaigns, it must begin with the prefix `rcs_` (e.g., `rcs_1234567890`)

        additional_info : typing.Optional[str]
            Any additional information you want to provide.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        CampaignValidationResult
            Returns validation results.

        Examples
        --------
        from rcs import Pinnacle

        client = Pinnacle(
            api_key="YOUR_API_KEY",
        )
        client.campaigns.rcs.validate(
            additional_info="Please validate this DLC campaign for 10DLC compliance",
            campaign_id="dlc_1234567890",
        )
        """
        _response = self._raw_client.validate(
            campaign_id=campaign_id, additional_info=additional_info, request_options=request_options
        )
        return _response.data


class AsyncRcsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawRcsClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> AsyncRawRcsClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawRcsClient
        """
        return self._raw_client

    async def autofill(
        self,
        *,
        additional_info: typing.Optional[str] = OMIT,
        campaign_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> RcsAutofillResponse:
        """
        Generate campaign details based off existing campaign and the brand it's connected to.

        Parameters
        ----------
        additional_info : typing.Optional[str]
            Any additional information you want to provide.

        campaign_id : typing.Optional[str]
            Unique identifier for the campaign.
            - When autofilling 10DLC campaigns, it must begin with the prefix `dlc_` (e.g., `dlc_1234567890`)
            - When autofilling Toll-Free campaigns, it must begin with the prefix `tf_` (e.g., `tf_1234567890`)
            - When autofilling RCS campaigns, it must begin with the prefix `rcs_` (e.g., `rcs_1234567890`)

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RcsAutofillResponse
            Returns autofilled RCS information.

        Examples
        --------
        import asyncio

        from rcs import AsyncPinnacle

        client = AsyncPinnacle(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.campaigns.rcs.autofill(
                additional_info="Please autofill missing campaign fields using my brand profile",
                campaign_id="dlc_1234567890",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.autofill(
            additional_info=additional_info, campaign_id=campaign_id, request_options=request_options
        )
        return _response.data

    async def get(
        self, campaign_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ExtendedRcsCampaign:
        """
        Retrieve RCS campaign.

        Parameters
        ----------
        campaign_id : str
            Unique identifier of the RCS campaign. Must begin with the prefix `rcs_`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ExtendedRcsCampaign
            Successfully retrieved.

        Examples
        --------
        import asyncio

        from rcs import AsyncPinnacle

        client = AsyncPinnacle(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.campaigns.rcs.get(
                campaign_id="rcs_1234567890",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get(campaign_id, request_options=request_options)
        return _response.data

    async def submit(
        self, campaign_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> CampaignSubmissionResult:
        """
        Submit your RCS campaign for approval and activation with carriers.

        Parameters
        ----------
        campaign_id : str
            Unique identifier of the RCS campaign to retrieve. Must begin with the prefix `rcs_`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        CampaignSubmissionResult
            Successfully submitted RCS campaign for approval.

        Examples
        --------
        import asyncio

        from rcs import AsyncPinnacle

        client = AsyncPinnacle(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.campaigns.rcs.submit(
                campaign_id="rcs_1234567890",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.submit(campaign_id, request_options=request_options)
        return _response.data

    async def upsert(
        self,
        *,
        agent: typing.Optional[RcsAgent] = OMIT,
        brand: typing.Optional[str] = OMIT,
        campaign_id: typing.Optional[str] = OMIT,
        expected_agent_responses: typing.Optional[typing.Sequence[str]] = OMIT,
        links: typing.Optional[RcsLinks] = OMIT,
        use_case: typing.Optional[RcsUseCase] = OMIT,
        opt_in_terms_and_conditions: typing.Optional[str] = OMIT,
        messaging_type: typing.Optional[RcsMessagingTypeEnum] = OMIT,
        carrier_description: typing.Optional[str] = OMIT,
        keywords: typing.Optional[RcsCampaignKeywords] = OMIT,
        traffic: typing.Optional[RcsCampaignTraffic] = OMIT,
        agent_triggers: typing.Optional[str] = OMIT,
        interaction_description: typing.Optional[str] = OMIT,
        is_conversational: typing.Optional[bool] = OMIT,
        cta_language: typing.Optional[str] = OMIT,
        demo_trigger: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ExtendedRcsCampaign:
        """
        Create a new RCS campaign or update an existing one.

        <Note>
        **To create a new campaign:** Omit `campaignId` — one will be generated automatically.

        **Before you start:** Create a [brand](/api-reference/brands/upsert) first — you'll need its `id` for the [`brand`](#request.body.brand) field.

        All fields are **required** unless specified otherwise, and will be validated when [submitted](/api-reference/campaigns/rcs/submit).
        </Note>

        Parameters
        ----------
        agent : typing.Optional[RcsAgent]
            Create an agent for the campaign.

        brand : typing.Optional[str]
            Unique identifier for the brand.

        campaign_id : typing.Optional[str]
            Unique identifier for the campaign.

        expected_agent_responses : typing.Optional[typing.Sequence[str]]
            List of what the agent might say to users. See the [Expected Agent Responses](/guides/campaigns/rcs-compliance#expected-agent-responses) section for requirements. <br><br>
            **Limit:** 1 to 5

        links : typing.Optional[RcsLinks]
            Legal documentation links.

        use_case : typing.Optional[RcsUseCase]
            Use case classification for the campaign.

        opt_in_terms_and_conditions : typing.Optional[str]
            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.Optional[RcsMessagingTypeEnum]

        carrier_description : typing.Optional[str]
            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[RcsCampaignKeywords]

        traffic : typing.Optional[RcsCampaignTraffic]

        agent_triggers : typing.Optional[str]
            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.Optional[str]
            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.Optional[bool]
            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.Optional[str]
            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.Optional[str]
            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.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ExtendedRcsCampaign
            Successfully created or updated RCS campaign.

        Examples
        --------
        import asyncio

        from rcs import AsyncPinnacle
        from rcs.campaigns.rcs import (
            RcsAgent,
            RcsAgentEmail,
            RcsAgentPhone,
            RcsAgentWebsite,
            RcsCampaignHelpKeywords,
            RcsCampaignKeywords,
            RcsCampaignOptInKeywords,
            RcsCampaignOptOutKeywords,
            RcsCampaignTraffic,
            RcsLinks,
            RcsUseCase,
        )

        client = AsyncPinnacle(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.campaigns.rcs.upsert(
                agent=RcsAgent(
                    color="#000000",
                    description="Experience the power of RCS messaging with interactive demos. Test rich features like carousels, suggested replies, and media sharing. Get started with our developer-friendly APIs.",
                    emails=[
                        RcsAgentEmail(
                            email="founders@trypinnacle.app",
                            label="Email Us",
                        )
                    ],
                    hero_url="https://pncl.to/D6pDSqGxqgfbCfQmw4gXdnlHu4uSB4",
                    icon_url="https://pncl.to/mq_tdIDenRb5eYpJiM8-3THCaUBrZP",
                    name="Pinnacle - RCS Demo",
                    phones=[
                        RcsAgentPhone(
                            label="Contact us directly",
                            phone="+14154467821",
                        )
                    ],
                    websites=[
                        RcsAgentWebsite(
                            label="Get started with Pinnacle",
                            url="https://www.trypinnacle.app/",
                        )
                    ],
                ),
                brand="b_1234567890",
                campaign_id="rcs_1234567890",
                expected_agent_responses=[
                    "Here are the things I can help you with.",
                    "I can assist you with booking an appointment, or you may choose to book manually.",
                    "Here are the available times to connect with a representative tomorrow.",
                    "Your appointment has been scheduled.",
                ],
                links=RcsLinks(
                    privacy_policy="https://www.trypinnacle.app/privacy",
                    terms_of_service="https://www.trypinnacle.app/terms",
                ),
                use_case=RcsUseCase(
                    behavior="Pinnacle is a developer-focused RCS assistant that helps teams design, test, and optimize rich messaging experiences across SMS, MMS, and RCS. The agent acts as both an “onboarding guide” for new customers and a “best-practices coach” for existing teams exploring higher-value RCS workflows like rich cards, carousels, and suggested actions.<br>\nThe agent delivers a mix of operational updates and educational content (2–6 messages/month). Content includes important platform notices (e.g., deliverability or throughput changes), implementation tips with sample RCS templates, and personalized recommendations on how to upgrade existing SMS campaigns into richer, higher-converting RCS conversations.\n",
                    value="OTHER",
                ),
                opt_in_terms_and_conditions="We ensure consent through an explicit opt-in process that follows 10DLC best practices.Users must agree to receive messages from Pinnacle before the agent sends them any messages.<br>\nUsers agree to these messages by signing an opt-in paper form that they can be found online at https://www.pinnacle.sh/opt-in. We only send messages once users have filled out the form and submitted it to us via email or through the dashboard.\n",
                messaging_type="MULTI_USE",
                carrier_description="Demonstrate the power of RCS to medium and large companies already sending massive SMS/MMS volumes through our platform. These clients send conversational messages in industries such as commerce, appointments, and customer support.",
                keywords=RcsCampaignKeywords(
                    help=RcsCampaignHelpKeywords(
                        message="Email founders@trypinnacle.app for support.",
                        keywords=["HELP", "SUPPORT"],
                    ),
                    opt_in=RcsCampaignOptInKeywords(
                        message="Welcome back to Pinnacle!<br>\n🔔 You're now subscribed to Pinnacle - RCS Demo and will continue receiving important updates and news. Feel free to contact this us at any time for help.<br>\n\nReply STOP to opt out and HELP for support. Message & rates may apply.\n",
                        keywords=["START", "SUBSCRIBE"],
                    ),
                    opt_out=RcsCampaignOptOutKeywords(
                        message="You've been unsubscribed from Pinnacle - RCS Demo and will no longer receive notifications. If you ever change your mind, reply START or SUBSCRIBE to rejoin anytime.",
                        keywords=["STOP", "UNSUBSCRIBE", "END"],
                    ),
                ),
                traffic=RcsCampaignTraffic(
                    monthly_website=10000,
                    monthly_rcs_estimate=10000,
                ),
                agent_triggers="The agent sends the first message when the user subscribes to Pinnacle. Messages are based on user actions such as pressing suggestion buttons. External triggers such as reminders can be setup by users in advance for a later time.",
                interaction_description="The agent's primary interaction will be customer service — helping users with questions, troubleshooting issues, and providing quick assistance through chat. Other interactions include appointment management and sending notifications to the user.",
                is_conversational=True,
                cta_language="By checking this box and submitting this form, you consent to receive transactional text messages for support, appointment, and reminder messages from Pinnacle Software Development Inc. Reply STOP to opt out. Reply HELP for help. Standard message and data rates may apply. Message frequency may vary. View our Terms and Conditions at https://www.pinnacle.sh/terms. View our Privacy Policy at https://www.pinnacle.sh/privacy.",
                demo_trigger='Text "START" to trigger the flow.',
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.upsert(
            agent=agent,
            brand=brand,
            campaign_id=campaign_id,
            expected_agent_responses=expected_agent_responses,
            links=links,
            use_case=use_case,
            opt_in_terms_and_conditions=opt_in_terms_and_conditions,
            messaging_type=messaging_type,
            carrier_description=carrier_description,
            keywords=keywords,
            traffic=traffic,
            agent_triggers=agent_triggers,
            interaction_description=interaction_description,
            is_conversational=is_conversational,
            cta_language=cta_language,
            demo_trigger=demo_trigger,
            request_options=request_options,
        )
        return _response.data

    async def validate(
        self,
        *,
        campaign_id: str,
        additional_info: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CampaignValidationResult:
        """
        Validate your RCS campaign configuration against carrier requirements and compliance rules.

        Parameters
        ----------
        campaign_id : str
            Unique identifier for the campaign.
            - When validating 10DLC campaigns, it must begin with the prefix `dlc_` (e.g., `dlc_1234567890`)
            - When validating toll-free campaigns, it must begin with the prefix `tf_` (e.g., `tf_1234567890`)
            - When validating RCS campaigns, it must begin with the prefix `rcs_` (e.g., `rcs_1234567890`)

        additional_info : typing.Optional[str]
            Any additional information you want to provide.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        CampaignValidationResult
            Returns validation results.

        Examples
        --------
        import asyncio

        from rcs import AsyncPinnacle

        client = AsyncPinnacle(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.campaigns.rcs.validate(
                additional_info="Please validate this DLC campaign for 10DLC compliance",
                campaign_id="dlc_1234567890",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.validate(
            campaign_id=campaign_id, additional_info=additional_info, request_options=request_options
        )
        return _response.data
