late 0.0.1075

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). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * 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).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.123.0
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

/// GoogleDemandGenInput : Creative, channel and audience settings for a Google Demand Gen campaign (campaignType demand_gen). Creates one ad group with one ad: a multi-asset image ad, a video responsive ad when youtubeVideoIds is sent, or a carousel ad when carouselCards is sent.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GoogleDemandGenInput {
    /// Defaults to the ad name.
    #[serde(rename = "adGroupName", skip_serializing_if = "Option::is_none")]
    pub ad_group_name: Option<String>,
    #[serde(rename = "finalUrl")]
    pub final_url: String,
    #[serde(rename = "businessName")]
    pub business_name: String,
    /// Distinct texts. A carousel ad takes exactly one.
    #[serde(rename = "headlines")]
    pub headlines: Vec<String>,
    /// Video ads only, and required there.
    #[serde(rename = "longHeadlines", skip_serializing_if = "Option::is_none")]
    pub long_headlines: Option<Vec<String>>,
    /// A carousel ad takes exactly one.
    #[serde(rename = "descriptions")]
    pub descriptions: Vec<String>,
    /// Image and carousel ads only. Call to action text such as 'Learn more'; Google picks one when omitted.
    #[serde(rename = "callToAction", skip_serializing_if = "Option::is_none")]
    pub call_to_action: Option<String>,
    #[serde(rename = "images")]
    pub images: Box<models::GoogleDemandGenInputImages>,
    /// Makes the ad a video responsive ad.
    #[serde(rename = "youtubeVideoIds", skip_serializing_if = "Option::is_none")]
    pub youtube_video_ids: Option<Vec<String>>,
    /// Makes the ad a carousel ad. Each card needs its own image (no two cards may share one); use the same image shape on every card. Card images are uploaded to the account's asset library before the campaign is created, validateOnly included (Google checks cards against existing images; identical images are reused, not duplicated).
    #[serde(rename = "carouselCards", skip_serializing_if = "Option::is_none")]
    pub carousel_cards: Option<Vec<models::GoogleDemandGenInputCarouselCardsInner>>,
    /// Channel controls on the ad group. Only the listed channels serve; omit to serve on all of them.
    #[serde(rename = "channels", skip_serializing_if = "Option::is_none")]
    pub channels: Option<Vec<Channels>>,
    #[serde(rename = "audience", skip_serializing_if = "Option::is_none")]
    pub audience: Option<Box<models::GoogleDemandGenAudience>>,
    /// Attach an existing Google Audience by numeric id instead of audience.
    #[serde(rename = "audienceId", skip_serializing_if = "Option::is_none")]
    pub audience_id: Option<String>,
}

impl GoogleDemandGenInput {
    /// Creative, channel and audience settings for a Google Demand Gen campaign (campaignType demand_gen). Creates one ad group with one ad: a multi-asset image ad, a video responsive ad when youtubeVideoIds is sent, or a carousel ad when carouselCards is sent.
    pub fn new(
        final_url: String,
        business_name: String,
        headlines: Vec<String>,
        descriptions: Vec<String>,
        images: models::GoogleDemandGenInputImages,
    ) -> GoogleDemandGenInput {
        GoogleDemandGenInput {
            ad_group_name: None,
            final_url,
            business_name,
            headlines,
            long_headlines: None,
            descriptions,
            call_to_action: None,
            images: Box::new(images),
            youtube_video_ids: None,
            carousel_cards: None,
            channels: None,
            audience: None,
            audience_id: None,
        }
    }
}
/// Channel controls on the ad group. Only the listed channels serve; omit to serve on all of them.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Channels {
    #[serde(rename = "youtube_in_stream")]
    YoutubeInStream,
    #[serde(rename = "youtube_in_feed")]
    YoutubeInFeed,
    #[serde(rename = "youtube_shorts")]
    YoutubeShorts,
    #[serde(rename = "discover")]
    Discover,
    #[serde(rename = "gmail")]
    Gmail,
    #[serde(rename = "display")]
    Display,
}

impl Default for Channels {
    fn default() -> Channels {
        Self::YoutubeInStream
    }
}