/*
 * 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};

/// AdCreative : Platform-specific creative data. Fields vary by platform.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AdCreative {
    /// Primary thumbnail/image URL
    #[serde(rename = "thumbnailUrl", skip_serializing_if = "Option::is_none")]
    pub thumbnail_url: 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", skip_serializing_if = "Option::is_none")]
    pub video_id: 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", skip_serializing_if = "Option::is_none")]
    pub video_url: 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 — Meta omits it for SHARE creatives. Use effectiveObjectStoryId instead.
    #[serde(rename = "objectStoryId", skip_serializing_if = "Option::is_none")]
    pub object_story_id: Option<String>,
    /// Meta `effective_object_story_id` — `{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",
        skip_serializing_if = "Option::is_none"
    )]
    pub effective_object_story_id: 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",
        skip_serializing_if = "Option::is_none"
    )]
    pub effective_instagram_media_id: Option<String>,
    /// Meta `instagram_user_id` — the Instagram-scoped business ID that owns the boosted media.
    #[serde(rename = "instagramUserId", skip_serializing_if = "Option::is_none")]
    pub instagram_user_id: Option<String>,
    /// Meta `instagram_permalink_url` — public Instagram post URL of the boosted media.
    #[serde(
        rename = "instagramPermalinkUrl",
        skip_serializing_if = "Option::is_none"
    )]
    pub instagram_permalink_url: 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>>,
    /// 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>,
    #[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 {
            thumbnail_url: None,
            image_url: None,
            video_id: None,
            video_url: None,
            object_type: None,
            object_story_id: None,
            effective_object_story_id: None,
            effective_instagram_media_id: None,
            instagram_user_id: None,
            instagram_permalink_url: None,
            media_urls: None,
            body: None,
            google_headline: None,
            google_description: None,
            link_url: None,
            pinterest_image_url: None,
            pinterest_title: None,
            pinterest_description: None,
        }
    }
}
