1#![allow(
6 missing_docs,
7 clippy::doc_lazy_continuation,
8 clippy::doc_overindented_list_items
9)]
10
11use serde::{Deserialize, Serialize};
12
13#[derive(Debug, Clone, Default, Serialize, Deserialize)]
15pub struct AuthorResponseDTO {
16 #[serde(rename = "_id")]
18 pub id: String,
19 pub name: String,
21 #[serde(rename = "locationId")]
23 pub location_id: String,
24 #[serde(rename = "updatedAt")]
26 pub updated_at: String,
27 #[serde(rename = "canonicalLink")]
29 pub canonical_link: String,
30}
31
32#[derive(Debug, Clone, Default, Serialize, Deserialize)]
34pub struct AuthorsResponseDTO {
35 #[serde(default, skip_serializing_if = "Vec::is_empty")]
38 pub authors: Vec<AuthorResponseDTO>,
39}
40
41#[derive(Debug, Clone, Default, Serialize, Deserialize)]
43pub struct BlogGetResponseWrapperDTO {
44 #[serde(default, skip_serializing_if = "Vec::is_empty")]
47 pub data: Vec<BlogResponseDTO>,
48}
49
50#[derive(Debug, Clone, Default, Serialize, Deserialize)]
52pub struct BlogPostCreateResponseWrapperDTO {
53 pub data: BlogPostResponseDTO,
56}
57
58#[derive(Debug, Clone, Default, Serialize, Deserialize)]
60pub struct BlogPostGetResponseWrapperDTO {
61 #[serde(default, skip_serializing_if = "Vec::is_empty")]
64 pub blogs: Vec<BlogPostResponseDTO>,
65}
66
67#[derive(Debug, Clone, Default, Serialize, Deserialize)]
69pub struct BlogPostResponseDTO {
70 #[serde(default, skip_serializing_if = "Vec::is_empty")]
73 pub categories: Vec<String>,
74 #[serde(default, skip_serializing_if = "Vec::is_empty")]
76 pub tags: Vec<String>,
77 pub archived: bool,
80 #[serde(rename = "_id")]
83 pub id: String,
84 pub title: String,
87 pub description: String,
90 #[serde(rename = "imageUrl")]
93 pub image_url: String,
94 pub status: String,
97 #[serde(rename = "imageAltText")]
100 pub image_alt_text: String,
101 #[serde(rename = "urlSlug")]
104 pub url_slug: String,
105 #[serde(
107 rename = "canonicalLink",
108 default,
109 skip_serializing_if = "Option::is_none"
110 )]
111 pub canonical_link: Option<String>,
112 #[serde(default, skip_serializing_if = "Option::is_none")]
114 pub author: Option<String>,
115 #[serde(rename = "publishedAt")]
118 pub published_at: String,
119 #[serde(rename = "updatedAt")]
122 pub updated_at: String,
123}
124
125#[derive(Debug, Clone, Default, Serialize, Deserialize)]
127pub struct BlogPostUpdateResponseWrapperDTO {
128 #[serde(rename = "updatedBlogPost")]
131 pub updated_blog_post: BlogPostResponseDTO,
132}
133
134#[derive(Debug, Clone, Default, Serialize, Deserialize)]
136pub struct BlogResponseDTO {
137 #[serde(rename = "_id")]
140 pub id: String,
141 pub name: String,
144}
145
146#[derive(Debug, Clone, Default, Serialize, Deserialize)]
148pub struct CategoriesResponseDTO {
149 #[serde(default, skip_serializing_if = "Vec::is_empty")]
152 pub categories: Vec<CategoryResponseDTO>,
153}
154
155#[derive(Debug, Clone, Default, Serialize, Deserialize)]
157pub struct CategoryResponseDTO {
158 #[serde(rename = "_id")]
160 pub id: String,
161 #[serde(default, skip_serializing_if = "Option::is_none")]
162 pub label: Option<String>,
163 #[serde(rename = "locationId")]
165 pub location_id: String,
166 #[serde(rename = "updatedAt")]
168 pub updated_at: String,
169 #[serde(rename = "canonicalLink")]
171 pub canonical_link: String,
172 #[serde(rename = "urlSlug")]
174 pub url_slug: String,
175}
176
177#[derive(Debug, Clone, Default, Serialize, Deserialize)]
179pub struct CreateBlogPostParams {
180 pub title: String,
182 #[serde(rename = "locationId")]
184 pub location_id: String,
185 #[serde(rename = "blogId")]
188 pub blog_id: String,
189 #[serde(rename = "imageUrl")]
191 pub image_url: String,
192 pub description: String,
194 #[serde(rename = "rawHTML")]
196 pub raw_html: String,
197 pub status: String,
200 #[serde(rename = "imageAltText")]
202 pub image_alt_text: String,
203 #[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 pub author: String,
213 #[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 #[serde(rename = "publishedAt")]
225 pub published_at: String,
226}
227
228#[derive(Debug, Clone, Default, Serialize, Deserialize)]
230pub struct UpdateBlogPostParams {
231 pub title: String,
233 #[serde(rename = "locationId")]
235 pub location_id: String,
236 #[serde(rename = "blogId")]
239 pub blog_id: String,
240 #[serde(rename = "imageUrl")]
242 pub image_url: String,
243 pub description: String,
245 #[serde(rename = "rawHTML")]
247 pub raw_html: String,
248 pub status: String,
251 #[serde(rename = "imageAltText")]
253 pub image_alt_text: String,
254 #[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 pub author: String,
264 #[serde(rename = "urlSlug")]
266 pub url_slug: String,
267 #[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 #[serde(rename = "publishedAt")]
279 pub published_at: String,
280}
281
282#[derive(Debug, Clone, Default, Serialize, Deserialize)]
284pub struct UrlSlugCheckResponseDTO {
285 pub exists: bool,
288}