Module adcp.types.generated_poc.preview_render

Classes

class Dimensions (**data: Any)
Expand source code
class Dimensions(AdCPBaseModel):
    height: Annotated[float, Field(ge=0.0)]
    width: Annotated[float, Field(ge=0.0)]

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 height : float
var model_config
var width : float

Inherited members

class Embedding (**data: Any)
Expand source code
class Embedding(AdCPBaseModel):
    csp_policy: Annotated[
        str | None, Field(description='Content Security Policy requirements for embedding')
    ] = None
    recommended_sandbox: Annotated[
        str | None,
        Field(
            description="Recommended iframe sandbox attribute value (e.g., 'allow-scripts allow-same-origin')"
        ),
    ] = None
    requires_https: Annotated[
        bool | None, Field(description='Whether this output requires HTTPS for secure embedding')
    ] = None
    supports_fullscreen: Annotated[
        bool | None, Field(description='Whether this output supports fullscreen mode')
    ] = 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 csp_policy : str | None
var model_config
var recommended_sandbox : str | None
var requires_https : bool | None
var supports_fullscreen : bool | None

Inherited members

class PreviewRender (root: RootModelRootType = PydanticUndefined, **data)
Expand source code
class PreviewRender(
    RootModel[
        PreviewRender1
        | PreviewRender2
        | PreviewRender3
    ]
):
    root: Annotated[
        PreviewRender1
        | PreviewRender2
        | PreviewRender3,
        Field(
            description='A single rendered piece of a creative preview with discriminated output format',
            title='Preview Render',
        ),
    ]

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[PreviewRender1, PreviewRender2, PreviewRender3]]
  • pydantic.root_model.RootModel
  • pydantic.main.BaseModel
  • typing.Generic

Class variables

var model_config
var rootPreviewRender1 | PreviewRender2 | PreviewRender3
class PreviewRender1 (**data: Any)
Expand source code
class PreviewRender1(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    dimensions: Annotated[
        Dimensions | None, Field(description='Dimensions for this rendered piece')
    ] = None
    embedding: Annotated[
        Embedding | None,
        Field(description='Optional security and embedding metadata for safe iframe integration'),
    ] = None
    output_format: Annotated[
        Literal['url'], Field(description='Discriminator indicating preview_url is provided')
    ]
    preview_url: Annotated[
        AnyUrl,
        Field(
            description='URL to an HTML page that renders this piece. Can be embedded in an iframe.'
        ),
    ]
    render_id: Annotated[
        str, Field(description='Unique identifier for this rendered piece within the variant')
    ]
    role: Annotated[
        str,
        Field(
            description="Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles."
        ),
    ]

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 dimensionsDimensions | None
var embeddingEmbedding | None
var model_config
var output_format : Literal['url']
var preview_url : pydantic.networks.AnyUrl
var render_id : str
var role : str

Inherited members

class PreviewRender2 (**data: Any)
Expand source code
class PreviewRender2(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    dimensions: Annotated[
        Dimensions | None, Field(description='Dimensions for this rendered piece')
    ] = None
    embedding: Annotated[
        Embedding | None, Field(description='Optional security and embedding metadata')
    ] = None
    output_format: Annotated[
        Literal['html'], Field(description='Discriminator indicating preview_html is provided')
    ]
    preview_html: Annotated[
        str,
        Field(
            description='Raw HTML for this rendered piece. Can be embedded directly in the page without iframe. Security warning: Only use with trusted creative agents as this bypasses iframe sandboxing.'
        ),
    ]
    render_id: Annotated[
        str, Field(description='Unique identifier for this rendered piece within the variant')
    ]
    role: Annotated[
        str,
        Field(
            description="Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles."
        ),
    ]

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 dimensionsDimensions | None
var embeddingEmbedding | None
var model_config
var output_format : Literal['html']
var preview_html : str
var render_id : str
var role : str

Inherited members

class PreviewRender3 (**data: Any)
Expand source code
class PreviewRender3(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    dimensions: Annotated[
        Dimensions | None, Field(description='Dimensions for this rendered piece')
    ] = None
    embedding: Annotated[
        Embedding | None,
        Field(description='Optional security and embedding metadata for safe iframe integration'),
    ] = None
    output_format: Annotated[
        Literal['both'],
        Field(
            description='Discriminator indicating both preview_url and preview_html are provided'
        ),
    ]
    preview_html: Annotated[
        str,
        Field(
            description='Raw HTML for this rendered piece. Can be embedded directly in the page without iframe. Security warning: Only use with trusted creative agents as this bypasses iframe sandboxing.'
        ),
    ]
    preview_url: Annotated[
        AnyUrl,
        Field(
            description='URL to an HTML page that renders this piece. Can be embedded in an iframe.'
        ),
    ]
    render_id: Annotated[
        str, Field(description='Unique identifier for this rendered piece within the variant')
    ]
    role: Annotated[
        str,
        Field(
            description="Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles."
        ),
    ]

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 dimensionsDimensions | None
var embeddingEmbedding | None
var model_config
var output_format : Literal['both']
var preview_html : str
var preview_url : pydantic.networks.AnyUrl
var render_id : str
var role : str

Inherited members