/*
* 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.147.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CreateStandaloneAdRequestDynamicCreative : Meta only. Dynamic Creative: supply a POOL of assets and Meta auto-combines and optimises them into the best-performing variations within a single ad (mapped to the creative's `asset_feed_spec`). When set, the top-level single-creative fields (`imageUrl`, `headline`, `body`, `linkUrl`, `callToAction`) are ignored. Mutually exclusive with the `creatives[]` multi-creative shape. Exactly ONE of `imageUrls` / `videoUrls` is required (Meta allows one ad format per asset feed; sending both → 400). Limits remain 10 images or videos and 5 bodies, titles or descriptions. The ad set is created with `is_dynamic_creative: true`. Combining this field with `adSetId` returns 400: omit `adSetId` to create a new dynamic ad set. Multiple headlines go in `titles`; multiple primary texts go in `bodies`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateStandaloneAdRequestDynamicCreative {
/// Pool of image URLs (1-10). Uploaded to the ad account and referenced by hash in the asset feed. Mutually exclusive with `videoUrls`.
#[serde(rename = "imageUrls", skip_serializing_if = "Option::is_none")]
pub image_urls: Option<Vec<String>>,
/// Pool of video URLs (1-10). Uploaded to the ad account and referenced by video id in the asset feed. No thumbnails are needed: Meta auto-generates a poster per video. Mutually exclusive with `imageUrls`; `adFormat` defaults to SINGLE_VIDEO.
#[serde(rename = "videoUrls", skip_serializing_if = "Option::is_none")]
pub video_urls: Option<Vec<String>>,
/// Primary-text variations (the body copy).
#[serde(rename = "bodies", skip_serializing_if = "Option::is_none")]
pub bodies: Option<Vec<String>>,
/// Headline variations.
#[serde(rename = "titles", skip_serializing_if = "Option::is_none")]
pub titles: Option<Vec<String>>,
/// Description (link caption) variations.
#[serde(rename = "descriptions", skip_serializing_if = "Option::is_none")]
pub descriptions: Option<Vec<String>>,
/// Destination URL variations. At least one is required unless `goal` is `lead_generation`.
#[serde(rename = "linkUrls", skip_serializing_if = "Option::is_none")]
pub link_urls: Option<Vec<String>>,
/// CTA-button variations. Required.
#[serde(rename = "callToActionTypes", skip_serializing_if = "Option::is_none")]
pub call_to_action_types: Option<Vec<CallToActionTypes>>,
/// Asset-feed ad format. Must match the pool: SINGLE_IMAGE / CAROUSEL_IMAGE require `imageUrls`, SINGLE_VIDEO requires `videoUrls` (400 otherwise). Defaults to SINGLE_IMAGE with `imageUrls`, SINGLE_VIDEO with `videoUrls`.
#[serde(rename = "adFormat", skip_serializing_if = "Option::is_none")]
pub ad_format: Option<AdFormat>,
}
impl CreateStandaloneAdRequestDynamicCreative {
/// Meta only. Dynamic Creative: supply a POOL of assets and Meta auto-combines and optimises them into the best-performing variations within a single ad (mapped to the creative's `asset_feed_spec`). When set, the top-level single-creative fields (`imageUrl`, `headline`, `body`, `linkUrl`, `callToAction`) are ignored. Mutually exclusive with the `creatives[]` multi-creative shape. Exactly ONE of `imageUrls` / `videoUrls` is required (Meta allows one ad format per asset feed; sending both → 400). Limits remain 10 images or videos and 5 bodies, titles or descriptions. The ad set is created with `is_dynamic_creative: true`. Combining this field with `adSetId` returns 400: omit `adSetId` to create a new dynamic ad set. Multiple headlines go in `titles`; multiple primary texts go in `bodies`.
pub fn new() -> CreateStandaloneAdRequestDynamicCreative {
CreateStandaloneAdRequestDynamicCreative {
image_urls: None,
video_urls: None,
bodies: None,
titles: None,
descriptions: None,
link_urls: None,
call_to_action_types: None,
ad_format: None,
}
}
}
/// CTA-button variations. Required.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CallToActionTypes {
#[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,
#[serde(rename = "ADD_TO_CART")]
AddToCart,
#[serde(rename = "APPLY_NOW")]
ApplyNow,
#[serde(rename = "BOOK_NOW")]
BookNow,
#[serde(rename = "BUY_TICKETS")]
BuyTickets,
#[serde(rename = "DONATE")]
Donate,
#[serde(rename = "DONATE_NOW")]
DonateNow,
#[serde(rename = "GET_DIRECTIONS")]
GetDirections,
#[serde(rename = "GET_SHOWTIMES")]
GetShowtimes,
#[serde(rename = "LISTEN_NOW")]
ListenNow,
#[serde(rename = "ORDER_NOW")]
OrderNow,
#[serde(rename = "PLAY_GAME")]
PlayGame,
#[serde(rename = "REQUEST_TIME")]
RequestTime,
#[serde(rename = "SEE_MENU")]
SeeMenu,
#[serde(rename = "START_ORDER")]
StartOrder,
#[serde(rename = "INSTALL_MOBILE_APP")]
InstallMobileApp,
#[serde(rename = "USE_APP")]
UseApp,
#[serde(rename = "REGISTER")]
Register,
#[serde(rename = "JOIN")]
Join,
#[serde(rename = "ATTEND")]
Attend,
#[serde(rename = "REQUEST_DEMO")]
RequestDemo,
#[serde(rename = "VIEW_QUOTE")]
ViewQuote,
#[serde(rename = "APPLY")]
Apply,
#[serde(rename = "SEE_MORE")]
SeeMore,
#[serde(rename = "BUY_NOW")]
BuyNow,
}
impl Default for CallToActionTypes {
fn default() -> CallToActionTypes {
Self::LearnMore
}
}
/// Asset-feed ad format. Must match the pool: SINGLE_IMAGE / CAROUSEL_IMAGE require `imageUrls`, SINGLE_VIDEO requires `videoUrls` (400 otherwise). Defaults to SINGLE_IMAGE with `imageUrls`, SINGLE_VIDEO with `videoUrls`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AdFormat {
#[serde(rename = "SINGLE_IMAGE")]
SingleImage,
#[serde(rename = "CAROUSEL_IMAGE")]
CarouselImage,
#[serde(rename = "SINGLE_VIDEO")]
SingleVideo,
}
impl Default for AdFormat {
fn default() -> AdFormat {
Self::SingleImage
}
}