/*
* 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};
/// BlogArticle : An article inside a blog on the connected platform.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BlogArticle {
/// Platform-native numeric article/post id.
#[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>,
/// Tag names. On WordPress, missing tag names are created and matching is case-insensitive.
#[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.
#[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>,
/// Publication time. On WordPress this is present only when status is `publish`; null for drafts, pending/private posts, and scheduled posts.
#[serde(
rename = "publishedAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub published_at: Option<Option<String>>,
/// WordPress only. Native post status returned by WordPress; omitted for Shopify.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
/// WordPress only. Scheduled publication time in UTC when status is `future`; null for other WordPress statuses and omitted for Shopify.
#[serde(
rename = "publishDate",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub publish_date: Option<Option<String>>,
/// Creation time when the platform exposes one. WordPress returns null because its core date is the editable publication date.
#[serde(
rename = "createdAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub created_at: Option<Option<String>>,
/// Last modification time. WordPress returns modified_gmt as UTC.
#[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,
status: None,
publish_date: 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,
#[serde(rename = "wordpress")]
Wordpress,
}
impl Default for Platform {
fn default() -> Platform {
Self::Shopify
}
}
/// WordPress only. Native post status returned by WordPress; omitted for Shopify.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "publish")]
Publish,
#[serde(rename = "future")]
Future,
#[serde(rename = "draft")]
Draft,
#[serde(rename = "pending")]
Pending,
#[serde(rename = "private")]
Private,
}
impl Default for Status {
fn default() -> Status {
Self::Publish
}
}