late 0.0.799

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).
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).
 *
 * The version of the OpenAPI document: 1.0.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// BlogArticle : An article inside a blog on the connected platform.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BlogArticle {
    /// Platform-native article id (numeric string for Shopify).
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Platform-native id of the blog the article belongs to.
    #[serde(rename = "blogId", skip_serializing_if = "Option::is_none")]
    pub blog_id: Option<String>,
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<Platform>,
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// Article body as HTML.
    #[serde(
        rename = "bodyHtml",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub body_html: Option<Option<String>>,
    /// URL slug of the article.
    #[serde(rename = "handle", skip_serializing_if = "Option::is_none")]
    pub handle: Option<String>,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<String>>,
    /// Display name of the article author.
    #[serde(
        rename = "author",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub author: Option<Option<String>>,
    /// Short summary shown in blog listings.
    #[serde(
        rename = "excerpt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub excerpt: Option<Option<String>>,
    #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
    pub image: Option<Box<models::BlogArticleImage>>,
    /// False while the article is a draft or its publish date is still in the future.
    #[serde(rename = "isPublished", skip_serializing_if = "Option::is_none")]
    pub is_published: Option<bool>,
    /// When the article was (or is scheduled to be) published; null for drafts.
    #[serde(
        rename = "publishedAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub published_at: Option<Option<String>>,
    #[serde(
        rename = "createdAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub created_at: Option<Option<String>>,
    #[serde(
        rename = "updatedAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub updated_at: Option<Option<String>>,
}

impl BlogArticle {
    /// An article inside a blog on the connected platform.
    pub fn new() -> BlogArticle {
        BlogArticle {
            id: None,
            blog_id: None,
            platform: None,
            title: None,
            body_html: None,
            handle: None,
            tags: None,
            author: None,
            excerpt: None,
            image: None,
            is_published: None,
            published_at: None,
            created_at: None,
            updated_at: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
    #[serde(rename = "shopify")]
    Shopify,
}

impl Default for Platform {
    fn default() -> Platform {
        Self::Shopify
    }
}