# generated by datamodel-codegen:
#   filename:  sync-creatives-request.json
#   timestamp: 2025-11-15T22:03:55+00:00

from __future__ import annotations

from enum import Enum
from typing import Annotated, Any

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

from . import creative_asset
from . import push_notification_config as push_notification_config_1


class ValidationMode(Enum):
    strict = "strict"
    lenient = "lenient"


class SyncCreativesRequest(AdCPBaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    assignments: Annotated[
        dict[str, list[str]] | None,
        Field(description="Optional bulk assignment of creatives to packages"),
    ] = None
    context: Annotated[
        dict[str, Any] | None,
        Field(
            description="Initiator-provided context included in the request payload. Agents must echo this value back unchanged in responses and webhooks. Use for UI/session hints, correlation tokens, or tracking metadata."
        ),
    ] = None
    creatives: Annotated[
        list[creative_asset.CreativeAsset],
        Field(description="Array of creative assets to sync (create or update)", max_length=100),
    ]
    delete_missing: Annotated[
        bool | None,
        Field(
            description="When true, creatives not included in this sync will be archived. Use with caution for full library replacement."
        ),
    ] = False
    dry_run: Annotated[
        bool | None,
        Field(
            description="When true, preview changes without applying them. Returns what would be created/updated/deleted."
        ),
    ] = False
    patch: Annotated[
        bool | None,
        Field(
            description="When true, only provided fields are updated (partial update). When false, entire creative is replaced (full upsert)."
        ),
    ] = False
    push_notification_config: Annotated[
        push_notification_config_1.PushNotificationConfig | None,
        Field(
            description="Optional webhook configuration for async sync notifications. Publisher will send webhook when sync completes if operation takes longer than immediate response time (typically for large bulk operations or manual approval/HITL)."
        ),
    ] = None
    validation_mode: Annotated[
        ValidationMode | None,
        Field(
            description="Validation strictness. 'strict' fails entire sync on any validation error. 'lenient' processes valid creatives and reports errors."
        ),
    ] = ValidationMode.strict
