Module adcp.types.domains.creative.validate_input_result

Classes

class Kind (*args, **kwds)
Expand source code
class Kind(StrEnum):
    canonical = 'canonical'
    product = 'product'
    third_party_format = 'third_party_format'
    capability = 'capability'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var canonical
var capability
var product
var third_party_format
class ResultKind (*args, **kwds)
Expand source code
class ResultKind(StrEnum):
    validated_pass = 'validated_pass'
    validated_fail = 'validated_fail'
    unvalidatable_nondeterministic = 'unvalidatable_nondeterministic'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var unvalidatable_nondeterministic
var validated_fail
var validated_pass
class Target (**data: Any)
Expand source code
class Target(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    kind: Kind
    id: Annotated[
        str,
        Field(
            description="Canonical format name (e.g., 'image'), product_id, URI-form third-party format identifier, or agent-local creative capability_id."
        ),
    ]

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 id : str
var kind : Kind
var model_config

Inherited members

class ValidateInputResult (**data: Any)
Expand source code
class ValidateInputResult(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    target: Target
    result_kind: Annotated[
        ResultKind,
        Field(
            description="Discriminator for the validation outcome. See schema description for the three states. Replaces the earlier boolean `ok` to distinguish 'failed validation' from 'platform is nondeterministic, can't pre-validate'."
        ),
    ]
    violations: Annotated[
        list[Violation] | None,
        Field(
            description="When `result_kind` is `validated_fail`, the specific constraints the manifest fails to meet. MUST be absent (or empty) for `validated_pass` and `unvalidatable_nondeterministic` — neither has constraint violations to enumerate (`unvalidatable_nondeterministic` doesn't validate at all; `validated_pass` has nothing to fail)."
        ),
    ] = None
    warnings: Annotated[
        list[Warning] | None,
        Field(
            description='Non-blocking observations (e.g. LEAN policy advisories such as hover-triggered expansion or non-user-initiated entry into overlay anchoring) that do not affect `result_kind`. MAY be present alongside `validated_pass`, `validated_fail`, or `unvalidatable_nondeterministic`. Same item shape as `violations`.'
        ),
    ] = None
    macro_resolution_results: Annotated[
        list[macro_resolution_result.MacroResolutionResult] | None,
        Field(
            description='Per-token compatibility against the selected target. Required or unsafe `unsupported`/`ambiguous` results make the target `validated_fail`; deliberate preservation for the declared downstream resolver may still pass.'
        ),
    ] = 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 macro_resolution_results : list[MacroResolutionResult] | None
var model_config
var result_kind : ResultKind
var target : Target
var violations : list[Violation] | None
var warnings : list[Warning] | None

Inherited members

class Violation (**data: Any)
Expand source code
class Violation(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    rule: Annotated[
        str,
        Field(
            description="Rule name (e.g., 'duration_ms_range', 'aspect_ratio', 'max_file_size_kb')."
        ),
    ]
    expected: Annotated[
        Any | None, Field(description="Expected value or range (e.g., '28000-32000', '9:16', 200).")
    ] = None
    predicted: Annotated[
        Any | None,
        Field(
            description="Platform's pre-flight estimate for this field (NOT the actual output — there is no protocol state for orphaned out-of-spec artifacts). For TTS, this might be the predicted audio duration from text-length analysis. Helps the buyer fix the input before committing to a build."
        ),
    ] = None
    field: Annotated[
        str,
        Field(description="Path to the violating field (e.g., 'assets.video_main.duration_ms')."),
    ]
    retry_with: Annotated[
        dict[str, Any] | None,
        Field(
            description='Optional advisory adjustment hint. Platforms MAY suggest a corrected input shape; buyers MUST treat this as advisory, not authoritative.'
        ),
    ] = 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 expected : typing.Any | None
var field : str
var model_config
var predicted : typing.Any | None
var retry_with : dict[str, typing.Any] | None
var rule : str

Inherited members

class Warning (**data: Any)
Expand source code
class Warning(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    rule: str
    expected: Any | None = None
    predicted: Any | 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 expected : typing.Any | None
var model_config
var predicted : typing.Any | None
var rule : str

Inherited members