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 canonicalvar capabilityvar productvar 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_nondeterministicvar validated_failvar 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 setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config.Set
ADCP_STRICT_VALIDATION=1in the environment ("1","true","yes","on"are accepted) to flip the default toextra='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 adcpruns — mutatingos.environ["ADCP_STRICT_VALIDATION"]after the firstadcpimport 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_configon 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.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var id : strvar kind : Kindvar 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.' ), ] = NoneBase 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 setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config.Set
ADCP_STRICT_VALIDATION=1in the environment ("1","true","yes","on"are accepted) to flip the default toextra='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 adcpruns — mutatingos.environ["ADCP_STRICT_VALIDATION"]after the firstadcpimport 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_configon 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.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var macro_resolution_results : list[MacroResolutionResult] | Nonevar model_configvar result_kind : ResultKindvar target : Targetvar violations : list[Violation] | Nonevar 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.' ), ] = NoneBase 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 setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config.Set
ADCP_STRICT_VALIDATION=1in the environment ("1","true","yes","on"are accepted) to flip the default toextra='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 adcpruns — mutatingos.environ["ADCP_STRICT_VALIDATION"]after the firstadcpimport 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_configon 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.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var expected : typing.Any | Nonevar field : strvar model_configvar predicted : typing.Any | Nonevar retry_with : dict[str, typing.Any] | Nonevar 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 = NoneBase 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 setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config.Set
ADCP_STRICT_VALIDATION=1in the environment ("1","true","yes","on"are accepted) to flip the default toextra='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 adcpruns — mutatingos.environ["ADCP_STRICT_VALIDATION"]after the firstadcpimport 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_configon 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.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var expected : typing.Any | Nonevar model_configvar predicted : typing.Any | Nonevar rule : str
Inherited members