ghl-models 0.5.2

Rust data models (DTOs) for the GoHighLevel (HighLevel) API v2 and v3, generated from the official OpenAPI specifications
Documentation
//! `blogs` data models for GoHighLevel API V2 (13 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Blogs** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`blogs` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/blogs.md).
//!
//! Enable with `features = ["blogs"]`.
// @generated by xtask/generate_models.py — do not edit by hand.
// Source: https://github.com/GoHighLevel/highlevel-api-docs
// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
// they aren't held to rustdoc's markdown conventions.
#![allow(
    missing_docs,
    clippy::doc_lazy_continuation,
    clippy::doc_overindented_list_items
)]

use serde::{Deserialize, Serialize};

/// `AuthorResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct AuthorResponseDTO {
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "locationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub location_id: Option<String>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "canonicalLink",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub canonical_link: Option<String>,
}

/// `AuthorsResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct AuthorsResponseDTO {
    /// Array of authors
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub authors: Vec<AuthorResponseDTO>,
}

/// `BlogGetResponseWrapperDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BlogGetResponseWrapperDTO {
    /// Object containing response data of blog
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub data: Vec<BlogResponseDTO>,
}

/// `BlogPostCreateResponseWrapperDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BlogPostCreateResponseWrapperDTO {
    /// Object containing response data of blog post create.
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<BlogPostResponseDTO>,
}

/// `BlogPostGetResponseWrapperDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BlogPostGetResponseWrapperDTO {
    /// Object containing response data of blog posts
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub blogs: Vec<BlogPostResponseDTO>,
}

/// `BlogPostResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BlogPostResponseDTO {
    /// Array of category IDs associated with the blog post
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub categories: Vec<String>,
    /// Array of tags associated with the blog post
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<String>,
    /// Indicates whether the blog post is archived
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub archived: Option<bool>,
    /// Unique identifier of the blog post
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Title of the blog post
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// Description of the blog post
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// URL of the image associated with the blog post
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")]
    pub image_url: Option<String>,
    /// Publication status of the blog post
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// Alternative text for the blog post image
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "imageAltText",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub image_alt_text: Option<String>,
    /// URL slug for the blog post
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "urlSlug", default, skip_serializing_if = "Option::is_none")]
    pub url_slug: Option<String>,
    /// Canonical link of the blog post
    #[serde(
        rename = "canonicalLink",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub canonical_link: Option<String>,
    /// Identifier of the author of the blog post
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub author: Option<String>,
    /// Timestamp when the blog post was published
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "publishedAt",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub published_at: Option<String>,
    /// Timestamp when the blog post was last updated
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
}

/// `BlogPostUpdateResponseWrapperDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BlogPostUpdateResponseWrapperDTO {
    /// Object containing response data of blog post update
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "updatedBlogPost",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub updated_blog_post: Option<BlogPostResponseDTO>,
}

/// `BlogResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BlogResponseDTO {
    /// Unique identifier of the blog
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Name of the blog
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

/// `CategoriesResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CategoriesResponseDTO {
    /// Array of categories
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub categories: Vec<CategoryResponseDTO>,
}

/// `CategoryResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CategoryResponseDTO {
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "locationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub location_id: Option<String>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "canonicalLink",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub canonical_link: Option<String>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "urlSlug", default, skip_serializing_if = "Option::is_none")]
    pub url_slug: Option<String>,
}

/// `CreateBlogPostParams` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateBlogPostParams {
    /// Required by the API.
    pub title: String,
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    /// You can find the blog id from blog site dashboard link
    /// Required by the API.
    #[serde(rename = "blogId")]
    pub blog_id: String,
    /// Required by the API.
    #[serde(rename = "imageUrl")]
    pub image_url: String,
    /// Required by the API.
    pub description: String,
    /// Required by the API.
    #[serde(rename = "rawHTML")]
    pub raw_html: String,
    /// Allowed values: `DRAFT`, `PUBLISHED`, `SCHEDULED`, `ARCHIVED`.
    /// Required by the API.
    pub status: String,
    /// Required by the API.
    #[serde(rename = "imageAltText")]
    pub image_alt_text: String,
    /// This needs to be array of category ids, which you can get from the category get api
    /// call.
    /// Required by the API.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub categories: Vec<String>,
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<String>,
    /// This needs to be author id, which you can get from the author get api call.
    /// Required by the API.
    pub author: String,
    /// Required by the API.
    #[serde(rename = "urlSlug")]
    pub url_slug: String,
    #[serde(
        rename = "canonicalLink",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub canonical_link: Option<String>,
    /// Provide ISO timestamp
    /// Required by the API.
    #[serde(rename = "publishedAt")]
    pub published_at: String,
}

/// `UpdateBlogPostParams` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateBlogPostParams {
    /// Required by the API.
    pub title: String,
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    /// You can find the blog id from blog site dashboard link
    /// Required by the API.
    #[serde(rename = "blogId")]
    pub blog_id: String,
    /// Required by the API.
    #[serde(rename = "imageUrl")]
    pub image_url: String,
    /// Required by the API.
    pub description: String,
    /// Required by the API.
    #[serde(rename = "rawHTML")]
    pub raw_html: String,
    /// Allowed values: `DRAFT`, `PUBLISHED`, `SCHEDULED`, `ARCHIVED`.
    /// Required by the API.
    pub status: String,
    /// Required by the API.
    #[serde(rename = "imageAltText")]
    pub image_alt_text: String,
    /// This needs to be array of category ids, which you can get from the category get api
    /// call.
    /// Required by the API.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub categories: Vec<String>,
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<String>,
    /// This needs to be author id, which you can get from the author get api call.
    /// Required by the API.
    pub author: String,
    /// Required by the API.
    #[serde(rename = "urlSlug")]
    pub url_slug: String,
    #[serde(
        rename = "canonicalLink",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub canonical_link: Option<String>,
    /// Provide ISO timestamp
    /// Required by the API.
    #[serde(rename = "publishedAt")]
    pub published_at: String,
}

/// `UrlSlugCheckResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UrlSlugCheckResponseDTO {
    /// Indicates whether the url slug exists or not
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub exists: Option<bool>,
}