zernio 0.0.76

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};

/// MediaItem : Media referenced in posts. URLs must be publicly reachable over HTTPS. Use POST /v1/media/presign for uploads up to 5GB. Zernio auto-compresses images and videos that exceed platform limits (videos over 200 MB may not be compressed).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MediaItem {
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Optional title for the media item. Used as the document title for LinkedIn PDF/carousel posts. If omitted, falls back to the post title, then the filename.
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    #[serde(rename = "filename", skip_serializing_if = "Option::is_none")]
    pub filename: Option<String>,
    /// Optional file size in bytes
    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
    pub size: Option<i32>,
    /// Optional MIME type (e.g. image/jpeg, video/mp4)
    #[serde(rename = "mimeType", skip_serializing_if = "Option::is_none")]
    pub mime_type: Option<String>,
    /// Optional custom thumbnail/cover image URL for videos. Supported for Facebook video posts, Facebook Reels, and regular video uploads. Max 10MB, JPG/PNG recommended.
    #[serde(rename = "thumbnail", skip_serializing_if = "Option::is_none")]
    pub thumbnail: Option<String>,
    /// Optional custom cover image URL for Instagram Reels
    #[serde(rename = "instagramThumbnail", skip_serializing_if = "Option::is_none")]
    pub instagram_thumbnail: Option<String>,
    /// Internal flag indicating the image was resized for TikTok
    #[serde(rename = "tiktokProcessed", skip_serializing_if = "Option::is_none")]
    pub tiktok_processed: Option<bool>,
}

impl MediaItem {
    /// Media referenced in posts. URLs must be publicly reachable over HTTPS. Use POST /v1/media/presign for uploads up to 5GB. Zernio auto-compresses images and videos that exceed platform limits (videos over 200 MB may not be compressed).
    pub fn new() -> MediaItem {
        MediaItem {
            r#type: None,
            url: None,
            title: None,
            filename: None,
            size: None,
            mime_type: None,
            thumbnail: None,
            instagram_thumbnail: None,
            tiktok_processed: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "image")]
    Image,
    #[serde(rename = "video")]
    Video,
    #[serde(rename = "gif")]
    Gif,
    #[serde(rename = "document")]
    Document,
}

impl Default for Type {
    fn default() -> Type {
        Self::Image
    }
}