/*
 * 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.1
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateStandaloneAdRequest {
    #[serde(rename = "accountId")]
    pub account_id: String,
    #[serde(rename = "adAccountId")]
    pub ad_account_id: String,
    #[serde(rename = "name")]
    pub name: String,
    /// Available goals vary by platform. Meta (Facebook/Instagram) and TikTok support all 7. LinkedIn supports all except app_promotion. Twitter/X supports engagement, traffic, awareness, video_views, app_promotion. Pinterest and Google Ads support only engagement, traffic, awareness, video_views.
    #[serde(rename = "goal")]
    pub goal: Goal,
    #[serde(rename = "budgetAmount")]
    pub budget_amount: f64,
    #[serde(rename = "budgetType")]
    pub budget_type: BudgetType,
    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
    /// Required for most platforms. Max: Meta=255, Google=30, Pinterest=100
    #[serde(rename = "headline", skip_serializing_if = "Option::is_none")]
    pub headline: Option<String>,
    /// Google Display only
    #[serde(rename = "longHeadline", skip_serializing_if = "Option::is_none")]
    pub long_headline: Option<String>,
    /// Max: Google=90, Pinterest=500
    #[serde(rename = "body")]
    pub body: String,
    /// Meta only
    #[serde(rename = "callToAction", skip_serializing_if = "Option::is_none")]
    pub call_to_action: Option<CallToAction>,
    #[serde(rename = "linkUrl", skip_serializing_if = "Option::is_none")]
    pub link_url: Option<String>,
    /// Image URL (or video URL for TikTok). Not required for Google Search campaigns.
    #[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")]
    pub image_url: Option<String>,
    /// Google Display only
    #[serde(rename = "businessName", skip_serializing_if = "Option::is_none")]
    pub business_name: Option<String>,
    /// Pinterest only. Board ID (auto-creates if not provided).
    #[serde(rename = "boardId", skip_serializing_if = "Option::is_none")]
    pub board_id: Option<String>,
    #[serde(rename = "countries", skip_serializing_if = "Option::is_none")]
    pub countries: Option<Vec<String>>,
    #[serde(rename = "ageMin", skip_serializing_if = "Option::is_none")]
    pub age_min: Option<i32>,
    #[serde(rename = "ageMax", skip_serializing_if = "Option::is_none")]
    pub age_max: Option<i32>,
    /// Interest objects from /v1/ads/interests. Each must include id and name.
    #[serde(rename = "interests", skip_serializing_if = "Option::is_none")]
    pub interests: Option<Vec<models::UpdateAdRequestTargetingInterestsInner>>,
    /// Required for lifetime budgets
    #[serde(rename = "endDate", skip_serializing_if = "Option::is_none")]
    pub end_date: Option<String>,
    /// Custom audience ID for targeting
    #[serde(rename = "audienceId", skip_serializing_if = "Option::is_none")]
    pub audience_id: Option<String>,
    /// Google only
    #[serde(rename = "campaignType", skip_serializing_if = "Option::is_none")]
    pub campaign_type: Option<CampaignType>,
    /// Google Search only
    #[serde(rename = "keywords", skip_serializing_if = "Option::is_none")]
    pub keywords: Option<Vec<String>>,
    /// Google Search RSA only. Extra headlines.
    #[serde(
        rename = "additionalHeadlines",
        skip_serializing_if = "Option::is_none"
    )]
    pub additional_headlines: Option<Vec<String>>,
    /// Google Search RSA only. Extra descriptions.
    #[serde(
        rename = "additionalDescriptions",
        skip_serializing_if = "Option::is_none"
    )]
    pub additional_descriptions: Option<Vec<String>>,
}

impl CreateStandaloneAdRequest {
    pub fn new(
        account_id: String,
        ad_account_id: String,
        name: String,
        goal: Goal,
        budget_amount: f64,
        budget_type: BudgetType,
        body: String,
    ) -> CreateStandaloneAdRequest {
        CreateStandaloneAdRequest {
            account_id,
            ad_account_id,
            name,
            goal,
            budget_amount,
            budget_type,
            currency: None,
            headline: None,
            long_headline: None,
            body,
            call_to_action: None,
            link_url: None,
            image_url: None,
            business_name: None,
            board_id: None,
            countries: None,
            age_min: None,
            age_max: None,
            interests: None,
            end_date: None,
            audience_id: None,
            campaign_type: None,
            keywords: None,
            additional_headlines: None,
            additional_descriptions: None,
        }
    }
}
/// Available goals vary by platform. Meta (Facebook/Instagram) and TikTok support all 7. LinkedIn supports all except app_promotion. Twitter/X supports engagement, traffic, awareness, video_views, app_promotion. Pinterest and Google Ads support only engagement, traffic, awareness, video_views.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Goal {
    #[serde(rename = "engagement")]
    Engagement,
    #[serde(rename = "traffic")]
    Traffic,
    #[serde(rename = "awareness")]
    Awareness,
    #[serde(rename = "video_views")]
    VideoViews,
    #[serde(rename = "lead_generation")]
    LeadGeneration,
    #[serde(rename = "conversions")]
    Conversions,
    #[serde(rename = "app_promotion")]
    AppPromotion,
}

impl Default for Goal {
    fn default() -> Goal {
        Self::Engagement
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BudgetType {
    #[serde(rename = "daily")]
    Daily,
    #[serde(rename = "lifetime")]
    Lifetime,
}

impl Default for BudgetType {
    fn default() -> BudgetType {
        Self::Daily
    }
}
/// Meta only
#[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
    }
}
/// Google only
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CampaignType {
    #[serde(rename = "display")]
    Display,
    #[serde(rename = "search")]
    Search,
}

impl Default for CampaignType {
    fn default() -> CampaignType {
        Self::Display
    }
}
