/*
* 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.608.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CreatorCampaignEconomics : How the campaign pays, picked by `type`. Amounts are USD cents. Every type carries `budgetCents`, the most the campaign can pay out in total. Once earnings reach it, the campaign stops accruing and `creator_campaign.budget_exhausted` fires. - `cpm`: `ratePer1kCents` per 1,000 of the counted `metric` (views by default), earned once a post reaches `minViewsToEarn` of it, capped per post by `maxPayoutPerClipCents`. - `per_post`: `perApprovedPostCents` for each approved post, at most `maxPostsPerParticipant` per participant. - `pool`: `budgetCents` is split at close among approved posts by eligible views; a post needs `minViewsToQualify` views to share. - `ad_performance`: pays on the results of the ads that run each post (see `GET /v1/creator-campaigns/{campaignId}/ad-results`), counted once a day through the previous UTC day. Only Instagram, Facebook and TikTok posts. - `retainer`: `amountCents` per `period` once the creator has `requiredApprovedPosts` approved posts in it. `mode: smart` tops the period's commission up to `amountCents`. - `commission`: a share of the sales of the linked store (`storeAccountId`) credited to each creator by their discount code or tracking link.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum CreatorCampaignEconomics {
#[serde(rename = "cpm")]
Cpm(Box<models::CreatorCampaignEconomicsCpm>),
#[serde(rename = "per_post")]
PerPost(Box<models::CreatorCampaignEconomicsPerPost>),
#[serde(rename = "pool")]
Pool(Box<models::CreatorCampaignEconomicsPool>),
#[serde(rename = "ad_performance")]
AdPerformance(Box<models::CreatorCampaignEconomicsAdPerformance>),
#[serde(rename = "retainer")]
Retainer(Box<models::CreatorCampaignEconomicsRetainer>),
#[serde(rename = "commission")]
Commission(Box<models::CreatorCampaignEconomicsCommission>),
}
impl Default for CreatorCampaignEconomics {
fn default() -> Self {
Self::Cpm(Default::default())
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Metric {
#[serde(rename = "spend")]
Spend,
#[serde(rename = "purchases")]
Purchases,
#[serde(rename = "purchase_value")]
PurchaseValue,
#[serde(rename = "clicks")]
Clicks,
#[serde(rename = "impressions")]
Impressions,
}
impl Default for Metric {
fn default() -> Metric {
Self::Spend
}
}
/// With `metric: engagements`, the engagements that count. Missing means all four, and sending it on a views campaign answers 400. YouTube reports likes and comments only, Facebook and Threads have no saves, and Pinterest reports saves only.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum EngagementTypes {
#[serde(rename = "likes")]
Likes,
#[serde(rename = "comments")]
Comments,
#[serde(rename = "shares")]
Shares,
#[serde(rename = "saves")]
Saves,
}
impl Default for EngagementTypes {
fn default() -> EngagementTypes {
Self::Likes
}
}
/// `standard` pays `amountCents` per period. `smart` guarantees it: the commission the creator earned in the period is topped up to `amountCents`. Smart needs `commission` and a linked store.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Mode {
#[serde(rename = "standard")]
Standard,
#[serde(rename = "smart")]
Smart,
}
impl Default for Mode {
fn default() -> Mode {
Self::Standard
}
}
/// Weeks start Monday 00:00 UTC, months on the 1st. A period is paid within a day after it ends. A standard `once` retainer pays as soon as the posts are approved; a smart one when the campaign ends.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Period {
#[serde(rename = "week")]
Week,
#[serde(rename = "month")]
Month,
#[serde(rename = "once")]
Once,
}
impl Default for Period {
fn default() -> Period {
Self::Week
}
}
/// How an order is credited: the creator's discount code, the last click on their tracking link, or both with the code winning.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Attribution {
#[serde(rename = "code_or_link")]
CodeOrLink,
#[serde(rename = "code")]
Code,
#[serde(rename = "link")]
Link,
}
impl Default for Attribution {
fn default() -> Attribution {
Self::CodeOrLink
}
}