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

/// CreateStandaloneAdRequestCreativesInner : Each creative must supply EXACTLY ONE of `imageUrl` (image creative) or `video` (video creative).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateStandaloneAdRequestCreativesInner {
    /// Exact name for this ad. Falls back to `<name> #N` (N = 1-based position).
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(rename = "headline")]
    pub headline: String,
    #[serde(rename = "body")]
    pub body: String,
    /// Link description for this ad (link_data.description; video creatives: video_data.link_description). Falls back to the top-level `description`; when both are omitted Meta scrapes the destination URL's OG description.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Image creative. Mutually exclusive with `video`.
    #[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")]
    pub image_url: Option<String>,
    #[serde(rename = "video", skip_serializing_if = "Option::is_none")]
    pub video: Option<Box<models::CreateStandaloneAdRequestCreativesInnerVideo>>,
    #[serde(rename = "linkUrl")]
    pub link_url: String,
    #[serde(rename = "callToAction")]
    pub call_to_action: CallToAction,
}

impl CreateStandaloneAdRequestCreativesInner {
    /// Each creative must supply EXACTLY ONE of `imageUrl` (image creative) or `video` (video creative).
    pub fn new(
        headline: String,
        body: String,
        link_url: String,
        call_to_action: CallToAction,
    ) -> CreateStandaloneAdRequestCreativesInner {
        CreateStandaloneAdRequestCreativesInner {
            name: None,
            headline,
            body,
            description: None,
            image_url: None,
            video: None,
            link_url,
            call_to_action,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CallToAction {
    #[serde(rename = "LEARN_MORE")]
    LearnMore,
    #[serde(rename = "SHOP_NOW")]
    ShopNow,
    #[serde(rename = "SIGN_UP")]
    SignUp,
    #[serde(rename = "BOOK_TRAVEL")]
    BookTravel,
    #[serde(rename = "CONTACT_US")]
    ContactUs,
    #[serde(rename = "DOWNLOAD")]
    Download,
    #[serde(rename = "GET_OFFER")]
    GetOffer,
    #[serde(rename = "GET_QUOTE")]
    GetQuote,
    #[serde(rename = "SUBSCRIBE")]
    Subscribe,
    #[serde(rename = "WATCH_MORE")]
    WatchMore,
}

impl Default for CallToAction {
    fn default() -> CallToAction {
        Self::LearnMore
    }
}
