/*
* 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.96.1
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateBlogArticleRequest {
#[serde(rename = "title")]
pub title: String,
/// Article body as HTML.
#[serde(rename = "bodyHtml", skip_serializing_if = "Option::is_none")]
pub body_html: Option<String>,
/// URL slug. Generated from the title when omitted.
#[serde(rename = "handle", skip_serializing_if = "Option::is_none")]
pub handle: Option<String>,
/// Tag names. WordPress resolves existing names case-insensitively and creates missing tags.
#[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
/// Shopify author display name, or numeric WordPress user id serialized as a string. Assigning another WordPress user may require elevated capability.
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
pub author: Option<String>,
/// Short summary shown in blog listings.
#[serde(rename = "excerpt", skip_serializing_if = "Option::is_none")]
pub excerpt: Option<String>,
#[serde(rename = "image", skip_serializing_if = "Option::is_none")]
pub image: Option<Box<models::CreateBlogArticleRequestImage>>,
#[serde(rename = "seo", skip_serializing_if = "Option::is_none")]
pub seo: Option<Box<models::CreateBlogArticleRequestSeo>>,
/// Set false for a draft or true to publish. On WordPress false takes priority over a future publishDate; omission with no date defaults to draft.
#[serde(rename = "isPublished", skip_serializing_if = "Option::is_none")]
pub is_published: Option<bool>,
/// ISO 8601 datetime with offset (or Z). A future date schedules publication natively on the platform.
#[serde(rename = "publishDate", skip_serializing_if = "Option::is_none")]
pub publish_date: Option<String>,
}
impl CreateBlogArticleRequest {
pub fn new(title: String) -> CreateBlogArticleRequest {
CreateBlogArticleRequest {
title,
body_html: None,
handle: None,
tags: None,
author: None,
excerpt: None,
image: None,
seo: None,
is_published: None,
publish_date: None,
}
}
}