/*
* 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.570.0
* 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 LaunchCampaignAdsRequest {
/// Approved submissions to run as ads.
#[serde(rename = "submissionIds")]
pub submission_ids: Vec<String>,
/// Meta runs Instagram and Facebook posts; TikTok runs TikTok posts.
#[serde(rename = "network")]
pub network: Network,
/// The brand's connected ads account (Facebook or TikTok) the ads run from, as in `/v1/accounts`.
#[serde(rename = "accountId")]
pub account_id: String,
/// Platform ad account ID.
#[serde(rename = "adAccountId")]
pub ad_account_id: String,
/// Existing Meta ad set the ads go into. Required when `network` is `meta`.
#[serde(rename = "adSetId", skip_serializing_if = "Option::is_none")]
pub ad_set_id: Option<String>,
/// Existing TikTok campaign that gets one ad group per post. Required when `network` is `tiktok`.
#[serde(rename = "existingCampaignId", skip_serializing_if = "Option::is_none")]
pub existing_campaign_id: Option<String>,
/// Daily budget of each TikTok ad group, in the ad account currency. Required when `network` is `tiktok`.
#[serde(rename = "dailyBudget", skip_serializing_if = "Option::is_none")]
pub daily_budget: Option<f64>,
/// Whose handle the ad runs under. TikTok takes `creator` only.
#[serde(rename = "identity")]
pub identity: Identity,
/// Primary text of brand ads. Defaults to the post caption.
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
pub body: Option<String>,
#[serde(rename = "headline", skip_serializing_if = "Option::is_none")]
pub headline: Option<String>,
/// Call to action, as in `POST /v1/ads/create`.
#[serde(rename = "callToAction", skip_serializing_if = "Option::is_none")]
pub call_to_action: Option<String>,
/// Destination URL (http or https).
#[serde(rename = "linkUrl", skip_serializing_if = "Option::is_none")]
pub link_url: Option<String>,
/// Ads launch paused unless set to `ACTIVE`.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
}
impl LaunchCampaignAdsRequest {
pub fn new(
submission_ids: Vec<String>,
network: Network,
account_id: String,
ad_account_id: String,
identity: Identity,
) -> LaunchCampaignAdsRequest {
LaunchCampaignAdsRequest {
submission_ids,
network,
account_id,
ad_account_id,
ad_set_id: None,
existing_campaign_id: None,
daily_budget: None,
identity,
body: None,
headline: None,
call_to_action: None,
link_url: None,
status: None,
}
}
}
/// Meta runs Instagram and Facebook posts; TikTok runs TikTok posts.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Network {
#[serde(rename = "meta")]
Meta,
#[serde(rename = "tiktok")]
Tiktok,
}
impl Default for Network {
fn default() -> Network {
Self::Meta
}
}
/// Whose handle the ad runs under. TikTok takes `creator` only.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Identity {
#[serde(rename = "brand")]
Brand,
#[serde(rename = "creator")]
Creator,
}
impl Default for Identity {
fn default() -> Identity {
Self::Brand
}
}
/// Ads launch paused unless set to `ACTIVE`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "ACTIVE")]
Active,
#[serde(rename = "PAUSED")]
Paused,
}
impl Default for Status {
fn default() -> Status {
Self::Active
}
}