# generated by datamodel-codegen:
#   filename:  sponsored_intelligence/si_send_message_request.json
#   timestamp: 2026-02-23T01:56:40+00:00

from __future__ import annotations

from typing import Annotated, Any

from adcp.types.base import AdCPBaseModel
from pydantic import ConfigDict, Field, RootModel

from ..core import ext as ext_1


class ActionResponse(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    action: Annotated[str | None, Field(description='The action that was triggered')] = None
    payload: Annotated[
        dict[str, Any] | None, Field(description='Action-specific response data')
    ] = None


class SiSendMessageRequest1(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    action_response: Annotated[
        ActionResponse | None,
        Field(description='Response to a previous action_button (e.g., user clicked checkout)'),
    ] = None
    ext: ext_1.ExtensionObject | None = None
    message: Annotated[str, Field(description="User's message to the brand agent")]
    session_id: Annotated[str, Field(description='Active session identifier')]


class SiSendMessageRequest2(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    action_response: Annotated[
        ActionResponse,
        Field(description='Response to a previous action_button (e.g., user clicked checkout)'),
    ]
    ext: ext_1.ExtensionObject | None = None
    message: Annotated[str | None, Field(description="User's message to the brand agent")] = None
    session_id: Annotated[str, Field(description='Active session identifier')]


class SiSendMessageRequest(RootModel[SiSendMessageRequest1 | SiSendMessageRequest2]):
    root: Annotated[
        SiSendMessageRequest1 | SiSendMessageRequest2,
        Field(
            description='Send a message to the brand agent within an active session',
            title='SI Send Message Request',
        ),
    ]
