Skip to main content

ghl_models/v3/
blogs.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/// `AuthorResponseDTO` from the GoHighLevel OpenAPI spec.
14#[derive(Debug, Clone, Default, Serialize, Deserialize)]
15pub struct AuthorResponseDTO {
16    /// Required by the API.
17    #[serde(rename = "_id")]
18    pub id: String,
19    /// Required by the API.
20    pub name: String,
21    /// Required by the API.
22    #[serde(rename = "locationId")]
23    pub location_id: String,
24    /// Required by the API.
25    #[serde(rename = "updatedAt")]
26    pub updated_at: String,
27    /// Required by the API.
28    #[serde(rename = "canonicalLink")]
29    pub canonical_link: String,
30}
31
32/// `AuthorsResponseDTO` from the GoHighLevel OpenAPI spec.
33#[derive(Debug, Clone, Default, Serialize, Deserialize)]
34pub struct AuthorsResponseDTO {
35    /// Array of authors
36    /// Required by the API.
37    #[serde(default, skip_serializing_if = "Vec::is_empty")]
38    pub authors: Vec<AuthorResponseDTO>,
39}
40
41/// `BlogGetResponseWrapperDTO` from the GoHighLevel OpenAPI spec.
42#[derive(Debug, Clone, Default, Serialize, Deserialize)]
43pub struct BlogGetResponseWrapperDTO {
44    /// Object containing response data of blog
45    /// Required by the API.
46    #[serde(default, skip_serializing_if = "Vec::is_empty")]
47    pub data: Vec<BlogResponseDTO>,
48}
49
50/// `BlogPostCreateResponseWrapperDTO` from the GoHighLevel OpenAPI spec.
51#[derive(Debug, Clone, Default, Serialize, Deserialize)]
52pub struct BlogPostCreateResponseWrapperDTO {
53    /// Object containing response data of blog post create.
54    /// Required by the API.
55    pub data: BlogPostResponseDTO,
56}
57
58/// `BlogPostGetResponseWrapperDTO` from the GoHighLevel OpenAPI spec.
59#[derive(Debug, Clone, Default, Serialize, Deserialize)]
60pub struct BlogPostGetResponseWrapperDTO {
61    /// Object containing response data of blog posts
62    /// Required by the API.
63    #[serde(default, skip_serializing_if = "Vec::is_empty")]
64    pub blogs: Vec<BlogPostResponseDTO>,
65}
66
67/// `BlogPostResponseDTO` from the GoHighLevel OpenAPI spec.
68#[derive(Debug, Clone, Default, Serialize, Deserialize)]
69pub struct BlogPostResponseDTO {
70    /// Array of category IDs associated with the blog post
71    /// Required by the API.
72    #[serde(default, skip_serializing_if = "Vec::is_empty")]
73    pub categories: Vec<String>,
74    /// Array of tags associated with the blog post
75    #[serde(default, skip_serializing_if = "Vec::is_empty")]
76    pub tags: Vec<String>,
77    /// Indicates whether the blog post is archived
78    /// Required by the API.
79    pub archived: bool,
80    /// Unique identifier of the blog post
81    /// Required by the API.
82    #[serde(rename = "_id")]
83    pub id: String,
84    /// Title of the blog post
85    /// Required by the API.
86    pub title: String,
87    /// Description of the blog post
88    /// Required by the API.
89    pub description: String,
90    /// URL of the image associated with the blog post
91    /// Required by the API.
92    #[serde(rename = "imageUrl")]
93    pub image_url: String,
94    /// Publication status of the blog post
95    /// Required by the API.
96    pub status: String,
97    /// Alternative text for the blog post image
98    /// Required by the API.
99    #[serde(rename = "imageAltText")]
100    pub image_alt_text: String,
101    /// URL slug for the blog post
102    /// Required by the API.
103    #[serde(rename = "urlSlug")]
104    pub url_slug: String,
105    /// Canonical link of the blog post
106    #[serde(
107        rename = "canonicalLink",
108        default,
109        skip_serializing_if = "Option::is_none"
110    )]
111    pub canonical_link: Option<String>,
112    /// Identifier of the author of the blog post
113    #[serde(default, skip_serializing_if = "Option::is_none")]
114    pub author: Option<String>,
115    /// Timestamp when the blog post was published
116    /// Required by the API.
117    #[serde(rename = "publishedAt")]
118    pub published_at: String,
119    /// Timestamp when the blog post was last updated
120    /// Required by the API.
121    #[serde(rename = "updatedAt")]
122    pub updated_at: String,
123}
124
125/// `BlogPostUpdateResponseWrapperDTO` from the GoHighLevel OpenAPI spec.
126#[derive(Debug, Clone, Default, Serialize, Deserialize)]
127pub struct BlogPostUpdateResponseWrapperDTO {
128    /// Object containing response data of blog post update
129    /// Required by the API.
130    #[serde(rename = "updatedBlogPost")]
131    pub updated_blog_post: BlogPostResponseDTO,
132}
133
134/// `BlogResponseDTO` from the GoHighLevel OpenAPI spec.
135#[derive(Debug, Clone, Default, Serialize, Deserialize)]
136pub struct BlogResponseDTO {
137    /// Unique identifier of the blog
138    /// Required by the API.
139    #[serde(rename = "_id")]
140    pub id: String,
141    /// Name of the blog
142    /// Required by the API.
143    pub name: String,
144}
145
146/// `CategoriesResponseDTO` from the GoHighLevel OpenAPI spec.
147#[derive(Debug, Clone, Default, Serialize, Deserialize)]
148pub struct CategoriesResponseDTO {
149    /// Array of categories
150    /// Required by the API.
151    #[serde(default, skip_serializing_if = "Vec::is_empty")]
152    pub categories: Vec<CategoryResponseDTO>,
153}
154
155/// `CategoryResponseDTO` from the GoHighLevel OpenAPI spec.
156#[derive(Debug, Clone, Default, Serialize, Deserialize)]
157pub struct CategoryResponseDTO {
158    /// Required by the API.
159    #[serde(rename = "_id")]
160    pub id: String,
161    #[serde(default, skip_serializing_if = "Option::is_none")]
162    pub label: Option<String>,
163    /// Required by the API.
164    #[serde(rename = "locationId")]
165    pub location_id: String,
166    /// Required by the API.
167    #[serde(rename = "updatedAt")]
168    pub updated_at: String,
169    /// Required by the API.
170    #[serde(rename = "canonicalLink")]
171    pub canonical_link: String,
172    /// Required by the API.
173    #[serde(rename = "urlSlug")]
174    pub url_slug: String,
175}
176
177/// `CreateBlogPostParams` from the GoHighLevel OpenAPI spec.
178#[derive(Debug, Clone, Default, Serialize, Deserialize)]
179pub struct CreateBlogPostParams {
180    /// Required by the API.
181    pub title: String,
182    /// Required by the API.
183    #[serde(rename = "locationId")]
184    pub location_id: String,
185    /// You can find the blog id from blog site dashboard link
186    /// Required by the API.
187    #[serde(rename = "blogId")]
188    pub blog_id: String,
189    /// Required by the API.
190    #[serde(rename = "imageUrl")]
191    pub image_url: String,
192    /// Required by the API.
193    pub description: String,
194    /// Required by the API.
195    #[serde(rename = "rawHTML")]
196    pub raw_html: String,
197    /// Allowed values: `DRAFT`, `PUBLISHED`, `SCHEDULED`, `ARCHIVED`.
198    /// Required by the API.
199    pub status: String,
200    /// Required by the API.
201    #[serde(rename = "imageAltText")]
202    pub image_alt_text: String,
203    /// This needs to be array of category ids, which you can get from the category get api
204    /// call.
205    /// Required by the API.
206    #[serde(default, skip_serializing_if = "Vec::is_empty")]
207    pub categories: Vec<String>,
208    #[serde(default, skip_serializing_if = "Vec::is_empty")]
209    pub tags: Vec<String>,
210    /// This needs to be author id, which you can get from the author get api call.
211    /// Required by the API.
212    pub author: String,
213    /// Required by the API.
214    #[serde(rename = "urlSlug")]
215    pub url_slug: String,
216    #[serde(
217        rename = "canonicalLink",
218        default,
219        skip_serializing_if = "Option::is_none"
220    )]
221    pub canonical_link: Option<String>,
222    /// Provide ISO timestamp
223    /// Required by the API.
224    #[serde(rename = "publishedAt")]
225    pub published_at: String,
226}
227
228/// `UpdateBlogPostParams` from the GoHighLevel OpenAPI spec.
229#[derive(Debug, Clone, Default, Serialize, Deserialize)]
230pub struct UpdateBlogPostParams {
231    /// Required by the API.
232    pub title: String,
233    /// Required by the API.
234    #[serde(rename = "locationId")]
235    pub location_id: String,
236    /// You can find the blog id from blog site dashboard link
237    /// Required by the API.
238    #[serde(rename = "blogId")]
239    pub blog_id: String,
240    /// Required by the API.
241    #[serde(rename = "imageUrl")]
242    pub image_url: String,
243    /// Required by the API.
244    pub description: String,
245    /// Required by the API.
246    #[serde(rename = "rawHTML")]
247    pub raw_html: String,
248    /// Allowed values: `DRAFT`, `PUBLISHED`, `SCHEDULED`, `ARCHIVED`.
249    /// Required by the API.
250    pub status: String,
251    /// Required by the API.
252    #[serde(rename = "imageAltText")]
253    pub image_alt_text: String,
254    /// This needs to be array of category ids, which you can get from the category get api
255    /// call.
256    /// Required by the API.
257    #[serde(default, skip_serializing_if = "Vec::is_empty")]
258    pub categories: Vec<String>,
259    #[serde(default, skip_serializing_if = "Vec::is_empty")]
260    pub tags: Vec<String>,
261    /// This needs to be author id, which you can get from the author get api call.
262    /// Required by the API.
263    pub author: String,
264    /// Required by the API.
265    #[serde(rename = "urlSlug")]
266    pub url_slug: String,
267    /// Required by the API.
268    #[serde(rename = "wordCount")]
269    pub word_count: f64,
270    #[serde(
271        rename = "canonicalLink",
272        default,
273        skip_serializing_if = "Option::is_none"
274    )]
275    pub canonical_link: Option<String>,
276    /// Provide ISO timestamp
277    /// Required by the API.
278    #[serde(rename = "publishedAt")]
279    pub published_at: String,
280}
281
282/// `UrlSlugCheckResponseDTO` from the GoHighLevel OpenAPI spec.
283#[derive(Debug, Clone, Default, Serialize, Deserialize)]
284pub struct UrlSlugCheckResponseDTO {
285    /// Indicates whether the url slug exists or not
286    /// Required by the API.
287    pub exists: bool,
288}