/*
* 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).
*
* The version of the OpenAPI document: 1.71.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// XArticle : Long-form X Article payload. X Articles require an eligible X Premium+ account. Articles are mutually exclusive with top-level/custom tweet media and with threadItems, poll, quoteTweetId, replyToTweetId, inReplyToTweetId, replySettings, sensitiveMedia, paidPartnership, and madeWithAi. Publishing normally performs two billable X API requests at $0.010 each (draft + publish, $0.020 total); mode `draft` performs only the $0.010 draft request. `articleDraftId` is an internal recovery checkpoint and must not be supplied by API clients.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct XArticle {
#[serde(rename = "title")]
pub title: String,
#[serde(rename = "content_state")]
pub content_state: Box<models::XArticleContentState>,
/// Publish creates an X Article draft and then publishes it. Draft stops after draft creation and returns the X draft ID without a public URL.
#[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
pub mode: Option<Mode>,
#[serde(rename = "cover", skip_serializing_if = "Option::is_none")]
pub cover: Option<Box<models::XArticleCover>>,
}
impl XArticle {
/// Long-form X Article payload. X Articles require an eligible X Premium+ account. Articles are mutually exclusive with top-level/custom tweet media and with threadItems, poll, quoteTweetId, replyToTweetId, inReplyToTweetId, replySettings, sensitiveMedia, paidPartnership, and madeWithAi. Publishing normally performs two billable X API requests at $0.010 each (draft + publish, $0.020 total); mode `draft` performs only the $0.010 draft request. `articleDraftId` is an internal recovery checkpoint and must not be supplied by API clients.
pub fn new(title: String, content_state: models::XArticleContentState) -> XArticle {
XArticle {
title,
content_state: Box::new(content_state),
mode: None,
cover: None,
}
}
}
/// Publish creates an X Article draft and then publishes it. Draft stops after draft creation and returns the X draft ID without a public URL.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Mode {
#[serde(rename = "publish")]
Publish,
#[serde(rename = "draft")]
Draft,
}
impl Default for Mode {
fn default() -> Mode {
Self::Publish
}
}