Skip to main content

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