ghl_models/v2/blogs.rs
1//! `blogs` data models for GoHighLevel API V2 (13 types).
2//!
3//! Generated from HighLevel's official OpenAPI spec for the
4//! **Blogs** module. Every endpoint that uses these types, with its
5//! parameters, required scopes and enum values, is documented in the
6//! [`blogs` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/blogs.md).
7//!
8//! Enable with `features = ["blogs"]`.
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/// `AuthorResponseDTO` from the GoHighLevel OpenAPI spec.
22#[derive(Debug, Clone, Default, Serialize, Deserialize)]
23pub struct AuthorResponseDTO {
24 /// Required by the API.
25 /// (Optional here so responses that omit it still parse.)
26 #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
27 pub id: Option<String>,
28 /// Required by the API.
29 /// (Optional here so responses that omit it still parse.)
30 #[serde(default, skip_serializing_if = "Option::is_none")]
31 pub name: Option<String>,
32 /// Required by the API.
33 /// (Optional here so responses that omit it still parse.)
34 #[serde(
35 rename = "locationId",
36 default,
37 skip_serializing_if = "Option::is_none"
38 )]
39 pub location_id: Option<String>,
40 /// Required by the API.
41 /// (Optional here so responses that omit it still parse.)
42 #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
43 pub updated_at: Option<String>,
44 /// Required by the API.
45 /// (Optional here so responses that omit it still parse.)
46 #[serde(
47 rename = "canonicalLink",
48 default,
49 skip_serializing_if = "Option::is_none"
50 )]
51 pub canonical_link: Option<String>,
52}
53
54/// `AuthorsResponseDTO` from the GoHighLevel OpenAPI spec.
55#[derive(Debug, Clone, Default, Serialize, Deserialize)]
56pub struct AuthorsResponseDTO {
57 /// Array of authors
58 /// Required by the API.
59 /// (Optional here so responses that omit it still parse.)
60 #[serde(default, skip_serializing_if = "Vec::is_empty")]
61 pub authors: Vec<AuthorResponseDTO>,
62}
63
64/// `BlogGetResponseWrapperDTO` from the GoHighLevel OpenAPI spec.
65#[derive(Debug, Clone, Default, Serialize, Deserialize)]
66pub struct BlogGetResponseWrapperDTO {
67 /// Object containing response data of blog
68 /// Required by the API.
69 /// (Optional here so responses that omit it still parse.)
70 #[serde(default, skip_serializing_if = "Vec::is_empty")]
71 pub data: Vec<BlogResponseDTO>,
72}
73
74/// `BlogPostCreateResponseWrapperDTO` from the GoHighLevel OpenAPI spec.
75#[derive(Debug, Clone, Default, Serialize, Deserialize)]
76pub struct BlogPostCreateResponseWrapperDTO {
77 /// Object containing response data of blog post create.
78 /// Required by the API.
79 /// (Optional here so responses that omit it still parse.)
80 #[serde(default, skip_serializing_if = "Option::is_none")]
81 pub data: Option<BlogPostResponseDTO>,
82}
83
84/// `BlogPostGetResponseWrapperDTO` from the GoHighLevel OpenAPI spec.
85#[derive(Debug, Clone, Default, Serialize, Deserialize)]
86pub struct BlogPostGetResponseWrapperDTO {
87 /// Object containing response data of blog posts
88 /// Required by the API.
89 /// (Optional here so responses that omit it still parse.)
90 #[serde(default, skip_serializing_if = "Vec::is_empty")]
91 pub blogs: Vec<BlogPostResponseDTO>,
92}
93
94/// `BlogPostResponseDTO` from the GoHighLevel OpenAPI spec.
95#[derive(Debug, Clone, Default, Serialize, Deserialize)]
96pub struct BlogPostResponseDTO {
97 /// Array of category IDs associated with the blog post
98 /// Required by the API.
99 /// (Optional here so responses that omit it still parse.)
100 #[serde(default, skip_serializing_if = "Vec::is_empty")]
101 pub categories: Vec<String>,
102 /// Array of tags associated with the blog post
103 #[serde(default, skip_serializing_if = "Vec::is_empty")]
104 pub tags: Vec<String>,
105 /// Indicates whether the blog post is archived
106 /// Required by the API.
107 /// (Optional here so responses that omit it still parse.)
108 #[serde(default, skip_serializing_if = "Option::is_none")]
109 pub archived: Option<bool>,
110 /// Unique identifier of the blog post
111 /// Required by the API.
112 /// (Optional here so responses that omit it still parse.)
113 #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
114 pub id: Option<String>,
115 /// Title of the blog post
116 /// Required by the API.
117 /// (Optional here so responses that omit it still parse.)
118 #[serde(default, skip_serializing_if = "Option::is_none")]
119 pub title: Option<String>,
120 /// Description of the blog post
121 /// Required by the API.
122 /// (Optional here so responses that omit it still parse.)
123 #[serde(default, skip_serializing_if = "Option::is_none")]
124 pub description: Option<String>,
125 /// URL of the image associated with the blog post
126 /// Required by the API.
127 /// (Optional here so responses that omit it still parse.)
128 #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")]
129 pub image_url: Option<String>,
130 /// Publication status of the blog post
131 /// Required by the API.
132 /// (Optional here so responses that omit it still parse.)
133 #[serde(default, skip_serializing_if = "Option::is_none")]
134 pub status: Option<String>,
135 /// Alternative text for the blog post image
136 /// Required by the API.
137 /// (Optional here so responses that omit it still parse.)
138 #[serde(
139 rename = "imageAltText",
140 default,
141 skip_serializing_if = "Option::is_none"
142 )]
143 pub image_alt_text: Option<String>,
144 /// URL slug for the blog post
145 /// Required by the API.
146 /// (Optional here so responses that omit it still parse.)
147 #[serde(rename = "urlSlug", default, skip_serializing_if = "Option::is_none")]
148 pub url_slug: Option<String>,
149 /// Canonical link of the blog post
150 #[serde(
151 rename = "canonicalLink",
152 default,
153 skip_serializing_if = "Option::is_none"
154 )]
155 pub canonical_link: Option<String>,
156 /// Identifier of the author of the blog post
157 #[serde(default, skip_serializing_if = "Option::is_none")]
158 pub author: Option<String>,
159 /// Timestamp when the blog post was published
160 /// Required by the API.
161 /// (Optional here so responses that omit it still parse.)
162 #[serde(
163 rename = "publishedAt",
164 default,
165 skip_serializing_if = "Option::is_none"
166 )]
167 pub published_at: Option<String>,
168 /// Timestamp when the blog post was last updated
169 /// Required by the API.
170 /// (Optional here so responses that omit it still parse.)
171 #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
172 pub updated_at: Option<String>,
173}
174
175/// `BlogPostUpdateResponseWrapperDTO` from the GoHighLevel OpenAPI spec.
176#[derive(Debug, Clone, Default, Serialize, Deserialize)]
177pub struct BlogPostUpdateResponseWrapperDTO {
178 /// Object containing response data of blog post update
179 /// Required by the API.
180 /// (Optional here so responses that omit it still parse.)
181 #[serde(
182 rename = "updatedBlogPost",
183 default,
184 skip_serializing_if = "Option::is_none"
185 )]
186 pub updated_blog_post: Option<BlogPostResponseDTO>,
187}
188
189/// `BlogResponseDTO` from the GoHighLevel OpenAPI spec.
190#[derive(Debug, Clone, Default, Serialize, Deserialize)]
191pub struct BlogResponseDTO {
192 /// Unique identifier of the blog
193 /// Required by the API.
194 /// (Optional here so responses that omit it still parse.)
195 #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
196 pub id: Option<String>,
197 /// Name of the blog
198 /// Required by the API.
199 /// (Optional here so responses that omit it still parse.)
200 #[serde(default, skip_serializing_if = "Option::is_none")]
201 pub name: Option<String>,
202}
203
204/// `CategoriesResponseDTO` from the GoHighLevel OpenAPI spec.
205#[derive(Debug, Clone, Default, Serialize, Deserialize)]
206pub struct CategoriesResponseDTO {
207 /// Array of categories
208 /// Required by the API.
209 /// (Optional here so responses that omit it still parse.)
210 #[serde(default, skip_serializing_if = "Vec::is_empty")]
211 pub categories: Vec<CategoryResponseDTO>,
212}
213
214/// `CategoryResponseDTO` from the GoHighLevel OpenAPI spec.
215#[derive(Debug, Clone, Default, Serialize, Deserialize)]
216pub struct CategoryResponseDTO {
217 /// Required by the API.
218 /// (Optional here so responses that omit it still parse.)
219 #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
220 pub id: Option<String>,
221 #[serde(default, skip_serializing_if = "Option::is_none")]
222 pub label: Option<String>,
223 /// Required by the API.
224 /// (Optional here so responses that omit it still parse.)
225 #[serde(
226 rename = "locationId",
227 default,
228 skip_serializing_if = "Option::is_none"
229 )]
230 pub location_id: Option<String>,
231 /// Required by the API.
232 /// (Optional here so responses that omit it still parse.)
233 #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
234 pub updated_at: Option<String>,
235 /// Required by the API.
236 /// (Optional here so responses that omit it still parse.)
237 #[serde(
238 rename = "canonicalLink",
239 default,
240 skip_serializing_if = "Option::is_none"
241 )]
242 pub canonical_link: Option<String>,
243 /// Required by the API.
244 /// (Optional here so responses that omit it still parse.)
245 #[serde(rename = "urlSlug", default, skip_serializing_if = "Option::is_none")]
246 pub url_slug: Option<String>,
247}
248
249/// `CreateBlogPostParams` from the GoHighLevel OpenAPI spec.
250#[derive(Debug, Clone, Default, Serialize, Deserialize)]
251pub struct CreateBlogPostParams {
252 /// Required by the API.
253 pub title: String,
254 /// Required by the API.
255 #[serde(rename = "locationId")]
256 pub location_id: String,
257 /// You can find the blog id from blog site dashboard link
258 /// Required by the API.
259 #[serde(rename = "blogId")]
260 pub blog_id: String,
261 /// Required by the API.
262 #[serde(rename = "imageUrl")]
263 pub image_url: String,
264 /// Required by the API.
265 pub description: String,
266 /// Required by the API.
267 #[serde(rename = "rawHTML")]
268 pub raw_html: String,
269 /// Allowed values: `DRAFT`, `PUBLISHED`, `SCHEDULED`, `ARCHIVED`.
270 /// Required by the API.
271 pub status: String,
272 /// Required by the API.
273 #[serde(rename = "imageAltText")]
274 pub image_alt_text: String,
275 /// This needs to be array of category ids, which you can get from the category get api
276 /// call.
277 /// Required by the API.
278 #[serde(default, skip_serializing_if = "Vec::is_empty")]
279 pub categories: Vec<String>,
280 #[serde(default, skip_serializing_if = "Vec::is_empty")]
281 pub tags: Vec<String>,
282 /// This needs to be author id, which you can get from the author get api call.
283 /// Required by the API.
284 pub author: String,
285 /// Required by the API.
286 #[serde(rename = "urlSlug")]
287 pub url_slug: String,
288 #[serde(
289 rename = "canonicalLink",
290 default,
291 skip_serializing_if = "Option::is_none"
292 )]
293 pub canonical_link: Option<String>,
294 /// Provide ISO timestamp
295 /// Required by the API.
296 #[serde(rename = "publishedAt")]
297 pub published_at: String,
298}
299
300/// `UpdateBlogPostParams` from the GoHighLevel OpenAPI spec.
301#[derive(Debug, Clone, Default, Serialize, Deserialize)]
302pub struct UpdateBlogPostParams {
303 /// Required by the API.
304 pub title: String,
305 /// Required by the API.
306 #[serde(rename = "locationId")]
307 pub location_id: String,
308 /// You can find the blog id from blog site dashboard link
309 /// Required by the API.
310 #[serde(rename = "blogId")]
311 pub blog_id: String,
312 /// Required by the API.
313 #[serde(rename = "imageUrl")]
314 pub image_url: String,
315 /// Required by the API.
316 pub description: String,
317 /// Required by the API.
318 #[serde(rename = "rawHTML")]
319 pub raw_html: String,
320 /// Allowed values: `DRAFT`, `PUBLISHED`, `SCHEDULED`, `ARCHIVED`.
321 /// Required by the API.
322 pub status: String,
323 /// Required by the API.
324 #[serde(rename = "imageAltText")]
325 pub image_alt_text: String,
326 /// This needs to be array of category ids, which you can get from the category get api
327 /// call.
328 /// Required by the API.
329 #[serde(default, skip_serializing_if = "Vec::is_empty")]
330 pub categories: Vec<String>,
331 #[serde(default, skip_serializing_if = "Vec::is_empty")]
332 pub tags: Vec<String>,
333 /// This needs to be author id, which you can get from the author get api call.
334 /// Required by the API.
335 pub author: String,
336 /// Required by the API.
337 #[serde(rename = "urlSlug")]
338 pub url_slug: String,
339 #[serde(
340 rename = "canonicalLink",
341 default,
342 skip_serializing_if = "Option::is_none"
343 )]
344 pub canonical_link: Option<String>,
345 /// Provide ISO timestamp
346 /// Required by the API.
347 #[serde(rename = "publishedAt")]
348 pub published_at: String,
349}
350
351/// `UrlSlugCheckResponseDTO` from the GoHighLevel OpenAPI spec.
352#[derive(Debug, Clone, Default, Serialize, Deserialize)]
353pub struct UrlSlugCheckResponseDTO {
354 /// Indicates whether the url slug exists or not
355 /// Required by the API.
356 /// (Optional here so responses that omit it still parse.)
357 #[serde(default, skip_serializing_if = "Option::is_none")]
358 pub exists: Option<bool>,
359}