ghl-models 0.5.2

Rust data models (DTOs) for the GoHighLevel (HighLevel) API v2 and v3, generated from the official OpenAPI specifications
Documentation
//! `courses` data models for GoHighLevel API V2 (10 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Courses** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`courses` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/courses.md).
//!
//! Enable with `features = ["courses"]`.
// @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};

/// `CategoryInterface` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CategoryInterface {
    /// Required by the API.
    pub title: String,
    /// Required by the API.
    pub visibility: Visibility,
    #[serde(
        rename = "thumbnailUrl",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub thumbnail_url: Option<String>,
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub posts: Vec<PostInterface>,
    #[serde(
        rename = "subCategories",
        default,
        skip_serializing_if = "Vec::is_empty"
    )]
    pub sub_categories: Vec<SubCategoryInterface>,
}

/// `InstructorDetails` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct InstructorDetails {
    /// Required by the API.
    pub name: String,
    /// Required by the API.
    pub description: String,
}

/// `PostInterface` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct PostInterface {
    /// Required by the API.
    pub title: String,
    /// Required by the API.
    pub visibility: Visibility,
    #[serde(
        rename = "thumbnailUrl",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub thumbnail_url: Option<String>,
    /// Required by the API.
    #[serde(rename = "contentType")]
    pub content_type: ContentType,
    /// Required by the API.
    pub description: String,
    #[serde(
        rename = "bucketVideoUrl",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub bucket_video_url: Option<String>,
    #[serde(
        rename = "postMaterials",
        default,
        skip_serializing_if = "Vec::is_empty"
    )]
    pub post_materials: Vec<PostMaterialInterface>,
}

/// `PostMaterialInterface` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct PostMaterialInterface {
    /// Required by the API.
    pub title: String,
    /// Required by the API.
    #[serde(rename = "type")]
    pub type_: Type,
    /// Required by the API.
    pub url: String,
}

/// `ProductInterface` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ProductInterface {
    /// Required by the API.
    pub title: String,
    /// Required by the API.
    pub description: String,
    #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")]
    pub image_url: Option<String>,
    /// Required by the API.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub categories: Vec<CategoryInterface>,
    #[serde(
        rename = "instructorDetails",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub instructor_details: Option<InstructorDetails>,
}

/// `PublicExporterPayload` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct PublicExporterPayload {
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
    pub user_id: Option<String>,
    /// Required by the API.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub products: Vec<ProductInterface>,
}

/// `SubCategoryInterface` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct SubCategoryInterface {
    /// Required by the API.
    pub title: String,
    /// Required by the API.
    pub visibility: Visibility,
    #[serde(
        rename = "thumbnailUrl",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub thumbnail_url: Option<String>,
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub posts: Vec<PostInterface>,
}

/// Allowed values: `video`, `assignment`, `quiz`.
/// Kept as `String` so new upstream values don't break deserialization.
pub type ContentType = String;

/// Allowed values: `pdf`, `image`, `docx`, `pptx`, `xlsx`, `html`, `dotx`, `epub`, `webp`,
/// `gdoc`, `mp3`, `doc`, `txt`, `zip`, `ppt`, `key`, `htm`, `xls`, `odp`, `odt`, `rtf`,
/// `m4a`, `ods`, `mp4`, `ai`, `avi`, `mov`, `wmv`, `mkv`, `wav`, `flac`, `ogg`, `png`,
/// `jpeg`, `jpg`, `gif`, `bmp`, `tiff`, `svg`, `odg`, `sxw`, `sxc`, `sxi`, `rar`, `7z`,
/// `json`, `xml`, `csv`, `md`, `obj`, `stl`, `woff`, `ttf`.
/// Kept as `String` so new upstream values don't break deserialization.
pub type Type = String;

/// Allowed values: `published`, `draft`.
/// Kept as `String` so new upstream values don't break deserialization.
pub type Visibility = String;