/*
* 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.526.1
* 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 CreateCreatorCampaignRequest {
/// Profile the campaign lives in. Creator accounts connect into the same workspace.
#[serde(rename = "profileId")]
pub profile_id: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "brandName")]
pub brand_name: String,
#[serde(rename = "economics")]
pub economics: Box<models::CreatorCampaignEconomics>,
/// Omitted, the campaign starts with authenticityThreshold 40 and no other caps.
#[serde(rename = "caps", skip_serializing_if = "Option::is_none")]
pub caps: Option<Box<models::CreatorCampaignCaps>>,
/// Platforms creators may post on. At least one is needed to activate. `twitter` (X) needs usage-based billing: X reads are billed at cost, up to `caps.maxXReadSpendCents`, and X views are the post's impressions. `facebook` takes Page reels and videos only.
#[serde(rename = "platforms", skip_serializing_if = "Option::is_none")]
pub platforms: Option<Vec<Platforms>>,
#[serde(
rename = "contentRules",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub content_rules: Option<Option<String>>,
#[serde(
rename = "startsAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub starts_at: Option<Option<String>>,
#[serde(
rename = "endsAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub ends_at: Option<Option<String>>,
#[serde(rename = "trackingDays", skip_serializing_if = "Option::is_none")]
pub tracking_days: Option<i32>,
#[serde(rename = "holdDays", skip_serializing_if = "Option::is_none")]
pub hold_days: Option<i32>,
/// Optional maximum age in minutes of a post when it is submitted. Null or omitted (the default) accepts any age. Posts published before the campaign started are always refused.
#[serde(
rename = "maxPostAgeMinutes",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub max_post_age_minutes: Option<Option<i32>>,
#[serde(rename = "settlement", skip_serializing_if = "Option::is_none")]
pub settlement: Option<Settlement>,
#[serde(
rename = "branding",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub branding: Option<Option<Box<models::CreatorCampaignBranding>>>,
}
impl CreateCreatorCampaignRequest {
pub fn new(
profile_id: String,
name: String,
brand_name: String,
economics: models::CreatorCampaignEconomics,
) -> CreateCreatorCampaignRequest {
CreateCreatorCampaignRequest {
profile_id,
name,
brand_name,
economics: Box::new(economics),
caps: None,
platforms: None,
content_rules: None,
starts_at: None,
ends_at: None,
tracking_days: None,
hold_days: None,
max_post_age_minutes: None,
settlement: None,
branding: None,
}
}
}
/// Platforms creators may post on. At least one is needed to activate. `twitter` (X) needs usage-based billing: X reads are billed at cost, up to `caps.maxXReadSpendCents`, and X views are the post's impressions. `facebook` takes Page reels and videos only.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platforms {
#[serde(rename = "tiktok")]
Tiktok,
#[serde(rename = "instagram")]
Instagram,
#[serde(rename = "youtube")]
Youtube,
#[serde(rename = "threads")]
Threads,
#[serde(rename = "pinterest")]
Pinterest,
#[serde(rename = "facebook")]
Facebook,
#[serde(rename = "twitter")]
Twitter,
}
impl Default for Platforms {
fn default() -> Platforms {
Self::Tiktok
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Settlement {
#[serde(rename = "none")]
None,
#[serde(rename = "external")]
External,
#[serde(rename = "treasury")]
Treasury,
}
impl Default for Settlement {
fn default() -> Settlement {
Self::None
}
}