/*
* 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.565.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 CreatorCampaignEconomicsRetainer {
#[serde(rename = "type")]
pub r#type: Type,
/// `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.
#[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
pub mode: Option<Mode>,
#[serde(rename = "amountCents")]
pub amount_cents: i32,
/// 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.
#[serde(rename = "period")]
pub period: Period,
/// Posts approved within the period that it needs. 0 pays without posts.
#[serde(rename = "requiredApprovedPosts")]
pub required_approved_posts: i32,
#[serde(rename = "commission", skip_serializing_if = "Option::is_none")]
pub commission: Option<Box<models::CreatorCampaignCommissionTerms>>,
#[serde(rename = "budgetCents")]
pub budget_cents: i32,
}
impl CreatorCampaignEconomicsRetainer {
pub fn new(
r#type: Type,
amount_cents: i32,
period: Period,
required_approved_posts: i32,
budget_cents: i32,
) -> CreatorCampaignEconomicsRetainer {
CreatorCampaignEconomicsRetainer {
r#type,
mode: None,
amount_cents,
period,
required_approved_posts,
commission: None,
budget_cents,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "retainer")]
Retainer,
}
impl Default for Type {
fn default() -> Type {
Self::Retainer
}
}
/// `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
}
}