Module adcp.types.domains.content_standards.artifact_webhook_payload

Classes

class Artifact (**data: Any)
Expand source code
class Artifact(AdCPBaseModel):
    artifact: Annotated[artifact_1.Artifact, Field(description='The content artifact')]
    delivered_at: Annotated[
        AwareDatetime, Field(description='When the impression was delivered (ISO 8601)')
    ]
    impression_id: Annotated[
        str | None,
        Field(description='Optional impression identifier for correlation with delivery reports'),
    ] = None
    package_id: Annotated[
        str | None, Field(description='Package within the media buy this artifact relates to')
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var artifact : Artifact
var delivered_at : pydantic.types.AwareDatetime
var impression_id : str | None
var model_config
var package_id : str | None

Inherited members

class ArtifactWebhookPayload (**data: Any)
Expand source code
class ArtifactWebhookPayload(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    idempotency_key: Annotated[
        str,
        Field(
            description='Sender-generated key stable across retries of the same webhook event. Sales agents MUST generate a cryptographically random value (UUID v4 recommended) per distinct emission of a batch and reuse the same key on every retry. Recipients MUST dedupe by this key, scoped to the authenticated sender identity (HMAC secret or Bearer credential) — keys from different sales agents are independent. Distinct from `batch_id`, which identifies the logical batch: `idempotency_key` identifies this specific emission event, so a re-emission of the same `batch_id` (e.g., after a correction) is a different event and MUST carry a fresh `idempotency_key`.',
            max_length=255,
            min_length=16,
            pattern='^[A-Za-z0-9_.:-]{16,255}$',
        ),
    ]
    media_buy_id: Annotated[
        str, Field(description='Media buy identifier these artifacts belong to')
    ]
    batch_id: Annotated[
        str,
        Field(
            description='Unique identifier for this batch of artifacts. Use for deduplication and acknowledgment.'
        ),
    ]
    timestamp: Annotated[
        AwareDatetime, Field(description='When this batch was generated (ISO 8601)')
    ]
    artifacts: Annotated[
        list[Artifact], Field(description='Content artifacts from delivered impressions')
    ]
    pagination: Annotated[
        Pagination | None, Field(description='Pagination info when batching large artifact sets')
    ] = None
    ext: ext_1.ExtensionObject | None = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var artifacts : list[Artifact]
var batch_id : str
var ext : ExtensionObject | None
var idempotency_key : str
var media_buy_id : str
var model_config
var pagination : Pagination | None
var timestamp : pydantic.types.AwareDatetime

Inherited members

class Pagination (**data: Any)
Expand source code
class Pagination(AdCPBaseModel):
    total_artifacts: Annotated[
        SchemaInt | None, Field(description='Total artifacts in the delivery period')
    ] = None
    batch_number: Annotated[
        SchemaInt | None, Field(description='Current batch number (1-indexed)')
    ] = None
    total_batches: Annotated[
        SchemaInt | None, Field(description='Total batches for this delivery period')
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var batch_number : int | None
var model_config
var total_artifacts : int | None
var total_batches : int | None

Inherited members