/*
* 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.415.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// RecyclingConfig : Automatic post recycling (reposting at regular intervals). After the post is published, the system creates new scheduled copies at the specified interval until expiration conditions are met. - Weekly or monthly intervals. - Maximum 10 active recycling posts per account. - YouTube and TikTok are excluded. - Content variations are recommended for X and Pinterest to avoid duplicate flags.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RecyclingConfig {
/// Set to false to disable recycling on this post
#[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
/// Number of interval units between each repost. Required when enabling recycling.
#[serde(rename = "gap", skip_serializing_if = "Option::is_none")]
pub gap: Option<i32>,
/// Interval unit for the gap. Defaults to 'month'.
#[serde(rename = "gapFreq", skip_serializing_if = "Option::is_none")]
pub gap_freq: Option<GapFreq>,
/// When to start the recycling cycle. Defaults to the post's scheduledFor date.
#[serde(rename = "startDate", skip_serializing_if = "Option::is_none")]
pub start_date: Option<String>,
/// Stop recycling after this many copies have been created. Send null on update to clear this limit.
#[serde(
rename = "expireCount",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub expire_count: Option<Option<i32>>,
/// Stop recycling after this date, regardless of count. Send null on update to clear this limit.
#[serde(
rename = "expireDate",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub expire_date: Option<Option<String>>,
/// Content variations for recycled copies. Each recycle uses the next variation, in round-robin order. Recommended for X and Pinterest to avoid duplicate content flags. - If omitted, the original post content is used for all recycled copies. - Send an empty array [] to clear existing variations. - Must have 2+ entries when setting variations. - Platform-level customContent still overrides the base content per platform.
#[serde(rename = "contentVariations", skip_serializing_if = "Option::is_none")]
pub content_variations: Option<Vec<String>>,
}
impl RecyclingConfig {
/// Automatic post recycling (reposting at regular intervals). After the post is published, the system creates new scheduled copies at the specified interval until expiration conditions are met. - Weekly or monthly intervals. - Maximum 10 active recycling posts per account. - YouTube and TikTok are excluded. - Content variations are recommended for X and Pinterest to avoid duplicate flags.
pub fn new() -> RecyclingConfig {
RecyclingConfig {
enabled: None,
gap: None,
gap_freq: None,
start_date: None,
expire_count: None,
expire_date: None,
content_variations: None,
}
}
}
/// Interval unit for the gap. Defaults to 'month'.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum GapFreq {
#[serde(rename = "week")]
Week,
#[serde(rename = "month")]
Month,
}
impl Default for GapFreq {
fn default() -> GapFreq {
Self::Week
}
}