ghl_models/v2/knowledge_base.rs
1//! `knowledge-base` data models for GoHighLevel API V2 (38 types).
2//!
3//! Generated from HighLevel's official OpenAPI spec for the
4//! **Knowledge Base** module. Every endpoint that uses these types, with its
5//! parameters, required scopes and enum values, is documented in the
6//! [`knowledge-base` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/knowledge-base.md).
7//!
8//! Enable with `features = ["knowledge-base"]`.
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/// `AddFaqDTO` from the GoHighLevel OpenAPI spec.
22#[derive(Debug, Clone, Default, Serialize, Deserialize)]
23pub struct AddFaqDTO {
24 /// location ID as string
25 /// Required by the API.
26 #[serde(rename = "locationId")]
27 pub location_id: String,
28 /// faq question as a string
29 /// Required by the API.
30 pub question: String,
31 /// faq answer as a string
32 /// Required by the API.
33 pub answer: String,
34 /// knowledge base ID as string
35 /// Required by the API.
36 #[serde(rename = "knowledgeBaseId")]
37 pub knowledge_base_id: String,
38}
39
40/// `BadRequestDTO` from the GoHighLevel OpenAPI spec.
41#[derive(Debug, Clone, Default, Serialize, Deserialize)]
42pub struct BadRequestDTO {
43 #[serde(
44 rename = "statusCode",
45 default,
46 skip_serializing_if = "Option::is_none"
47 )]
48 pub status_code: Option<f64>,
49 #[serde(default, skip_serializing_if = "Option::is_none")]
50 pub message: Option<String>,
51}
52
53/// `CrawledUrlDTO` from the GoHighLevel OpenAPI spec.
54#[derive(Debug, Clone, Default, Serialize, Deserialize)]
55pub struct CrawledUrlDTO {
56 /// Unique identifier for the URL
57 /// Required by the API.
58 /// (Optional here so responses that omit it still parse.)
59 #[serde(default, skip_serializing_if = "Option::is_none")]
60 pub id: Option<String>,
61 /// The actual URL that was crawled
62 /// Required by the API.
63 /// (Optional here so responses that omit it still parse.)
64 #[serde(default, skip_serializing_if = "Option::is_none")]
65 pub url: Option<String>,
66 /// Title of the webpage
67 /// Required by the API.
68 /// (Optional here so responses that omit it still parse.)
69 #[serde(default, skip_serializing_if = "Option::is_none")]
70 pub title: Option<String>,
71 /// Current processing status of the URL
72 /// Allowed values: `Pending`, `Processing`, `Successful`, `Failed`, `Existing`,
73 /// `Restricted`, `Cancelled`, `Aborted`, `Training`.
74 /// Required by the API.
75 /// (Optional here so responses that omit it still parse.)
76 #[serde(default, skip_serializing_if = "Option::is_none")]
77 pub status: Option<String>,
78 /// Location ID associated with this URL
79 /// Required by the API.
80 /// (Optional here so responses that omit it still parse.)
81 #[serde(
82 rename = "locationId",
83 default,
84 skip_serializing_if = "Option::is_none"
85 )]
86 pub location_id: Option<String>,
87 /// Knowledge base ID this URL belongs to
88 /// Required by the API.
89 /// (Optional here so responses that omit it still parse.)
90 #[serde(
91 rename = "knowledgeBaseId",
92 default,
93 skip_serializing_if = "Option::is_none"
94 )]
95 pub knowledge_base_id: Option<String>,
96 /// URL to the stored content file
97 /// Required by the API.
98 /// (Optional here so responses that omit it still parse.)
99 #[serde(default, skip_serializing_if = "Option::is_none")]
100 pub content: Option<String>,
101 /// Whether the content was edited by user
102 /// Required by the API.
103 /// (Optional here so responses that omit it still parse.)
104 #[serde(
105 rename = "contentEditedByUser",
106 default,
107 skip_serializing_if = "Option::is_none"
108 )]
109 pub content_edited_by_user: Option<bool>,
110 /// Last updated timestamp
111 /// Required by the API.
112 /// (Optional here so responses that omit it still parse.)
113 #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
114 pub updated_at: Option<String>,
115}
116
117/// `CrawlingAggregateDTO` from the GoHighLevel OpenAPI spec.
118#[derive(Debug, Clone, Default, Serialize, Deserialize)]
119pub struct CrawlingAggregateDTO {
120 /// Status grouping identifier
121 /// Allowed values: `Pending`, `Processing`, `Successful`, `Failed`, `Existing`,
122 /// `Restricted`, `Cancelled`, `Aborted`, `Training`.
123 /// Required by the API.
124 /// (Optional here so responses that omit it still parse.)
125 #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
126 pub id: Option<String>,
127 /// Array of records for this status
128 /// Required by the API.
129 /// (Optional here so responses that omit it still parse.)
130 #[serde(default, skip_serializing_if = "Vec::is_empty")]
131 pub records: Vec<CrawlingRecordDTO>,
132}
133
134/// `CrawlingRecordDTO` from the GoHighLevel OpenAPI spec.
135#[derive(Debug, Clone, Default, Serialize, Deserialize)]
136pub struct CrawlingRecordDTO {
137 /// URL being crawled
138 /// Required by the API.
139 /// (Optional here so responses that omit it still parse.)
140 #[serde(default, skip_serializing_if = "Option::is_none")]
141 pub url: Option<String>,
142 /// Unique record identifier
143 /// Required by the API.
144 /// (Optional here so responses that omit it still parse.)
145 #[serde(default, skip_serializing_if = "Option::is_none")]
146 pub id: Option<String>,
147 /// Page title (for successful/pending records)
148 #[serde(default, skip_serializing_if = "Option::is_none")]
149 pub title: Option<String>,
150 /// Error details (for failed records)
151 #[serde(default, skip_serializing_if = "Option::is_none")]
152 pub error: Option<ErrorDetailsDTO>,
153}
154
155/// `CrawlingStatusDataDTO` from the GoHighLevel OpenAPI spec.
156#[derive(Debug, Clone, Default, Serialize, Deserialize)]
157pub struct CrawlingStatusDataDTO {
158 /// Aggregated crawling results by status
159 /// Required by the API.
160 /// (Optional here so responses that omit it still parse.)
161 #[serde(default, skip_serializing_if = "Vec::is_empty")]
162 pub aggregate: Vec<CrawlingAggregateDTO>,
163 /// Detailed operation information
164 /// Required by the API.
165 /// (Optional here so responses that omit it still parse.)
166 #[serde(
167 rename = "operationDetails",
168 default,
169 skip_serializing_if = "Option::is_none"
170 )]
171 pub operation_details: Option<OperationDetailsDTO>,
172}
173
174/// `CrawlingStatusResponseDTO` from the GoHighLevel OpenAPI spec.
175#[derive(Debug, Clone, Default, Serialize, Deserialize)]
176pub struct CrawlingStatusResponseDTO {
177 /// Indicates if the operation was successful
178 /// Required by the API.
179 /// (Optional here so responses that omit it still parse.)
180 #[serde(default, skip_serializing_if = "Option::is_none")]
181 pub success: Option<bool>,
182 /// Detailed crawling status data
183 /// Required by the API.
184 /// (Optional here so responses that omit it still parse.)
185 #[serde(default, skip_serializing_if = "Option::is_none")]
186 pub data: Option<CrawlingStatusDataDTO>,
187}
188
189/// `CreateFaqResponseDTO` from the GoHighLevel OpenAPI spec.
190#[derive(Debug, Clone, Default, Serialize, Deserialize)]
191pub struct CreateFaqResponseDTO {
192 /// Success status of the operation
193 /// Required by the API.
194 /// (Optional here so responses that omit it still parse.)
195 #[serde(default, skip_serializing_if = "Option::is_none")]
196 pub success: Option<bool>,
197 /// Created FAQ details
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 faq: Option<FaqResponseDTO>,
202}
203
204/// `CreateKnowledgeBaseDTO` from the GoHighLevel OpenAPI spec.
205#[derive(Debug, Clone, Default, Serialize, Deserialize)]
206pub struct CreateKnowledgeBaseDTO {
207 /// Required by the API.
208 pub name: String,
209 #[serde(default, skip_serializing_if = "Option::is_none")]
210 pub description: Option<String>,
211 /// Required by the API.
212 #[serde(rename = "locationId")]
213 pub location_id: String,
214}
215
216/// `CreateKnowledgeBaseResponseDTO` from the GoHighLevel OpenAPI spec.
217#[derive(Debug, Clone, Default, Serialize, Deserialize)]
218pub struct CreateKnowledgeBaseResponseDTO {
219 /// Success status of the operation
220 /// Required by the API.
221 /// (Optional here so responses that omit it still parse.)
222 #[serde(default, skip_serializing_if = "Option::is_none")]
223 pub success: Option<bool>,
224 /// Created knowledge base details
225 /// Required by the API.
226 /// (Optional here so responses that omit it still parse.)
227 #[serde(default, skip_serializing_if = "Option::is_none")]
228 pub data: Option<KnowledgeBaseDataDTO>,
229}
230
231/// `DeleteFaqResponseDTO` from the GoHighLevel OpenAPI spec.
232#[derive(Debug, Clone, Default, Serialize, Deserialize)]
233pub struct DeleteFaqResponseDTO {
234 /// Success status of the delete operation
235 /// Required by the API.
236 /// (Optional here so responses that omit it still parse.)
237 #[serde(default, skip_serializing_if = "Option::is_none")]
238 pub success: Option<bool>,
239}
240
241/// `DeleteKnowledgeBaseResponseDTO` from the GoHighLevel OpenAPI spec.
242#[derive(Debug, Clone, Default, Serialize, Deserialize)]
243pub struct DeleteKnowledgeBaseResponseDTO {
244 /// Required by the API.
245 /// (Optional here so responses that omit it still parse.)
246 #[serde(default, skip_serializing_if = "Option::is_none")]
247 pub success: Option<bool>,
248}
249
250/// `DeleteWebsiteUrlRequestDTO` from the GoHighLevel OpenAPI spec.
251#[derive(Debug, Clone, Default, Serialize, Deserialize)]
252pub struct DeleteWebsiteUrlRequestDTO {
253 /// knowledge base ID as string
254 /// Required by the API.
255 #[serde(rename = "knowledgeBaseId")]
256 pub knowledge_base_id: String,
257 /// location ID as string
258 /// Required by the API.
259 #[serde(rename = "locationId")]
260 pub location_id: String,
261 /// List of trained urls ids ( fetched from the Get all trained page links by knowledge base
262 /// endpoint)
263 /// Required by the API.
264 #[serde(rename = "urlIds", default, skip_serializing_if = "Vec::is_empty")]
265 pub url_ids: Vec<String>,
266}
267
268/// `DeleteWebsiteUrlResponseDTO` from the GoHighLevel OpenAPI spec.
269#[derive(Debug, Clone, Default, Serialize, Deserialize)]
270pub struct DeleteWebsiteUrlResponseDTO {
271 /// Indicates if the operation was successful
272 /// Required by the API.
273 /// (Optional here so responses that omit it still parse.)
274 #[serde(default, skip_serializing_if = "Option::is_none")]
275 pub success: Option<bool>,
276}
277
278/// `DiscoverWebsiteDataDTO` from the GoHighLevel OpenAPI spec.
279#[derive(Debug, Clone, Default, Serialize, Deserialize)]
280pub struct DiscoverWebsiteDataDTO {
281 /// Operation ID for tracking the discovery process
282 /// Required by the API.
283 /// (Optional here so responses that omit it still parse.)
284 #[serde(
285 rename = "operationId",
286 default,
287 skip_serializing_if = "Option::is_none"
288 )]
289 pub operation_id: Option<String>,
290 /// Current status of the website discovery operation
291 /// Allowed values: `Pending`, `Processing`, `Successful`, `Failed`, `Existing`,
292 /// `Restricted`, `Cancelled`, `Aborted`, `Training`.
293 /// Required by the API.
294 /// (Optional here so responses that omit it still parse.)
295 #[serde(default, skip_serializing_if = "Option::is_none")]
296 pub status: Option<String>,
297 /// The URL being discovered/crawled
298 /// Required by the API.
299 /// (Optional here so responses that omit it still parse.)
300 #[serde(default, skip_serializing_if = "Option::is_none")]
301 pub url: Option<String>,
302}
303
304/// `DiscoverWebsiteRequestDTO` from the GoHighLevel OpenAPI spec.
305#[derive(Debug, Clone, Default, Serialize, Deserialize)]
306pub struct DiscoverWebsiteRequestDTO {
307 /// Location ID as string
308 /// Required by the API.
309 #[serde(rename = "locationId")]
310 pub location_id: String,
311 /// Website URL as string
312 /// Required by the API.
313 pub url: String,
314 /// Mode as string
315 /// Allowed values: `Exact`, `Path`, `Domain`.
316 /// Required by the API.
317 pub option: String,
318 /// knowledge base ID as string
319 /// Required by the API.
320 #[serde(rename = "knowledgeBaseId")]
321 pub knowledge_base_id: String,
322}
323
324/// `DiscoverWebsiteResponseDTO` from the GoHighLevel OpenAPI spec.
325#[derive(Debug, Clone, Default, Serialize, Deserialize)]
326pub struct DiscoverWebsiteResponseDTO {
327 /// Indicates if the operation was successful
328 /// Required by the API.
329 /// (Optional here so responses that omit it still parse.)
330 #[serde(default, skip_serializing_if = "Option::is_none")]
331 pub success: Option<bool>,
332 /// Data containing operation details
333 /// Required by the API.
334 /// (Optional here so responses that omit it still parse.)
335 #[serde(default, skip_serializing_if = "Option::is_none")]
336 pub data: Option<DiscoverWebsiteDataDTO>,
337}
338
339/// `ErrorDetailsDTO` from the GoHighLevel OpenAPI spec.
340#[derive(Debug, Clone, Default, Serialize, Deserialize)]
341pub struct ErrorDetailsDTO {
342 /// Error stack trace
343 /// Required by the API.
344 /// (Optional here so responses that omit it still parse.)
345 #[serde(default, skip_serializing_if = "Option::is_none")]
346 pub stack: Option<String>,
347 /// Error response message
348 /// Required by the API.
349 /// (Optional here so responses that omit it still parse.)
350 #[serde(default, skip_serializing_if = "Option::is_none")]
351 pub response: Option<String>,
352 /// HTTP status code
353 /// Required by the API.
354 /// (Optional here so responses that omit it still parse.)
355 #[serde(default, skip_serializing_if = "Option::is_none")]
356 pub status: Option<f64>,
357 /// Additional options (nullable)
358 #[serde(default, skip_serializing_if = "Option::is_none")]
359 pub options: Option<serde_json::Value>,
360 /// Error message
361 /// Required by the API.
362 /// (Optional here so responses that omit it still parse.)
363 #[serde(default, skip_serializing_if = "Option::is_none")]
364 pub message: Option<String>,
365 /// Error name/type
366 /// Required by the API.
367 /// (Optional here so responses that omit it still parse.)
368 #[serde(default, skip_serializing_if = "Option::is_none")]
369 pub name: Option<String>,
370}
371
372/// `FaqResponseDTO` from the GoHighLevel OpenAPI spec.
373#[derive(Debug, Clone, Default, Serialize, Deserialize)]
374pub struct FaqResponseDTO {
375 /// FAQ ID as string
376 /// Required by the API.
377 /// (Optional here so responses that omit it still parse.)
378 #[serde(default, skip_serializing_if = "Option::is_none")]
379 pub id: Option<String>,
380 /// FAQ question
381 /// Required by the API.
382 /// (Optional here so responses that omit it still parse.)
383 #[serde(default, skip_serializing_if = "Option::is_none")]
384 pub question: Option<String>,
385 /// FAQ question in lowercase
386 /// Required by the API.
387 /// (Optional here so responses that omit it still parse.)
388 #[serde(
389 rename = "questionLowerCase",
390 default,
391 skip_serializing_if = "Option::is_none"
392 )]
393 pub question_lower_case: Option<String>,
394 /// FAQ answer
395 /// Required by the API.
396 /// (Optional here so responses that omit it still parse.)
397 #[serde(default, skip_serializing_if = "Option::is_none")]
398 pub answer: Option<String>,
399 /// Knowledge base ID
400 /// Required by the API.
401 /// (Optional here so responses that omit it still parse.)
402 #[serde(
403 rename = "knowledgeBaseId",
404 default,
405 skip_serializing_if = "Option::is_none"
406 )]
407 pub knowledge_base_id: Option<String>,
408 /// Location ID
409 /// Required by the API.
410 /// (Optional here so responses that omit it still parse.)
411 #[serde(
412 rename = "locationId",
413 default,
414 skip_serializing_if = "Option::is_none"
415 )]
416 pub location_id: Option<String>,
417 /// Trained URL ID
418 /// Required by the API.
419 /// (Optional here so responses that omit it still parse.)
420 #[serde(
421 rename = "trainedUrlId",
422 default,
423 skip_serializing_if = "Option::is_none"
424 )]
425 pub trained_url_id: Option<String>,
426 /// Whether the FAQ is deleted
427 /// Required by the API.
428 /// (Optional here so responses that omit it still parse.)
429 #[serde(default, skip_serializing_if = "Option::is_none")]
430 pub deleted: Option<bool>,
431 /// Date when FAQ was created
432 /// Required by the API.
433 /// (Optional here so responses that omit it still parse.)
434 #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
435 pub created_at: Option<String>,
436 /// Date when FAQ was last updated
437 /// Required by the API.
438 /// (Optional here so responses that omit it still parse.)
439 #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
440 pub updated_at: Option<String>,
441}
442
443/// `GetAllKnowledgeBasesPaginatedDataDTO` from the GoHighLevel OpenAPI spec.
444#[derive(Debug, Clone, Default, Serialize, Deserialize)]
445pub struct GetAllKnowledgeBasesPaginatedDataDTO {
446 /// Array of knowledge bases
447 /// Required by the API.
448 /// (Optional here so responses that omit it still parse.)
449 #[serde(
450 rename = "knowledgeBases",
451 default,
452 skip_serializing_if = "Vec::is_empty"
453 )]
454 pub knowledge_bases: Vec<KnowledgeBaseListItemDTO>,
455 /// Total count of all active knowledge bases
456 /// Required by the API.
457 /// (Optional here so responses that omit it still parse.)
458 #[serde(
459 rename = "activeCount",
460 default,
461 skip_serializing_if = "Option::is_none"
462 )]
463 pub active_count: Option<f64>,
464 /// Whether there are more knowledge bases available
465 /// Required by the API.
466 /// (Optional here so responses that omit it still parse.)
467 #[serde(rename = "hasMore", default, skip_serializing_if = "Option::is_none")]
468 pub has_more: Option<bool>,
469 /// ID of the last knowledge base in this page (use for next page request)
470 #[serde(
471 rename = "lastKnowledgeBaseId",
472 default,
473 skip_serializing_if = "Option::is_none"
474 )]
475 pub last_knowledge_base_id: Option<String>,
476}
477
478/// `GetAllKnowledgeBasesPaginatedResponseDTO` from the GoHighLevel OpenAPI spec.
479#[derive(Debug, Clone, Default, Serialize, Deserialize)]
480pub struct GetAllKnowledgeBasesPaginatedResponseDTO {
481 /// Success status of the operation
482 /// Required by the API.
483 /// (Optional here so responses that omit it still parse.)
484 #[serde(default, skip_serializing_if = "Option::is_none")]
485 pub success: Option<bool>,
486 /// Paginated knowledge bases data
487 /// Required by the API.
488 /// (Optional here so responses that omit it still parse.)
489 #[serde(default, skip_serializing_if = "Option::is_none")]
490 pub data: Option<GetAllKnowledgeBasesPaginatedDataDTO>,
491}
492
493/// `GetAllUrlsByKnowledgeBaseResponseDTO` from the GoHighLevel OpenAPI spec.
494#[derive(Debug, Clone, Default, Serialize, Deserialize)]
495pub struct GetAllUrlsByKnowledgeBaseResponseDTO {
496 /// Total count of URLs in the knowledge base
497 /// Required by the API.
498 /// (Optional here so responses that omit it still parse.)
499 #[serde(default, skip_serializing_if = "Option::is_none")]
500 pub count: Option<f64>,
501 /// Array of crawled URLs with their details
502 /// Required by the API.
503 /// (Optional here so responses that omit it still parse.)
504 #[serde(default, skip_serializing_if = "Vec::is_empty")]
505 pub urls: Vec<CrawledUrlDTO>,
506}
507
508/// `GetKnowledgeBaseByIdDataDTO` from the GoHighLevel OpenAPI spec.
509#[derive(Debug, Clone, Default, Serialize, Deserialize)]
510pub struct GetKnowledgeBaseByIdDataDTO {
511 /// Knowledge base ID
512 /// Required by the API.
513 /// (Optional here so responses that omit it still parse.)
514 #[serde(default, skip_serializing_if = "Option::is_none")]
515 pub id: Option<String>,
516 /// Knowledge base name
517 /// Required by the API.
518 /// (Optional here so responses that omit it still parse.)
519 #[serde(default, skip_serializing_if = "Option::is_none")]
520 pub name: Option<String>,
521 /// Knowledge base name in lowercase
522 /// Required by the API.
523 /// (Optional here so responses that omit it still parse.)
524 #[serde(
525 rename = "nameLowerCase",
526 default,
527 skip_serializing_if = "Option::is_none"
528 )]
529 pub name_lower_case: Option<String>,
530 /// Location ID
531 /// Required by the API.
532 /// (Optional here so responses that omit it still parse.)
533 #[serde(
534 rename = "locationId",
535 default,
536 skip_serializing_if = "Option::is_none"
537 )]
538 pub location_id: Option<String>,
539 /// Whether the knowledge base is deleted
540 /// Required by the API.
541 /// (Optional here so responses that omit it still parse.)
542 #[serde(default, skip_serializing_if = "Option::is_none")]
543 pub deleted: Option<bool>,
544 /// Date when knowledge base was created
545 /// Required by the API.
546 /// (Optional here so responses that omit it still parse.)
547 #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
548 pub created_at: Option<String>,
549 /// Date when knowledge base was last updated
550 /// Required by the API.
551 /// (Optional here so responses that omit it still parse.)
552 #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
553 pub updated_at: Option<String>,
554 /// Knowledge base metadata with content counts
555 /// Required by the API.
556 /// (Optional here so responses that omit it still parse.)
557 #[serde(
558 rename = "kbMetadata",
559 default,
560 skip_serializing_if = "Option::is_none"
561 )]
562 pub kb_metadata: Option<KnowledgeBaseMetadataDTO>,
563 /// Whether the knowledge base is default or not
564 #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")]
565 pub is_default: Option<bool>,
566}
567
568/// `GetKnowledgeBaseByIdResponseDTO` from the GoHighLevel OpenAPI spec.
569#[derive(Debug, Clone, Default, Serialize, Deserialize)]
570pub struct GetKnowledgeBaseByIdResponseDTO {
571 /// Success status of the operation
572 /// Required by the API.
573 /// (Optional here so responses that omit it still parse.)
574 #[serde(default, skip_serializing_if = "Option::is_none")]
575 pub success: Option<bool>,
576 /// Knowledge base details
577 /// Required by the API.
578 /// (Optional here so responses that omit it still parse.)
579 #[serde(default, skip_serializing_if = "Option::is_none")]
580 pub data: Option<GetKnowledgeBaseByIdDataDTO>,
581}
582
583/// `InternalServerErrorDTO` from the GoHighLevel OpenAPI spec.
584#[derive(Debug, Clone, Default, Serialize, Deserialize)]
585pub struct InternalServerErrorDTO {
586 #[serde(
587 rename = "statusCode",
588 default,
589 skip_serializing_if = "Option::is_none"
590 )]
591 pub status_code: Option<f64>,
592 #[serde(default, skip_serializing_if = "Option::is_none")]
593 pub message: Option<String>,
594}
595
596/// `KnowledgeBaseDataDTO` from the GoHighLevel OpenAPI spec.
597#[derive(Debug, Clone, Default, Serialize, Deserialize)]
598pub struct KnowledgeBaseDataDTO {
599 /// Knowledge base ID
600 /// Required by the API.
601 /// (Optional here so responses that omit it still parse.)
602 #[serde(default, skip_serializing_if = "Option::is_none")]
603 pub id: Option<String>,
604 /// Knowledge base name
605 /// Required by the API.
606 /// (Optional here so responses that omit it still parse.)
607 #[serde(default, skip_serializing_if = "Option::is_none")]
608 pub name: Option<String>,
609 /// Knowledge base name in lowercase
610 /// Required by the API.
611 /// (Optional here so responses that omit it still parse.)
612 #[serde(
613 rename = "nameLowerCase",
614 default,
615 skip_serializing_if = "Option::is_none"
616 )]
617 pub name_lower_case: Option<String>,
618 /// Location ID
619 /// Required by the API.
620 /// (Optional here so responses that omit it still parse.)
621 #[serde(
622 rename = "locationId",
623 default,
624 skip_serializing_if = "Option::is_none"
625 )]
626 pub location_id: Option<String>,
627 /// Knowledge base metadata
628 /// Required by the API.
629 /// (Optional here so responses that omit it still parse.)
630 #[serde(
631 rename = "kbMetadata",
632 default,
633 skip_serializing_if = "Option::is_none"
634 )]
635 pub kb_metadata: Option<serde_json::Value>,
636 /// Whether the knowledge base is deleted
637 /// Required by the API.
638 /// (Optional here so responses that omit it still parse.)
639 #[serde(default, skip_serializing_if = "Option::is_none")]
640 pub deleted: Option<bool>,
641 /// Date when knowledge base was created
642 /// Required by the API.
643 /// (Optional here so responses that omit it still parse.)
644 #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
645 pub created_at: Option<String>,
646 /// Date when knowledge base was last updated
647 /// Required by the API.
648 /// (Optional here so responses that omit it still parse.)
649 #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
650 pub updated_at: Option<String>,
651}
652
653/// `KnowledgeBaseListItemDTO` from the GoHighLevel OpenAPI spec.
654#[derive(Debug, Clone, Default, Serialize, Deserialize)]
655pub struct KnowledgeBaseListItemDTO {
656 /// Knowledge base ID
657 /// Required by the API.
658 /// (Optional here so responses that omit it still parse.)
659 #[serde(default, skip_serializing_if = "Option::is_none")]
660 pub id: Option<String>,
661 /// Knowledge base name
662 /// Required by the API.
663 /// (Optional here so responses that omit it still parse.)
664 #[serde(default, skip_serializing_if = "Option::is_none")]
665 pub name: Option<String>,
666 /// Date when knowledge base was created
667 /// Required by the API.
668 /// (Optional here so responses that omit it still parse.)
669 #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
670 pub created_at: Option<String>,
671}
672
673/// `KnowledgeBaseMetadataDTO` from the GoHighLevel OpenAPI spec.
674#[derive(Debug, Clone, Default, Serialize, Deserialize)]
675pub struct KnowledgeBaseMetadataDTO {
676 /// Number of FAQs in the knowledge base
677 /// Required by the API.
678 /// (Optional here so responses that omit it still parse.)
679 #[serde(default, skip_serializing_if = "Option::is_none")]
680 pub faqs: Option<f64>,
681 /// Number of URLs in the knowledge base
682 /// Required by the API.
683 /// (Optional here so responses that omit it still parse.)
684 #[serde(default, skip_serializing_if = "Option::is_none")]
685 pub urls: Option<f64>,
686 /// Number of rich text documents in the knowledge base
687 /// Required by the API.
688 /// (Optional here so responses that omit it still parse.)
689 #[serde(rename = "richText", default, skip_serializing_if = "Option::is_none")]
690 pub rich_text: Option<f64>,
691 /// Number of files in the knowledge base
692 /// Required by the API.
693 /// (Optional here so responses that omit it still parse.)
694 #[serde(default, skip_serializing_if = "Option::is_none")]
695 pub files: Option<f64>,
696 /// Number of web searche configs in the knowledge base
697 /// Required by the API.
698 /// (Optional here so responses that omit it still parse.)
699 #[serde(
700 rename = "webSearches",
701 default,
702 skip_serializing_if = "Option::is_none"
703 )]
704 pub web_searches: Option<f64>,
705 /// Number of tables in the knowledge base
706 /// Required by the API.
707 /// (Optional here so responses that omit it still parse.)
708 #[serde(default, skip_serializing_if = "Option::is_none")]
709 pub tables: Option<f64>,
710}
711
712/// `ListFaqsResponseDTO` from the GoHighLevel OpenAPI spec.
713#[derive(Debug, Clone, Default, Serialize, Deserialize)]
714pub struct ListFaqsResponseDTO {
715 /// Total count of all FAQs in the knowledge base
716 /// Required by the API.
717 /// (Optional here so responses that omit it still parse.)
718 #[serde(default, skip_serializing_if = "Option::is_none")]
719 pub count: Option<f64>,
720 /// Array of FAQ objects
721 /// Required by the API.
722 /// (Optional here so responses that omit it still parse.)
723 #[serde(default, skip_serializing_if = "Vec::is_empty")]
724 pub faqs: Vec<FaqResponseDTO>,
725 /// Last FAQ ID for pagination (use as lastFaqId in next request)
726 #[serde(rename = "lastFaqId", default, skip_serializing_if = "Option::is_none")]
727 pub last_faq_id: Option<String>,
728 /// Whether there are more FAQs available
729 #[serde(rename = "hasMore", default, skip_serializing_if = "Option::is_none")]
730 pub has_more: Option<bool>,
731}
732
733/// `OperationDetailsDTO` from the GoHighLevel OpenAPI spec.
734#[derive(Debug, Clone, Default, Serialize, Deserialize)]
735pub struct OperationDetailsDTO {
736 /// Number of URLs discovered
737 /// Required by the API.
738 /// (Optional here so responses that omit it still parse.)
739 #[serde(
740 rename = "discoveredUrlsCount",
741 default,
742 skip_serializing_if = "Option::is_none"
743 )]
744 pub discovered_urls_count: Option<f64>,
745 /// Number of URLs successfully trained
746 /// Required by the API.
747 /// (Optional here so responses that omit it still parse.)
748 #[serde(
749 rename = "trainedUrlsCount",
750 default,
751 skip_serializing_if = "Option::is_none"
752 )]
753 pub trained_urls_count: Option<f64>,
754 /// Operation unique identifier
755 /// Required by the API.
756 /// (Optional here so responses that omit it still parse.)
757 #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
758 pub id: Option<String>,
759 /// Associated location ID
760 /// Required by the API.
761 /// (Optional here so responses that omit it still parse.)
762 #[serde(
763 rename = "locationId",
764 default,
765 skip_serializing_if = "Option::is_none"
766 )]
767 pub location_id: Option<String>,
768 /// Current operation status
769 /// Allowed values: `Pending`, `Processing`, `Successful`, `Failed`, `Existing`,
770 /// `Restricted`, `Cancelled`, `Aborted`, `Training`.
771 /// Required by the API.
772 /// (Optional here so responses that omit it still parse.)
773 #[serde(default, skip_serializing_if = "Option::is_none")]
774 pub status: Option<String>,
775 /// Base URL being crawled
776 /// Required by the API.
777 /// (Optional here so responses that omit it still parse.)
778 #[serde(default, skip_serializing_if = "Option::is_none")]
779 pub url: Option<String>,
780 /// Crawling mode used
781 /// Allowed values: `Exact`, `Path`, `Domain`.
782 /// Required by the API.
783 /// (Optional here so responses that omit it still parse.)
784 #[serde(default, skip_serializing_if = "Option::is_none")]
785 pub mode: Option<String>,
786 /// Knowledge base ID
787 /// Required by the API.
788 /// (Optional here so responses that omit it still parse.)
789 #[serde(
790 rename = "knowledgeBaseId",
791 default,
792 skip_serializing_if = "Option::is_none"
793 )]
794 pub knowledge_base_id: Option<String>,
795 /// Operation creation timestamp
796 /// Required by the API.
797 /// (Optional here so responses that omit it still parse.)
798 #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
799 pub created_at: Option<String>,
800 /// Last update timestamp
801 /// Required by the API.
802 /// (Optional here so responses that omit it still parse.)
803 #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
804 pub updated_at: Option<String>,
805 /// Version field
806 /// Required by the API.
807 /// (Optional here so responses that omit it still parse.)
808 #[serde(rename = "__v", default, skip_serializing_if = "Option::is_none")]
809 pub v: Option<f64>,
810 /// Robots.txt file content
811 #[serde(
812 rename = "robotsFileData",
813 default,
814 skip_serializing_if = "Option::is_none"
815 )]
816 pub robots_file_data: Option<String>,
817}
818
819/// `TrainDiscoveredUrlsDTO` from the GoHighLevel OpenAPI spec.
820#[derive(Debug, Clone, Default, Serialize, Deserialize)]
821pub struct TrainDiscoveredUrlsDTO {
822 /// Location ID as string
823 /// Required by the API.
824 #[serde(rename = "locationId")]
825 pub location_id: String,
826 /// List of Object ids of the discovered urls
827 /// Required by the API.
828 #[serde(rename = "urlIds", default, skip_serializing_if = "Vec::is_empty")]
829 pub url_ids: Vec<String>,
830 /// knowledge base id
831 /// Required by the API.
832 #[serde(rename = "knowledgeBaseId")]
833 pub knowledge_base_id: String,
834 /// operation id as string
835 /// Required by the API.
836 #[serde(rename = "operationId")]
837 pub operation_id: String,
838}
839
840/// `TrainDiscoveredUrlsResponseDTO` from the GoHighLevel OpenAPI spec.
841#[derive(Debug, Clone, Default, Serialize, Deserialize)]
842pub struct TrainDiscoveredUrlsResponseDTO {
843 /// Indicates if the operation was successful
844 /// Required by the API.
845 /// (Optional here so responses that omit it still parse.)
846 #[serde(default, skip_serializing_if = "Option::is_none")]
847 pub success: Option<bool>,
848}
849
850/// `UnauthorizedDTO` from the GoHighLevel OpenAPI spec.
851#[derive(Debug, Clone, Default, Serialize, Deserialize)]
852pub struct UnauthorizedDTO {
853 #[serde(
854 rename = "statusCode",
855 default,
856 skip_serializing_if = "Option::is_none"
857 )]
858 pub status_code: Option<f64>,
859 #[serde(default, skip_serializing_if = "Option::is_none")]
860 pub message: Option<String>,
861 #[serde(default, skip_serializing_if = "Option::is_none")]
862 pub error: Option<String>,
863}
864
865/// `UnprocessableDTO` from the GoHighLevel OpenAPI spec.
866#[derive(Debug, Clone, Default, Serialize, Deserialize)]
867pub struct UnprocessableDTO {
868 #[serde(
869 rename = "statusCode",
870 default,
871 skip_serializing_if = "Option::is_none"
872 )]
873 pub status_code: Option<f64>,
874 #[serde(default, skip_serializing_if = "Vec::is_empty")]
875 pub message: Vec<String>,
876 #[serde(default, skip_serializing_if = "Option::is_none")]
877 pub error: Option<String>,
878}
879
880/// `UpdateFaqBodyDTO` from the GoHighLevel OpenAPI spec.
881#[derive(Debug, Clone, Default, Serialize, Deserialize)]
882pub struct UpdateFaqBodyDTO {
883 /// faq question as a string
884 /// Required by the API.
885 pub question: String,
886 /// faq answer as a string
887 /// Required by the API.
888 pub answer: String,
889}
890
891/// `UpdateFaqResponseDTO` from the GoHighLevel OpenAPI spec.
892#[derive(Debug, Clone, Default, Serialize, Deserialize)]
893pub struct UpdateFaqResponseDTO {
894 /// Success status of the update operation
895 /// Required by the API.
896 /// (Optional here so responses that omit it still parse.)
897 #[serde(default, skip_serializing_if = "Option::is_none")]
898 pub success: Option<bool>,
899}
900
901/// `UpdateKnowledgeBaseDTO` from the GoHighLevel OpenAPI spec.
902#[derive(Debug, Clone, Default, Serialize, Deserialize)]
903pub struct UpdateKnowledgeBaseDTO {
904 /// field to update the name of the knowledge base
905 #[serde(default, skip_serializing_if = "Option::is_none")]
906 pub name: Option<String>,
907 /// field to update the description of the knowledge base
908 #[serde(default, skip_serializing_if = "Option::is_none")]
909 pub description: Option<String>,
910}
911
912/// `UpdateKnowledgeBaseResponseDTO` from the GoHighLevel OpenAPI spec.
913#[derive(Debug, Clone, Default, Serialize, Deserialize)]
914pub struct UpdateKnowledgeBaseResponseDTO {
915 /// Required by the API.
916 /// (Optional here so responses that omit it still parse.)
917 #[serde(default, skip_serializing_if = "Option::is_none")]
918 pub success: Option<bool>,
919}