late 0.0.310

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// CreateStandaloneAdRequestPlacementAssets : Meta only. Placement asset customization: pin a SPECIFIC image to each placement group on a SINGLE ad (e.g. a 9:16 image on Stories/Reels and a 4:5 on Feed). This is the same thing Meta Ads Manager produces with \"different creative per placement\", mapped to the creative's `asset_feed_spec` + `asset_customization_rules`. It is deterministic pinning, NOT the auto-optimizing pool of `dynamicCreative` (the two are mutually exclusive, and it cannot be combined with `creatives[]` or `adSetId`). The shared copy (headline, body, link, CTA) comes from the top-level single-creative fields (`headline`, `body`, `linkUrl`, `callToAction`) since only the image varies by placement. Each rule's `placements` accepts the same fields as the top-level `placements` object; Meta enforces co-selection rules and returns an actionable error.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateStandaloneAdRequestPlacementAssets {
    /// Catch-all image for any placement not matched by a rule. REQUIRED — Meta mandates a default asset customization rule (empty placement spec, lowest priority) on every placement-customized creative.
    #[serde(rename = "defaultImageUrl")]
    pub default_image_url: String,
    /// One entry per placement group you want to pin a specific image to.
    #[serde(rename = "rules")]
    pub rules: Vec<models::CreateStandaloneAdRequestPlacementAssetsRulesInner>,
}

impl CreateStandaloneAdRequestPlacementAssets {
    /// Meta only. Placement asset customization: pin a SPECIFIC image to each placement group on a SINGLE ad (e.g. a 9:16 image on Stories/Reels and a 4:5 on Feed). This is the same thing Meta Ads Manager produces with \"different creative per placement\", mapped to the creative's `asset_feed_spec` + `asset_customization_rules`. It is deterministic pinning, NOT the auto-optimizing pool of `dynamicCreative` (the two are mutually exclusive, and it cannot be combined with `creatives[]` or `adSetId`). The shared copy (headline, body, link, CTA) comes from the top-level single-creative fields (`headline`, `body`, `linkUrl`, `callToAction`) since only the image varies by placement. Each rule's `placements` accepts the same fields as the top-level `placements` object; Meta enforces co-selection rules and returns an actionable error.
    pub fn new(
        default_image_url: String,
        rules: Vec<models::CreateStandaloneAdRequestPlacementAssetsRulesInner>,
    ) -> CreateStandaloneAdRequestPlacementAssets {
        CreateStandaloneAdRequestPlacementAssets {
            default_image_url,
            rules,
        }
    }
}