/*
* Zernio API
*
* API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
*
* The version of the OpenAPI document: 1.531.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// MetaPlacementAssets : Meta placement asset customization: pin a SPECIFIC asset (image OR video) to each placement group on a SINGLE ad (e.g. a 4:5 image on Feed and a 9:16 image on Stories/Reels). This is what Meta Ads Manager produces with \"different creative per placement\". Mapped to the creative's `asset_feed_spec` (`optimization_type: PLACEMENT`) + `asset_customization_rules`. - Each rule can pin one `headline`, `body` and `description`; omitted fields and unmatched placements use the request's top-level copy. - Each rule's `placements` accepts the same fields as the top-level `placements` object. Meta enforces co-selection rules and returns an actionable error. A block is all-image OR all-video, never mixed (Meta's asset_feed_spec carries one ad format). Exactly one catch-all default is required. - Image mode: `defaultImageUrl` + `rules[].imageUrl`. - Video mode: `defaultVideoUrl` or `defaultVideoId` + `rules[].videoUrl` or `rules[].videoId`, with optional `thumbnailUrl`/`defaultThumbnailUrl` posters (Meta auto-generates them when omitted). An id reuses a video already on the ad account and wins over a URL in the same slot; the two can mix across slots. Meta controls text rendering by placement and format. Validation accepts these fields but does not prove every field appears in delivery. Preview the ad, and put copy that must always be visible into the image or video itself.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MetaPlacementAssets {
/// Image mode. Catch-all image for any placement no rule matches. Required in image mode (Meta mandates a default rule).
#[serde(rename = "defaultImageUrl", skip_serializing_if = "Option::is_none")]
pub default_image_url: Option<String>,
/// Video mode. Catch-all video for any placement no rule matches. Video mode requires this or `defaultVideoId`.
#[serde(rename = "defaultVideoUrl", skip_serializing_if = "Option::is_none")]
pub default_video_url: Option<String>,
/// Video mode. ID of a video already on the ad account, used as the catch-all instead of uploading `defaultVideoUrl`. Wins over `defaultVideoUrl`. A video still processing after 30 seconds returns 409.
#[serde(rename = "defaultVideoId", skip_serializing_if = "Option::is_none")]
pub default_video_id: Option<String>,
/// Video mode (optional). Poster image for the default video; Meta auto-generates one when omitted.
#[serde(
rename = "defaultThumbnailUrl",
skip_serializing_if = "Option::is_none"
)]
pub default_thumbnail_url: Option<String>,
/// One entry per placement group you want to pin a specific asset to.
#[serde(rename = "rules")]
pub rules: Vec<models::MetaPlacementAssetsRulesInner>,
}
impl MetaPlacementAssets {
/// Meta placement asset customization: pin a SPECIFIC asset (image OR video) to each placement group on a SINGLE ad (e.g. a 4:5 image on Feed and a 9:16 image on Stories/Reels). This is what Meta Ads Manager produces with \"different creative per placement\". Mapped to the creative's `asset_feed_spec` (`optimization_type: PLACEMENT`) + `asset_customization_rules`. - Each rule can pin one `headline`, `body` and `description`; omitted fields and unmatched placements use the request's top-level copy. - Each rule's `placements` accepts the same fields as the top-level `placements` object. Meta enforces co-selection rules and returns an actionable error. A block is all-image OR all-video, never mixed (Meta's asset_feed_spec carries one ad format). Exactly one catch-all default is required. - Image mode: `defaultImageUrl` + `rules[].imageUrl`. - Video mode: `defaultVideoUrl` or `defaultVideoId` + `rules[].videoUrl` or `rules[].videoId`, with optional `thumbnailUrl`/`defaultThumbnailUrl` posters (Meta auto-generates them when omitted). An id reuses a video already on the ad account and wins over a URL in the same slot; the two can mix across slots. Meta controls text rendering by placement and format. Validation accepts these fields but does not prove every field appears in delivery. Preview the ad, and put copy that must always be visible into the image or video itself.
pub fn new(rules: Vec<models::MetaPlacementAssetsRulesInner>) -> MetaPlacementAssets {
MetaPlacementAssets {
default_image_url: None,
default_video_url: None,
default_video_id: None,
default_thumbnail_url: None,
rules,
}
}
}