zernio 0.0.132

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
Documentation
/*
 * 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 Post {
    #[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
    pub _id: Option<String>,
    #[serde(rename = "userId", skip_serializing_if = "Option::is_none")]
    pub user_id: Option<Box<models::PostUserId>>,
    /// YouTube: title must be ≤ 100 characters.
    #[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>>,
    #[serde(rename = "platforms", skip_serializing_if = "Option::is_none")]
    pub platforms: Option<Vec<models::PlatformTarget>>,
    #[serde(rename = "scheduledFor", skip_serializing_if = "Option::is_none")]
    pub scheduled_for: Option<String>,
    #[serde(rename = "timezone", skip_serializing_if = "Option::is_none")]
    pub timezone: Option<String>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// YouTube constraints: each tag max 100 chars, combined max 500 chars, duplicates 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 = "visibility", skip_serializing_if = "Option::is_none")]
    pub visibility: Option<Visibility>,
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "recycling", skip_serializing_if = "Option::is_none")]
    pub recycling: Option<Box<models::RecyclingState>>,
    /// ID of the original post if this post was created via recycling
    #[serde(rename = "recycledFromPostId", skip_serializing_if = "Option::is_none")]
    pub recycled_from_post_id: Option<String>,
    /// Profile ID if the post was scheduled via the queue
    #[serde(rename = "queuedFromProfile", skip_serializing_if = "Option::is_none")]
    pub queued_from_profile: Option<String>,
    /// Queue ID if the post was scheduled via a specific queue
    #[serde(rename = "queueId", skip_serializing_if = "Option::is_none")]
    pub queue_id: Option<String>,
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
}

impl Post {
    pub fn new() -> Post {
        Post {
            _id: None,
            user_id: None,
            title: None,
            content: None,
            media_items: None,
            platforms: None,
            scheduled_for: None,
            timezone: None,
            status: None,
            tags: None,
            hashtags: None,
            mentions: None,
            visibility: None,
            metadata: None,
            recycling: None,
            recycled_from_post_id: None,
            queued_from_profile: None,
            queue_id: None,
            created_at: None,
            updated_at: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "draft")]
    Draft,
    #[serde(rename = "scheduled")]
    Scheduled,
    #[serde(rename = "publishing")]
    Publishing,
    #[serde(rename = "published")]
    Published,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "partial")]
    Partial,
}

impl Default for Status {
    fn default() -> Status {
        Self::Draft
    }
}
///
#[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
    }
}