1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* 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
}
}