late 0.0.1313

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.
Documentation
/*
 * 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.456.0
 * 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 and Wix resolve existing names case-insensitively and create missing tags (Wix allows up to 30).
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<String>>,
    /// Shopify author display name, numeric WordPress user id serialized as a string, or Wix site member id. Assigning another WordPress user may require elevated capability. Wix posts without one go to the site's default author.
    #[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 and Wix 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>,
    /// Webflow only (other platforms answer 400). The collection's own fields that the Blogs API does not map, keyed by field slug, in Webflow's value format (a Reference is an item id, an Image is { url, alt }).  Required by collections with required fields of their own: a create that leaves one empty answers 400 listing them. A slug the API already fills (name, slug, body, summary, image, tags, author, date) or one the collection lacks answers 400.
    #[serde(rename = "fieldData", skip_serializing_if = "Option::is_none")]
    pub field_data: Option<std::collections::HashMap<String, serde_json::Value>>,
}

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,
            field_data: None,
        }
    }
}