Skip to main content

ghl_models/v2/
courses.rs

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