/*
* Zernio API
*
* API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
*
* The version of the OpenAPI document: 1.104.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// TwitterPlatformData : X-specific post options. The article field creates a long-form X Article and is mutually exclusive with tweet media and tweet-only options. Geo-restriction applies at the media level: media is hidden outside the specified countries while tweet text remains visible.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TwitterPlatformData {
#[serde(rename = "article", skip_serializing_if = "Option::is_none")]
pub article: Option<Box<models::XArticle>>,
/// ID of an existing tweet to reply to. The published tweet will appear as a reply in that tweet's thread. For threads, only the first tweet replies to the target; subsequent tweets chain normally. X only permits replying to your own posts or posts you are mentioned in; replying to an arbitrary other account's post is rejected by X.
#[serde(rename = "replyToTweetId", skip_serializing_if = "Option::is_none")]
pub reply_to_tweet_id: Option<String>,
/// ID (or full status URL) of an existing tweet to quote-repost. The published tweet becomes a quote tweet of the target. Mutually exclusive with media and poll. X only permits quoting your own posts or posts you are mentioned in / part of the conversation thread of; quoting an arbitrary other account's post is rejected by X. Billed at the standard create rate ($0.015), unlike pasting a tweet URL into the text which is billed at the URL rate ($0.20). For threads, applies to the first tweet only.
#[serde(rename = "quoteTweetId", skip_serializing_if = "Option::is_none")]
pub quote_tweet_id: Option<String>,
/// Controls who can reply to the tweet. \"following\" allows only people you follow, \"mentionedUsers\" allows only mentioned users, \"subscribers\" allows only subscribers, \"verified\" allows only verified users. Omit for default (everyone can reply). For threads, applies to the first tweet only. Cannot be combined with replyToTweetId.
#[serde(rename = "replySettings", skip_serializing_if = "Option::is_none")]
pub reply_settings: Option<ReplySettings>,
/// Complete sequence of tweets in a thread. The first item becomes the root tweet, subsequent items are chained as replies. When threadItems is provided, the top-level content field is used only for display and search purposes, it is NOT published. You must include your first tweet as threadItems[0].
#[serde(rename = "threadItems", skip_serializing_if = "Option::is_none")]
pub thread_items: Option<Vec<models::TwitterPlatformDataThreadItemsInner>>,
#[serde(rename = "poll", skip_serializing_if = "Option::is_none")]
pub poll: Option<Box<models::TwitterPlatformDataPoll>>,
/// Uploads the video with X's amplify_video media category instead of the standard tweet_video. Applied only when the connected X account has a paid X subscription; on other accounts the flag is accepted and ignored. It is not required to post long videos. The standard tweet_video path already publishes videos well past 140 seconds on free accounts, and maximum duration is set by X per account, not by Zernio. Zernio enforces only the 512 MB file-size limit. Some accounts additionally require X's long-video API allowlisting, without which X rejects an amplify_video upload.
#[serde(rename = "longVideo", skip_serializing_if = "Option::is_none")]
pub long_video: Option<bool>,
#[serde(rename = "geoRestriction", skip_serializing_if = "Option::is_none")]
pub geo_restriction: Option<Box<models::GeoRestriction>>,
/// When true, the post is labeled by X as a paid partnership / paid promotion. For threads, applies to the root tweet only. Field availability may depend on your X API access tier.
#[serde(rename = "paidPartnership", skip_serializing_if = "Option::is_none")]
pub paid_partnership: Option<bool>,
/// When true, the post is labeled by X as containing AI-generated media. Per X, this label is for AI-generated media, not AI-written text. For threads, applies to the root tweet only.
#[serde(rename = "madeWithAi", skip_serializing_if = "Option::is_none")]
pub made_with_ai: Option<bool>,
#[serde(rename = "sensitiveMedia", skip_serializing_if = "Option::is_none")]
pub sensitive_media: Option<Box<models::TwitterPlatformDataSensitiveMedia>>,
}
impl TwitterPlatformData {
/// X-specific post options. The article field creates a long-form X Article and is mutually exclusive with tweet media and tweet-only options. Geo-restriction applies at the media level: media is hidden outside the specified countries while tweet text remains visible.
pub fn new() -> TwitterPlatformData {
TwitterPlatformData {
article: None,
reply_to_tweet_id: None,
quote_tweet_id: None,
reply_settings: None,
thread_items: None,
poll: None,
long_video: None,
geo_restriction: None,
paid_partnership: None,
made_with_ai: None,
sensitive_media: None,
}
}
}
/// Controls who can reply to the tweet. \"following\" allows only people you follow, \"mentionedUsers\" allows only mentioned users, \"subscribers\" allows only subscribers, \"verified\" allows only verified users. Omit for default (everyone can reply). For threads, applies to the first tweet only. Cannot be combined with replyToTweetId.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ReplySettings {
#[serde(rename = "following")]
Following,
#[serde(rename = "mentionedUsers")]
MentionedUsers,
#[serde(rename = "subscribers")]
Subscribers,
#[serde(rename = "verified")]
Verified,
}
impl Default for ReplySettings {
fn default() -> ReplySettings {
Self::Following
}
}