/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.1
 * 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 {
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// Post caption/text. Optional when media is attached or all platforms have customContent. Required for 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::CreatePostRequestMediaItemsInner>>,
    /// 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>>,
    #[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 all TikTok platforms. 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>>,
    #[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,
            recycling: None,
            queued_from_profile: None,
            queue_id: None,
        }
    }
}
