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
/*
* 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.4
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// RedditPlatformData : Posts are either link (with URL/media), native video (via nativeVideo), or self (text-only). Use forceSelf to override. Subreddit defaults to the account's configured one. Some subreddits require a flair.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RedditPlatformData {
/// Target subreddit name (without \"r/\" prefix). Overrides the default. Use GET /v1/accounts/{id}/reddit-subreddits to list options.
#[serde(rename = "subreddit", skip_serializing_if = "Option::is_none")]
pub subreddit: Option<String>,
/// Post title. Defaults to the first line of content, truncated to 300 characters.
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
/// URL for link posts. If provided (and forceSelf is not true), creates a link post instead of a text post.
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
/// When true, creates a text/self post even when a URL or media is provided.
#[serde(rename = "forceSelf", skip_serializing_if = "Option::is_none")]
pub force_self: Option<bool>,
/// Flair ID for the post. Required by some subreddits. Use GET /v1/accounts/{id}/reddit-flairs?subreddit=name to list flairs.
#[serde(rename = "flairId", skip_serializing_if = "Option::is_none")]
pub flair_id: Option<String>,
/// Controls Reddit's native video upload flow. When true (default for video mediaItems), the video is uploaded to Reddit's CDN and submitted with kind=video so it renders as an embedded Reddit video player. Reddit transcodes server-side (1080p/30fps cap). Set to false to fall back to a legacy link post. If the subreddit blocks video posts, the upload falls back to a link post automatically.
#[serde(rename = "nativeVideo", skip_serializing_if = "Option::is_none")]
pub native_video: Option<bool>,
/// When true (and nativeVideo is active), submits the video as a silent videogif (kind=videogif). Use for short looping clips without audio.
#[serde(rename = "videogif", skip_serializing_if = "Option::is_none")]
pub videogif: Option<bool>,
/// Optional poster/thumbnail image URL for native video posts. If omitted, the first frame of the video is extracted and used automatically.
#[serde(rename = "videoPosterUrl", skip_serializing_if = "Option::is_none")]
pub video_poster_url: Option<String>,
}
impl RedditPlatformData {
/// Posts are either link (with URL/media), native video (via nativeVideo), or self (text-only). Use forceSelf to override. Subreddit defaults to the account's configured one. Some subreddits require a flair.
pub fn new() -> RedditPlatformData {
RedditPlatformData {
subreddit: None,
title: None,
url: None,
force_self: None,
flair_id: None,
native_video: None,
videogif: None,
video_poster_url: None,
}
}
}