Module adcp.types.generated_poc.preview_creative_request

Classes

class Input (**data: Any)
Expand source code
class Input(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    context_description: Annotated[
        str | None,
        Field(
            description="Natural language description of the context for AI-generated content (e.g., 'User just searched for running shoes', 'Podcast discussing weather patterns', 'Article about electric vehicles')"
        ),
    ] = None
    macros: Annotated[
        dict[str, str] | None,
        Field(
            description="Macro values to use for this preview. Supports all universal macros from the format's supported_macros list. See docs/media-buy/creatives/universal-macros.md for available macros."
        ),
    ] = None
    name: Annotated[
        str,
        Field(
            description="Human-readable name for this input set (e.g., 'Sunny morning on mobile', 'Evening podcast ad', 'Desktop dark mode')"
        ),
    ]

Base model for AdCP types with spec-compliant serialization.

AdCP JSON schemas use additionalProperties: false and do not allow null for optional fields. Therefore, optional fields must be omitted entirely when not present (not sent as null).

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 context_description : str | None
var macros : dict[str, str] | None
var model_config
var name : str

Inherited members

class Input2 (**data: Any)
Expand source code
class Input2(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    context_description: Annotated[
        str | None,
        Field(description='Natural language description of the context for AI-generated content'),
    ] = None
    macros: Annotated[
        dict[str, str] | None, Field(description='Macro values to use for this preview')
    ] = None
    name: Annotated[str, Field(description='Human-readable name for this input set')]

Base model for AdCP types with spec-compliant serialization.

AdCP JSON schemas use additionalProperties: false and do not allow null for optional fields. Therefore, optional fields must be omitted entirely when not present (not sent as null).

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 context_description : str | None
var macros : dict[str, str] | None
var model_config
var name : str

Inherited members

class OutputFormat (*args, **kwds)
Expand source code
class OutputFormat(Enum):
    url = 'url'
    html = 'html'

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access::
>>> Color.RED
<Color.RED: 1>
  • value lookup:
>>> Color(1)
<Color.RED: 1>
  • name lookup:
>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ancestors

  • enum.Enum

Class variables

var html
var url
class PreviewCreativeRequest (root: RootModelRootType = PydanticUndefined, **data)
Expand source code
class PreviewCreativeRequest(RootModel[PreviewCreativeRequest1 | PreviewCreativeRequest2]):
    root: Annotated[
        PreviewCreativeRequest1 | PreviewCreativeRequest2,
        Field(
            description='Request to generate previews of one or more creative manifests. Accepts either a single creative request or an array of requests for batch processing.',
            title='Preview Creative Request',
        ),
    ]

Usage Documentation

RootModel and Custom Root Types

A Pydantic BaseModel for the root object of the model.

Attributes

root
The root object of the model.
__pydantic_root_model__
Whether the model is a RootModel.
__pydantic_private__
Private fields in the model.
__pydantic_extra__
Extra fields in the model.

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

  • pydantic.root_model.RootModel[Union[PreviewCreativeRequest1, PreviewCreativeRequest2]]
  • pydantic.root_model.RootModel
  • pydantic.main.BaseModel
  • typing.Generic

Class variables

var model_config
var rootPreviewCreativeRequest1 | PreviewCreativeRequest2
class PreviewCreativeRequest1 (**data: Any)
Expand source code
class PreviewCreativeRequest1(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    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
    creative_manifest: Annotated[
        creative_manifest_1.CreativeManifest,
        Field(
            description='Complete creative manifest with all required assets (including promoted_offerings if required by the format)'
        ),
    ]
    format_id: Annotated[
        format_id_1.FormatId, Field(description='Format identifier for rendering the preview')
    ]
    inputs: Annotated[
        list[Input] | None,
        Field(
            description='Array of input sets for generating multiple preview variants. Each input set defines macros and context values for one preview rendering. If not provided, creative agent will generate default previews.'
        ),
    ] = None
    output_format: Annotated[
        OutputFormat | None,
        Field(
            description="Output format for previews. 'url' returns preview_url (iframe-embeddable URL), 'html' returns preview_html (raw HTML for direct embedding). Default: 'url' for backward compatibility."
        ),
    ] = OutputFormat.url
    request_type: Annotated[
        Literal['single'],
        Field(description='Discriminator indicating this is a single preview request'),
    ]
    template_id: Annotated[
        str | None, Field(description='Specific template ID for custom format rendering')
    ] = None

Base model for AdCP types with spec-compliant serialization.

AdCP JSON schemas use additionalProperties: false and do not allow null for optional fields. Therefore, optional fields must be omitted entirely when not present (not sent as null).

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 context : dict[str, typing.Any] | None
var creative_manifestCreativeManifest
var format_idFormatId
var inputs : list[Input] | None
var model_config
var output_formatOutputFormat | None
var request_type : Literal['single']
var template_id : str | None

Inherited members

class PreviewCreativeRequest2 (**data: Any)
Expand source code
class PreviewCreativeRequest2(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    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
    output_format: Annotated[
        OutputFormat | None,
        Field(
            description="Default output format for all requests in this batch. Individual requests can override this. 'url' returns preview_url (iframe-embeddable URL), 'html' returns preview_html (raw HTML for direct embedding)."
        ),
    ] = OutputFormat.url
    request_type: Annotated[
        Literal['batch'],
        Field(description='Discriminator indicating this is a batch preview request'),
    ]
    requests: Annotated[
        list[Request],
        Field(
            description='Array of preview requests (1-50 items). Each follows the single request structure.',
            max_length=50,
            min_length=1,
        ),
    ]

Base model for AdCP types with spec-compliant serialization.

AdCP JSON schemas use additionalProperties: false and do not allow null for optional fields. Therefore, optional fields must be omitted entirely when not present (not sent as null).

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 context : dict[str, typing.Any] | None
var model_config
var output_formatOutputFormat | None
var request_type : Literal['batch']
var requests : list[Request]

Inherited members

class Request (**data: Any)
Expand source code
class Request(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    creative_manifest: Annotated[
        creative_manifest_1.CreativeManifest,
        Field(description='Complete creative manifest with all required assets'),
    ]
    format_id: Annotated[
        format_id_1.FormatId, Field(description='Format identifier for rendering the preview')
    ]
    inputs: Annotated[
        list[Input2] | None,
        Field(description='Array of input sets for generating multiple preview variants'),
    ] = None
    output_format: Annotated[
        OutputFormat | None,
        Field(
            description="Output format for this preview. 'url' returns preview_url, 'html' returns preview_html."
        ),
    ] = OutputFormat.url
    template_id: Annotated[
        str | None, Field(description='Specific template ID for custom format rendering')
    ] = None

Base model for AdCP types with spec-compliant serialization.

AdCP JSON schemas use additionalProperties: false and do not allow null for optional fields. Therefore, optional fields must be omitted entirely when not present (not sent as null).

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 creative_manifestCreativeManifest
var format_idFormatId
var inputs : list[Input2] | None
var model_config
var output_formatOutputFormat | None
var template_id : str | None

Inherited members