/*
* 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).
*
* The version of the OpenAPI document: 1.39.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// AdCreative : Platform-specific creative data. Fields vary by platform.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AdCreative {
/// Initial Performance Max asset group input. Use the asset-groups endpoint for current Google assets.
#[serde(rename = "assetGroup", skip_serializing_if = "Option::is_none")]
pub asset_group: Option<Box<models::GooglePmaxAssetGroupInput>>,
/// Google resource name of the created Performance Max asset group.
#[serde(
rename = "assetGroupResourceName",
skip_serializing_if = "Option::is_none"
)]
pub asset_group_resource_name: Option<String>,
/// Google RSA only. Replaces the complete headline list. No padding or truncation on update.
#[serde(rename = "headlines", skip_serializing_if = "Option::is_none")]
pub headlines: Option<Vec<models::GoogleRsaHeadline>>,
/// Google RSA only. Replaces the complete description list. No padding or truncation on update.
#[serde(rename = "descriptions", skip_serializing_if = "Option::is_none")]
pub descriptions: Option<Vec<models::GoogleRsaDescription>>,
/// Google RSA only. Replaces final URLs. Omitted lists stay unchanged.
#[serde(rename = "finalUrls", skip_serializing_if = "Option::is_none")]
pub final_urls: Option<Vec<String>>,
/// Primary thumbnail/image URL
#[serde(
rename = "thumbnailUrl",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub thumbnail_url: Option<Option<String>>,
/// Alternative image URL
#[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")]
pub image_url: Option<String>,
/// Meta video ID for VIDEO-type ads. Null for non-video ads. Callers that need an embeddable MP4 can call GET /{videoId}?fields=source with the page access token.
#[serde(
rename = "videoId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub video_id: Option<Option<String>>,
/// Public Facebook watch URL for VIDEO-type ads (https://www.facebook.com/watch/?v={videoId}). Null for non-video ads.
#[serde(
rename = "videoUrl",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub video_url: Option<Option<String>>,
/// Meta ad creative id backing this ad. Reusable via existingCreativeId on POST /v1/ads/create.
#[serde(
rename = "creativeId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub creative_id: Option<Option<String>>,
/// Meta creative object_type (e.g. SHARE, VIDEO, PRIVACY_CHECK_FAIL, POST_DELETED). Use this to render state-aware previews: when Meta moderation strips image/video fields, only thumbnailUrl at 64x64 is available.
#[serde(rename = "objectType", skip_serializing_if = "Option::is_none")]
pub object_type: Option<String>,
/// Meta creative `object_story_id` (the SHARE reference). Frequently absent, because Meta omits it for SHARE creatives. Use effectiveObjectStoryId instead.
#[serde(
rename = "objectStoryId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub object_story_id: Option<Option<String>>,
/// Meta `effective_object_story_id`, the `{pageId}_{postId}` of the Facebook post the ad's engagement (comments) lives on. Pass to GET /v1/ads?effectiveObjectStoryId= to map a Business-Manager-visible post back to this ad; GET /v1/ads/{adId}/comments resolves comments against it.
#[serde(
rename = "effectiveObjectStoryId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub effective_object_story_id: Option<Option<String>>,
/// Facebook Page backing the creative (Meta only). What the `pageId` filter on /v1/ads, /v1/ads/campaigns and /v1/ads/tree matches against. Absent for non-Meta ads and rare Meta creatives with no page signal.
#[serde(
rename = "pageId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub page_id: Option<Option<String>>,
/// Meta `effective_instagram_media_id`, the Instagram media ID of the boosted post the ad's engagement lives on. Pass to GET /v1/ads?effectiveInstagramMediaId= to map a Business-Manager-visible IG post back to this ad.
#[serde(
rename = "effectiveInstagramMediaId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub effective_instagram_media_id: Option<Option<String>>,
/// Meta `instagram_user_id`, the Instagram-scoped business ID that owns the boosted media.
#[serde(
rename = "instagramUserId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub instagram_user_id: Option<Option<String>>,
/// Meta `instagram_permalink_url`, the public Instagram post URL of the boosted media.
#[serde(
rename = "instagramPermalinkUrl",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub instagram_permalink_url: Option<Option<String>>,
/// All media URLs for this ad (carousel images, multiple assets). Populated for Meta (carousel child_attachments), Google Ads (responsive display marketing_images), and LinkedIn (multi-image posts).
#[serde(rename = "mediaUrls", skip_serializing_if = "Option::is_none")]
pub media_urls: Option<Vec<String>>,
/// LinkedIn only. Whether LinkedIn is currently serving this specific creative. Complements the ad-level `servingStatuses`, which describes the parent campaign.
#[serde(
rename = "isServing",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub is_serving: Option<Option<bool>>,
/// LinkedIn only. The LinkedIn ad format, in LinkedIn's own vocabulary: STANDARD_UPDATE, SINGLE_VIDEO, CAROUSEL, NATIVE_DOCUMENT, EVENT, TEXT_AD, SPOTLIGHT, FOLLOW_COMPANY, JOBS, SPONSORED_INMAILS and others. On an ad Zernio created this is the format it was created as; on an ad synced from Campaign Manager it is the parent campaign's raw `format`, which is what LinkedIn actually enforces on its creatives. The list is open, so treat an unrecognized value as valid. Absent on LinkedIn ads not yet re-synced, and on every other platform.
#[serde(
rename = "adFormat",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub ad_format: Option<Option<String>>,
/// LinkedIn only. Why this specific creative is not being served. Empty when it is serving. A superset of the ad-level `servingStatuses`: it repeats the inherited campaign, campaign group and account holds AND adds creative-only causes such as UNDER_REVIEW, REJECTED, PROCESSING, PROCESSING_FAILED, FORM_HOLD (lead-gen-form creatives), REFERRED_CONTENT_QUALITY_HOLD, JOB_POSTING_ON_HOLD and JOB_POSTING_INVALID (job ads). Some values are format-specific and will never appear on other ad formats. The list is open, so treat unrecognized values as holds rather than errors.
#[serde(rename = "servingHoldReasons", skip_serializing_if = "Option::is_none")]
pub serving_hold_reasons: Option<Vec<String>>,
/// Ad copy/text
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
pub body: Option<String>,
/// Google Ads headline
#[serde(rename = "googleHeadline", skip_serializing_if = "Option::is_none")]
pub google_headline: Option<String>,
/// Google Ads description
#[serde(rename = "googleDescription", skip_serializing_if = "Option::is_none")]
pub google_description: Option<String>,
/// Destination URL
#[serde(rename = "linkUrl", skip_serializing_if = "Option::is_none")]
pub link_url: Option<String>,
/// Explicit E.164 WhatsApp number supplied when creating a Meta boost or messaging ad. Absent when omitted by the caller or on older records.
#[serde(
rename = "whatsappPhoneNumber",
skip_serializing_if = "Option::is_none"
)]
pub whatsapp_phone_number: Option<String>,
#[serde(rename = "pinterestImageUrl", skip_serializing_if = "Option::is_none")]
pub pinterest_image_url: Option<String>,
#[serde(rename = "pinterestTitle", skip_serializing_if = "Option::is_none")]
pub pinterest_title: Option<String>,
#[serde(
rename = "pinterestDescription",
skip_serializing_if = "Option::is_none"
)]
pub pinterest_description: Option<String>,
}
impl AdCreative {
/// Platform-specific creative data. Fields vary by platform.
pub fn new() -> AdCreative {
AdCreative {
asset_group: None,
asset_group_resource_name: None,
headlines: None,
descriptions: None,
final_urls: None,
thumbnail_url: None,
image_url: None,
video_id: None,
video_url: None,
creative_id: None,
object_type: None,
object_story_id: None,
effective_object_story_id: None,
page_id: None,
effective_instagram_media_id: None,
instagram_user_id: None,
instagram_permalink_url: None,
media_urls: None,
is_serving: None,
ad_format: None,
serving_hold_reasons: None,
body: None,
google_headline: None,
google_description: None,
link_url: None,
whatsapp_phone_number: None,
pinterest_image_url: None,
pinterest_title: None,
pinterest_description: None,
}
}
}