/*
* 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.104.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CtwaAdRequestBodyCreativesInner : Supply headline, body, and image/video, or exactly one existing post reference. References cannot be combined with fresh creative fields.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CtwaAdRequestBodyCreativesInner {
/// Messaging and CTWA only. Platform post or reel ID, the same input boostPost takes as platformPostId. Facebook IDs become object_story_id; Instagram IDs become source_instagram_media_id using the connected Instagram identity. Mutually exclusive with objectStoryId and fresh creative fields.
#[serde(rename = "platformPostId", skip_serializing_if = "Option::is_none")]
pub platform_post_id: Option<String>,
/// Alias of platformPostId, kept for existing callers. Sending both with different values is a 400.
#[serde(rename = "existingPostId", skip_serializing_if = "Option::is_none")]
pub existing_post_id: Option<String>,
/// Messaging and CTWA only. Raw Facebook pageId_postId reference, used as object_story_id even with an Instagram account. Mutually exclusive with platformPostId and fresh creative fields.
#[serde(rename = "objectStoryId", skip_serializing_if = "Option::is_none")]
pub object_story_id: Option<String>,
/// Replaces the top-level creativeFeatures map for this item. Omit to inherit; an empty object clears inherited enrollment choices.
#[serde(rename = "creativeFeatures", skip_serializing_if = "Option::is_none")]
pub creative_features: Option<CreativeFeatures>,
#[serde(rename = "headline", skip_serializing_if = "Option::is_none")]
pub headline: Option<String>,
/// Primary text shown above the image / video.
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
pub body: Option<String>,
/// Image asset. Mutually exclusive with this entry's `video`. Required if neither `video` nor an existing post reference is supplied.
#[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::CtwaAdRequestBodyCreativesInnerVideo>>,
#[serde(rename = "welcomeMessage", skip_serializing_if = "Option::is_none")]
pub welcome_message: Option<Box<models::CtwaAdRequestBodyCreativesInnerWelcomeMessage>>,
}
impl CtwaAdRequestBodyCreativesInner {
/// Supply headline, body, and image/video, or exactly one existing post reference. References cannot be combined with fresh creative fields.
pub fn new() -> CtwaAdRequestBodyCreativesInner {
CtwaAdRequestBodyCreativesInner {
platform_post_id: None,
existing_post_id: None,
object_story_id: None,
creative_features: None,
headline: None,
body: None,
image_url: None,
video: None,
welcome_message: None,
}
}
}
/// Replaces the top-level creativeFeatures map for this item. Omit to inherit; an empty object clears inherited enrollment choices.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CreativeFeatures {
#[serde(rename = "OPT_IN")]
OptIn,
#[serde(rename = "OPT_OUT")]
OptOut,
}
impl Default for CreativeFeatures {
fn default() -> CreativeFeatures {
Self::OptIn
}
}