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

/// RedditPlatformData : Posts are either link (with URL/media) 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>,
}

impl RedditPlatformData {
    /// Posts are either link (with URL/media) 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,
        }
    }
}