Skip to main content

ghl_models/v3/
courses.rs

1//! `courses` data models for GoHighLevel API V3 (10 types).
2//!
3//! Generated from HighLevel's official OpenAPI spec for the
4//! **Courses** module. Every endpoint that uses these types, with its
5//! parameters, required scopes and enum values, is documented in the
6//! [`courses` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/courses.md).
7//!
8//! Enable with `features = ["courses"]`.
9// @generated by xtask/generate_models.py — do not edit by hand.
10// Source: https://github.com/GoHighLevel/highlevel-api-docs
11// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
12// they aren't held to rustdoc's markdown conventions.
13#![allow(
14    missing_docs,
15    clippy::doc_lazy_continuation,
16    clippy::doc_overindented_list_items
17)]
18
19use serde::{Deserialize, Serialize};
20
21/// `CategoryInterface` from the GoHighLevel OpenAPI spec.
22#[derive(Debug, Clone, Default, Serialize, Deserialize)]
23pub struct CategoryInterface {
24    /// Required by the API.
25    pub title: String,
26    /// Required by the API.
27    pub visibility: Visibility,
28    #[serde(
29        rename = "thumbnailUrl",
30        default,
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub thumbnail_url: Option<String>,
34    #[serde(default, skip_serializing_if = "Vec::is_empty")]
35    pub posts: Vec<PostInterface>,
36    #[serde(
37        rename = "subCategories",
38        default,
39        skip_serializing_if = "Vec::is_empty"
40    )]
41    pub sub_categories: Vec<SubCategoryInterface>,
42}
43
44/// `InstructorDetails` from the GoHighLevel OpenAPI spec.
45#[derive(Debug, Clone, Default, Serialize, Deserialize)]
46pub struct InstructorDetails {
47    /// Required by the API.
48    pub name: String,
49    /// Required by the API.
50    pub description: String,
51}
52
53/// `PostInterface` from the GoHighLevel OpenAPI spec.
54#[derive(Debug, Clone, Default, Serialize, Deserialize)]
55pub struct PostInterface {
56    /// Required by the API.
57    pub title: String,
58    /// Required by the API.
59    pub visibility: Visibility,
60    #[serde(
61        rename = "thumbnailUrl",
62        default,
63        skip_serializing_if = "Option::is_none"
64    )]
65    pub thumbnail_url: Option<String>,
66    /// Required by the API.
67    #[serde(rename = "contentType")]
68    pub content_type: ContentType,
69    /// Required by the API.
70    pub description: String,
71    #[serde(
72        rename = "bucketVideoUrl",
73        default,
74        skip_serializing_if = "Option::is_none"
75    )]
76    pub bucket_video_url: Option<String>,
77    #[serde(
78        rename = "postMaterials",
79        default,
80        skip_serializing_if = "Vec::is_empty"
81    )]
82    pub post_materials: Vec<PostMaterialInterface>,
83}
84
85/// `PostMaterialInterface` from the GoHighLevel OpenAPI spec.
86#[derive(Debug, Clone, Default, Serialize, Deserialize)]
87pub struct PostMaterialInterface {
88    /// Required by the API.
89    pub title: String,
90    /// Required by the API.
91    #[serde(rename = "type")]
92    pub type_: Type,
93    /// Required by the API.
94    pub url: String,
95}
96
97/// `ProductInterface` from the GoHighLevel OpenAPI spec.
98#[derive(Debug, Clone, Default, Serialize, Deserialize)]
99pub struct ProductInterface {
100    /// Required by the API.
101    pub title: String,
102    /// Required by the API.
103    pub description: String,
104    #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")]
105    pub image_url: Option<String>,
106    /// Required by the API.
107    #[serde(default, skip_serializing_if = "Vec::is_empty")]
108    pub categories: Vec<CategoryInterface>,
109    #[serde(
110        rename = "instructorDetails",
111        default,
112        skip_serializing_if = "Option::is_none"
113    )]
114    pub instructor_details: Option<InstructorDetails>,
115}
116
117/// `PublicExporterPayload` from the GoHighLevel OpenAPI spec.
118#[derive(Debug, Clone, Default, Serialize, Deserialize)]
119pub struct PublicExporterPayload {
120    /// Required by the API.
121    #[serde(rename = "locationId")]
122    pub location_id: String,
123    #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
124    pub user_id: Option<String>,
125    /// Required by the API.
126    #[serde(default, skip_serializing_if = "Vec::is_empty")]
127    pub products: Vec<ProductInterface>,
128}
129
130/// `SubCategoryInterface` from the GoHighLevel OpenAPI spec.
131#[derive(Debug, Clone, Default, Serialize, Deserialize)]
132pub struct SubCategoryInterface {
133    /// Required by the API.
134    pub title: String,
135    /// Required by the API.
136    pub visibility: Visibility,
137    #[serde(
138        rename = "thumbnailUrl",
139        default,
140        skip_serializing_if = "Option::is_none"
141    )]
142    pub thumbnail_url: Option<String>,
143    #[serde(default, skip_serializing_if = "Vec::is_empty")]
144    pub posts: Vec<PostInterface>,
145}
146
147/// Allowed values: `video`, `assignment`, `quiz`.
148/// Kept as `String` so new upstream values don't break deserialization.
149pub type ContentType = String;
150
151/// Allowed values: `pdf`, `image`, `docx`, `pptx`, `xlsx`, `html`, `dotx`, `epub`, `webp`,
152/// `gdoc`, `mp3`, `doc`, `txt`, `zip`, `ppt`, `key`, `htm`, `xls`, `odp`, `odt`, `rtf`,
153/// `m4a`, `ods`, `mp4`, `ai`, `avi`, `mov`, `wmv`, `mkv`, `wav`, `flac`, `ogg`, `png`,
154/// `jpeg`, `jpg`, `gif`, `bmp`, `tiff`, `svg`, `odg`, `sxw`, `sxc`, `sxi`, `rar`, `7z`,
155/// `json`, `xml`, `csv`, `md`, `obj`, `stl`, `woff`, `ttf`.
156/// Kept as `String` so new upstream values don't break deserialization.
157pub type Type = String;
158
159/// Allowed values: `published`, `draft`.
160/// Kept as `String` so new upstream values don't break deserialization.
161pub type Visibility = String;