/*
* 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.96.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 UpdatePostRequest {
/// Stored on the post for reference/display only. This field is NOT used as the video title when publishing. To set a YouTube video title, use platformSpecificData.title on the youtube platform target (falls back to the first line of content when omitted).
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
#[serde(rename = "mediaItems", skip_serializing_if = "Option::is_none")]
pub media_items: Option<Vec<models::MediaItem>>,
/// Target platforms and accounts for this post. Each item must include platform and accountId.
#[serde(rename = "platforms", skip_serializing_if = "Option::is_none")]
pub platforms: Option<Vec<models::UpdatePostRequestPlatformsInner>>,
#[serde(rename = "scheduledFor", skip_serializing_if = "Option::is_none")]
pub scheduled_for: Option<String>,
#[serde(rename = "publishNow", skip_serializing_if = "Option::is_none")]
pub publish_now: Option<bool>,
/// When omitted, the post keeps its current draft status. Send `false` to promote a draft to scheduled (combined with `scheduledFor`, `publishNow`, or a queue).
#[serde(rename = "isDraft", skip_serializing_if = "Option::is_none")]
pub is_draft: Option<bool>,
#[serde(rename = "timezone", skip_serializing_if = "Option::is_none")]
pub timezone: Option<String>,
#[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
pub visibility: Option<Visibility>,
#[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
/// Stored for reference only. Hashtags are NOT automatically appended to the caption when publishing. Include hashtags directly in the content field (platforms like Instagram only support hashtags as caption text). For YouTube keywords, use the tags field instead.
#[serde(rename = "hashtags", skip_serializing_if = "Option::is_none")]
pub hashtags: Option<Vec<String>>,
#[serde(rename = "mentions", skip_serializing_if = "Option::is_none")]
pub mentions: Option<Vec<String>>,
#[serde(
rename = "crosspostingEnabled",
skip_serializing_if = "Option::is_none"
)]
pub crossposting_enabled: Option<bool>,
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
pub metadata: Option<std::collections::HashMap<String, serde_json::Value>>,
/// Profile ID to schedule via queue.
#[serde(rename = "queuedFromProfile", skip_serializing_if = "Option::is_none")]
pub queued_from_profile: Option<String>,
/// Specific queue ID to use when scheduling via queue.
#[serde(rename = "queueId", skip_serializing_if = "Option::is_none")]
pub queue_id: Option<String>,
/// Root-level TikTok settings applied to the TikTok platforms sent in the same request. Merged into each platform's platformSpecificData, with platform-specific settings taking precedence. Returns 400 if sent without a platforms array.
#[serde(rename = "tiktokSettings", skip_serializing_if = "Option::is_none")]
pub tiktok_settings: Option<Box<models::TikTokPlatformData>>,
/// Root-level Facebook settings applied to the Facebook platforms sent in the same request. Merged into each platform's platformSpecificData.facebookSettings, with platform-specific settings taking precedence. Returns 400 if sent without a platforms array.
#[serde(rename = "facebookSettings", skip_serializing_if = "Option::is_none")]
pub facebook_settings: Option<Box<models::FacebookSettings>>,
#[serde(rename = "recycling", skip_serializing_if = "Option::is_none")]
pub recycling: Option<Box<models::RecyclingConfig>>,
}
impl UpdatePostRequest {
pub fn new() -> UpdatePostRequest {
UpdatePostRequest {
title: None,
content: None,
media_items: None,
platforms: None,
scheduled_for: None,
publish_now: None,
is_draft: None,
timezone: None,
visibility: None,
tags: None,
hashtags: None,
mentions: None,
crossposting_enabled: None,
metadata: None,
queued_from_profile: None,
queue_id: None,
tiktok_settings: None,
facebook_settings: None,
recycling: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Visibility {
#[serde(rename = "public")]
Public,
#[serde(rename = "private")]
Private,
#[serde(rename = "unlisted")]
Unlisted,
}
impl Default for Visibility {
fn default() -> Visibility {
Self::Public
}
}