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

from __future__ import annotations

from enum import Enum
from typing import Annotated, Any

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

from ..core import error
from ..core import ext as ext_1


class AcpHandoff(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    checkout_token: Annotated[str | None, Field(description='Token for ACP checkout flow')] = None
    checkout_url: Annotated[AnyUrl | None, Field(description='ACP checkout initiation URL')] = None
    product: Annotated[dict[str, Any] | None, Field(description='Product details for checkout')] = (
        None
    )


class Action(Enum):
    save_for_later = 'save_for_later'
    set_reminder = 'set_reminder'
    subscribe_updates = 'subscribe_updates'
    none = 'none'


class FollowUp(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    action: Action | None = None
    data: Annotated[dict[str, Any] | None, Field(description='Data for follow-up action')] = None


class SiTerminateSessionResponse(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    acp_handoff: Annotated[
        AcpHandoff | None, Field(description='ACP checkout handoff data (for handoff_transaction)')
    ] = None
    errors: list[error.Error] | None = None
    ext: ext_1.ExtensionObject | None = None
    follow_up: Annotated[FollowUp | None, Field(description='Suggested follow-up actions')] = None
    session_id: Annotated[str, Field(description='Terminated session identifier')]
    terminated: Annotated[bool, Field(description='Whether session was successfully terminated')]
