/*
* 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.158.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// GoogleDemandGenUpdate : Partial edit of a Google Demand Gen ad, sent in one atomic Google request. Every field you send replaces that whole field; fields you omit are kept. Which creative fields apply depends on the ad (read from Google): image ads take headlines, descriptions, businessName, callToAction and images (landscape, square, portrait, logo); video ads take headlines, longHeadlines, descriptions, businessName, youtubeVideoIds and exactly one images.logo; carousel ads take exactly one headline, one description, one logo, businessName and callToAction (their cards cannot be edited: create a new carousel ad). A field the ad does not take returns 422. New images are uploaded as new Google assets; the previous ones stay in the account's asset library. `channels`, `audience` and `audienceId` change the ad's ad group, so they apply to every ad in it. `audience` builds a new Google Audience and attaches it in place of the current one (the previous audience is detached, not deleted); `audienceId` attaches an existing one. Ad groups of campaigns migrated from Discovery use ungrouped audience segments, and Google refuses an Audience on them.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GoogleDemandGenUpdate {
#[serde(rename = "finalUrl", skip_serializing_if = "Option::is_none")]
pub final_url: Option<String>,
#[serde(rename = "businessName", skip_serializing_if = "Option::is_none")]
pub business_name: Option<String>,
#[serde(rename = "headlines", skip_serializing_if = "Option::is_none")]
pub headlines: Option<Vec<String>>,
/// Video ads only.
#[serde(rename = "longHeadlines", skip_serializing_if = "Option::is_none")]
pub long_headlines: Option<Vec<String>>,
#[serde(rename = "descriptions", skip_serializing_if = "Option::is_none")]
pub descriptions: Option<Vec<String>>,
/// Image and carousel ads only.
#[serde(rename = "callToAction", skip_serializing_if = "Option::is_none")]
pub call_to_action: Option<String>,
#[serde(rename = "images", skip_serializing_if = "Option::is_none")]
pub images: Option<Box<models::GoogleDemandGenUpdateImages>>,
/// Video ads only.
#[serde(rename = "youtubeVideoIds", skip_serializing_if = "Option::is_none")]
pub youtube_video_ids: Option<Vec<String>>,
/// Replaces the ad group's channel controls; only the listed channels serve.
#[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 GoogleDemandGenUpdate {
/// Partial edit of a Google Demand Gen ad, sent in one atomic Google request. Every field you send replaces that whole field; fields you omit are kept. Which creative fields apply depends on the ad (read from Google): image ads take headlines, descriptions, businessName, callToAction and images (landscape, square, portrait, logo); video ads take headlines, longHeadlines, descriptions, businessName, youtubeVideoIds and exactly one images.logo; carousel ads take exactly one headline, one description, one logo, businessName and callToAction (their cards cannot be edited: create a new carousel ad). A field the ad does not take returns 422. New images are uploaded as new Google assets; the previous ones stay in the account's asset library. `channels`, `audience` and `audienceId` change the ad's ad group, so they apply to every ad in it. `audience` builds a new Google Audience and attaches it in place of the current one (the previous audience is detached, not deleted); `audienceId` attaches an existing one. Ad groups of campaigns migrated from Discovery use ungrouped audience segments, and Google refuses an Audience on them.
pub fn new() -> GoogleDemandGenUpdate {
GoogleDemandGenUpdate {
final_url: None,
business_name: None,
headlines: None,
long_headlines: None,
descriptions: None,
call_to_action: None,
images: None,
youtube_video_ids: None,
channels: None,
audience: None,
audience_id: None,
}
}
}
/// Replaces the ad group's channel controls; only the listed channels serve.
#[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
}
}