late 0.0.847

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).
Documentation
/*
 * 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).
 *
 * The version of the OpenAPI document: 1.0.4
 * 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 CreatePostRequest {
    /// 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>,
    /// Post caption/text. Optional when media is attached, all platforms have customContent, every platform entry is an X Article (platformSpecificData.article), or every platform entry is a LinkedIn text-free reshare (platformSpecificData.reshareUrl with no text). Required for other text-only posts.
    #[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. Required for non-draft posts (returns 400 if empty). Drafts can omit platforms.
    #[serde(rename = "platforms", skip_serializing_if = "Option::is_none")]
    pub platforms: Option<Vec<models::CreatePostRequestPlatformsInner>>,
    #[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 true, saves the post as a draft. When none of scheduledFor, publishNow, or queuedFromProfile are provided, the post defaults to draft automatically.
    #[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>,
    /// Tags/keywords. YouTube constraints: each tag max 100 chars, combined max 500 chars, duplicates auto-removed.
    #[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>>,
    /// Stored for reference only. This field does NOT automatically create @mentions when publishing. For LinkedIn @mentions, use the /v1/accounts/{accountId}/linkedin-mentions endpoint to resolve profile URLs to URNs, then embed the returned mentionFormat directly in the post content field.
    #[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>>,
    /// 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.
    #[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.
    #[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>>,
    /// Profile ID to schedule via queue. When provided without scheduledFor, the post is auto-assigned to the next available slot. Do not call /v1/queue/next-slot and use that time in scheduledFor, as that bypasses queue locking.
    #[serde(rename = "queuedFromProfile", skip_serializing_if = "Option::is_none")]
    pub queued_from_profile: Option<String>,
    /// Specific queue ID to use when scheduling via queue. Only used when queuedFromProfile is also provided. If omitted, uses the profile's default queue.
    #[serde(rename = "queueId", skip_serializing_if = "Option::is_none")]
    pub queue_id: Option<String>,
}

impl CreatePostRequest {
    pub fn new() -> CreatePostRequest {
        CreatePostRequest {
            title: None,
            content: None,
            media_items: None,
            platforms: None,
            scheduled_for: None,
            publish_now: None,
            is_draft: None,
            timezone: None,
            tags: None,
            hashtags: None,
            mentions: None,
            crossposting_enabled: None,
            metadata: None,
            tiktok_settings: None,
            facebook_settings: None,
            recycling: None,
            queued_from_profile: None,
            queue_id: None,
        }
    }
}