# generated by datamodel-codegen:
#   filename:  activate-signal-response.json
#   timestamp: 2025-11-15T22:03:55+00:00

from __future__ import annotations

from typing import Annotated, Any

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

from . import deployment, error


class ActivateSignalResponse1(AdCPBaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    context: Annotated[
        dict[str, Any] | None,
        Field(
            description="Initiator-provided context echoed inside the task payload. Opaque metadata such as UI/session hints, correlation tokens, or tracking identifiers."
        ),
    ] = None
    deployments: Annotated[
        list[deployment.Deployment1 | deployment.Deployment2],
        Field(description="Array of deployment results for each destination"),
    ]


class ActivateSignalResponse2(AdCPBaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    context: Annotated[
        dict[str, Any] | None,
        Field(
            description="Initiator-provided context echoed inside the task payload. Opaque metadata such as UI/session hints, correlation tokens, or tracking identifiers."
        ),
    ] = None
    errors: Annotated[
        list[error.Error],
        Field(
            description="Array of errors explaining why activation failed (e.g., platform connectivity issues, signal definition problems, authentication failures)",
            min_length=1,
        ),
    ]


class ActivateSignalResponse(RootModel[ActivateSignalResponse1 | ActivateSignalResponse2]):
    root: Annotated[
        ActivateSignalResponse1 | ActivateSignalResponse2,
        Field(
            description="Response payload for activate_signal task. Returns either complete success data OR error information, never both. This enforces atomic operation semantics - the signal is either fully activated or not activated at all.",
            title="Activate Signal Response",
        ),
    ]
