ghl-models 0.5.2

Rust data models (DTOs) for the GoHighLevel (HighLevel) API v2 and v3, generated from the official OpenAPI specifications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
//! `knowledge-base` data models for GoHighLevel API V3 (38 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Knowledge Base** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`knowledge-base` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/knowledge-base.md).
//!
//! Enable with `features = ["knowledge-base"]`.
// @generated by xtask/generate_models.py — do not edit by hand.
// Source: https://github.com/GoHighLevel/highlevel-api-docs
// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
// they aren't held to rustdoc's markdown conventions.
#![allow(
    missing_docs,
    clippy::doc_lazy_continuation,
    clippy::doc_overindented_list_items
)]

use serde::{Deserialize, Serialize};

/// `AddFaqDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct AddFaqDTO {
    /// location ID as string
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    /// faq question as a string
    /// Required by the API.
    pub question: String,
    /// faq answer as a string
    /// Required by the API.
    pub answer: String,
    /// knowledge base ID as string
    /// Required by the API.
    #[serde(rename = "knowledgeBaseId")]
    pub knowledge_base_id: String,
}

/// `BadRequestDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BadRequestDTO {
    #[serde(
        rename = "statusCode",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub status_code: Option<f64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
}

/// `CrawledUrlDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CrawledUrlDTO {
    /// Unique identifier for the URL
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// The actual URL that was crawled
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Title of the webpage
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// Current processing status of the URL
    /// Allowed values: `Pending`, `Processing`, `Successful`, `Failed`, `Existing`,
    /// `Restricted`, `Cancelled`, `Aborted`, `Training`.
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// Location ID associated with this URL
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "locationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub location_id: Option<String>,
    /// Knowledge base ID this URL belongs to
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "knowledgeBaseId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub knowledge_base_id: Option<String>,
    /// URL to the stored content file
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub content: Option<String>,
    /// Whether the content was edited by user
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "contentEditedByUser",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub content_edited_by_user: Option<bool>,
    /// Last updated timestamp
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
}

/// `CrawlingAggregateDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CrawlingAggregateDTO {
    /// Status grouping identifier
    /// Allowed values: `Pending`, `Processing`, `Successful`, `Failed`, `Existing`,
    /// `Restricted`, `Cancelled`, `Aborted`, `Training`.
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Array of records for this status
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub records: Vec<CrawlingRecordDTO>,
}

/// `CrawlingRecordDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CrawlingRecordDTO {
    /// URL being crawled
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Unique record identifier
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Page title (for successful/pending records)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// Error details (for failed records)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub error: Option<ErrorDetailsDTO>,
}

/// `CrawlingStatusDataDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CrawlingStatusDataDTO {
    /// Aggregated crawling results by status
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub aggregate: Vec<CrawlingAggregateDTO>,
    /// Detailed operation information
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "operationDetails",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub operation_details: Option<OperationDetailsDTO>,
}

/// `CrawlingStatusResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CrawlingStatusResponseDTO {
    /// Indicates if the operation was successful
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
    /// Detailed crawling status data
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<CrawlingStatusDataDTO>,
}

/// `CreateFaqResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateFaqResponseDTO {
    /// Success status of the operation
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
    /// Created FAQ details
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub faq: Option<FaqResponseDTO>,
}

/// `CreateKnowledgeBaseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateKnowledgeBaseDTO {
    /// Required by the API.
    pub name: String,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
}

/// `CreateKnowledgeBaseResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateKnowledgeBaseResponseDTO {
    /// Success status of the operation
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
    /// Created knowledge base details
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<KnowledgeBaseDataDTO>,
}

/// `DeleteFaqResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteFaqResponseDTO {
    /// Success status of the delete operation
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
}

/// `DeleteKnowledgeBaseResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteKnowledgeBaseResponseDTO {
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
}

/// `DeleteWebsiteUrlRequestDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteWebsiteUrlRequestDTO {
    /// knowledge base ID as string
    /// Required by the API.
    #[serde(rename = "knowledgeBaseId")]
    pub knowledge_base_id: String,
    /// location ID as string
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    /// List of trained urls ids ( fetched from the Get all trained page links by knowledge base
    /// endpoint)
    /// Required by the API.
    #[serde(rename = "urlIds", default, skip_serializing_if = "Vec::is_empty")]
    pub url_ids: Vec<String>,
}

/// `DeleteWebsiteUrlResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteWebsiteUrlResponseDTO {
    /// Indicates if the operation was successful
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
}

/// `DiscoverWebsiteDataDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DiscoverWebsiteDataDTO {
    /// Operation ID for tracking the discovery process
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "operationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub operation_id: Option<String>,
    /// Current status of the website discovery operation
    /// Allowed values: `Pending`, `Processing`, `Successful`, `Failed`, `Existing`,
    /// `Restricted`, `Cancelled`, `Aborted`, `Training`.
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// The URL being discovered/crawled
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
}

/// `DiscoverWebsiteRequestDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DiscoverWebsiteRequestDTO {
    /// Location ID as string
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    /// Website URL as string
    /// Required by the API.
    pub url: String,
    /// Mode as string
    /// Allowed values: `Exact`, `Path`, `Domain`.
    /// Required by the API.
    pub option: String,
    /// knowledge base ID as string
    /// Required by the API.
    #[serde(rename = "knowledgeBaseId")]
    pub knowledge_base_id: String,
}

/// `DiscoverWebsiteResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DiscoverWebsiteResponseDTO {
    /// Indicates if the operation was successful
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
    /// Data containing operation details
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<DiscoverWebsiteDataDTO>,
}

/// `ErrorDetailsDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ErrorDetailsDTO {
    /// Error stack trace
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub stack: Option<String>,
    /// Error response message
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub response: Option<String>,
    /// HTTP status code
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<f64>,
    /// Additional options (nullable)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub options: Option<serde_json::Value>,
    /// Error message
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// Error name/type
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

/// `FaqResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct FaqResponseDTO {
    /// FAQ ID as string
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// FAQ question
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub question: Option<String>,
    /// FAQ question in lowercase
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "questionLowerCase",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub question_lower_case: Option<String>,
    /// FAQ answer
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub answer: Option<String>,
    /// Knowledge base ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "knowledgeBaseId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub knowledge_base_id: Option<String>,
    /// Location ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "locationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub location_id: Option<String>,
    /// Trained URL ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "trainedUrlId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub trained_url_id: Option<String>,
    /// Whether the FAQ is deleted
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub deleted: Option<bool>,
    /// Date when FAQ was created
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// Date when FAQ was last updated
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
}

/// `GetAllKnowledgeBasesPaginatedDataDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetAllKnowledgeBasesPaginatedDataDTO {
    /// Array of knowledge bases
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "knowledgeBases",
        default,
        skip_serializing_if = "Vec::is_empty"
    )]
    pub knowledge_bases: Vec<KnowledgeBaseListItemDTO>,
    /// Total count of all active knowledge bases
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "activeCount",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub active_count: Option<f64>,
    /// Whether there are more knowledge bases available
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "hasMore", default, skip_serializing_if = "Option::is_none")]
    pub has_more: Option<bool>,
    /// ID of the last knowledge base in this page (use for next page request)
    #[serde(
        rename = "lastKnowledgeBaseId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub last_knowledge_base_id: Option<String>,
}

/// `GetAllKnowledgeBasesPaginatedResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetAllKnowledgeBasesPaginatedResponseDTO {
    /// Success status of the operation
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
    /// Paginated knowledge bases data
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<GetAllKnowledgeBasesPaginatedDataDTO>,
}

/// `GetAllUrlsByKnowledgeBaseResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetAllUrlsByKnowledgeBaseResponseDTO {
    /// Total count of URLs in the knowledge base
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub count: Option<f64>,
    /// Array of crawled URLs with their details
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub urls: Vec<CrawledUrlDTO>,
}

/// `GetKnowledgeBaseByIdDataDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetKnowledgeBaseByIdDataDTO {
    /// Knowledge base ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Knowledge base name
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Knowledge base name in lowercase
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "nameLowerCase",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub name_lower_case: Option<String>,
    /// Location ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "locationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub location_id: Option<String>,
    /// Whether the knowledge base is deleted
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub deleted: Option<bool>,
    /// Date when knowledge base was created
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// Date when knowledge base was last updated
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
    /// Knowledge base metadata with content counts
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "kbMetadata",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub kb_metadata: Option<KnowledgeBaseMetadataDTO>,
    /// Whether the knowledge base is default or not
    #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")]
    pub is_default: Option<bool>,
}

/// `GetKnowledgeBaseByIdResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetKnowledgeBaseByIdResponseDTO {
    /// Success status of the operation
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
    /// Knowledge base details
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<GetKnowledgeBaseByIdDataDTO>,
}

/// `InternalServerErrorDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct InternalServerErrorDTO {
    #[serde(
        rename = "statusCode",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub status_code: Option<f64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
}

/// `KnowledgeBaseDataDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct KnowledgeBaseDataDTO {
    /// Knowledge base ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Knowledge base name
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Knowledge base name in lowercase
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "nameLowerCase",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub name_lower_case: Option<String>,
    /// Location ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "locationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub location_id: Option<String>,
    /// Knowledge base metadata
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "kbMetadata",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub kb_metadata: Option<serde_json::Value>,
    /// Whether the knowledge base is deleted
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub deleted: Option<bool>,
    /// Date when knowledge base was created
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// Date when knowledge base was last updated
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
}

/// `KnowledgeBaseListItemDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct KnowledgeBaseListItemDTO {
    /// Knowledge base ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Knowledge base name
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Date when knowledge base was created
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
}

/// `KnowledgeBaseMetadataDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct KnowledgeBaseMetadataDTO {
    /// Number of FAQs in the knowledge base
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub faqs: Option<f64>,
    /// Number of URLs in the knowledge base
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub urls: Option<f64>,
    /// Number of rich text documents in the knowledge base
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "richText", default, skip_serializing_if = "Option::is_none")]
    pub rich_text: Option<f64>,
    /// Number of files in the knowledge base
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub files: Option<f64>,
    /// Number of web searche configs in the knowledge base
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "webSearches",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub web_searches: Option<f64>,
    /// Number of tables in the knowledge base
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tables: Option<f64>,
}

/// `ListFaqsResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ListFaqsResponseDTO {
    /// Total count of all FAQs in the knowledge base
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub count: Option<f64>,
    /// Array of FAQ objects
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub faqs: Vec<FaqResponseDTO>,
    /// Last FAQ ID for pagination (use as lastFaqId in next request)
    #[serde(rename = "lastFaqId", default, skip_serializing_if = "Option::is_none")]
    pub last_faq_id: Option<String>,
    /// Whether there are more FAQs available
    #[serde(rename = "hasMore", default, skip_serializing_if = "Option::is_none")]
    pub has_more: Option<bool>,
}

/// `OperationDetailsDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct OperationDetailsDTO {
    /// Number of URLs discovered
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "discoveredUrlsCount",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub discovered_urls_count: Option<f64>,
    /// Number of URLs successfully trained
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "trainedUrlsCount",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub trained_urls_count: Option<f64>,
    /// Operation unique identifier
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Associated location ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "locationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub location_id: Option<String>,
    /// Current operation status
    /// Allowed values: `Pending`, `Processing`, `Successful`, `Failed`, `Existing`,
    /// `Restricted`, `Cancelled`, `Aborted`, `Training`.
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// Base URL being crawled
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Crawling mode used
    /// Allowed values: `Exact`, `Path`, `Domain`.
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mode: Option<String>,
    /// Knowledge base ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "knowledgeBaseId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub knowledge_base_id: Option<String>,
    /// Operation creation timestamp
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// Last update timestamp
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
    /// Version field
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "__v", default, skip_serializing_if = "Option::is_none")]
    pub v: Option<f64>,
    /// Robots.txt file content
    #[serde(
        rename = "robotsFileData",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub robots_file_data: Option<String>,
}

/// `TrainDiscoveredUrlsDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct TrainDiscoveredUrlsDTO {
    /// Location ID as string
    /// Required by the API.
    #[serde(rename = "locationId")]
    pub location_id: String,
    /// List of Object ids of the discovered urls
    /// Required by the API.
    #[serde(rename = "urlIds", default, skip_serializing_if = "Vec::is_empty")]
    pub url_ids: Vec<String>,
    /// knowledge base id
    /// Required by the API.
    #[serde(rename = "knowledgeBaseId")]
    pub knowledge_base_id: String,
    /// operation id as string
    /// Required by the API.
    #[serde(rename = "operationId")]
    pub operation_id: String,
}

/// `TrainDiscoveredUrlsResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct TrainDiscoveredUrlsResponseDTO {
    /// Indicates if the operation was successful
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
}

/// `UnauthorizedDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UnauthorizedDTO {
    #[serde(
        rename = "statusCode",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub status_code: Option<f64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
}

/// `UnprocessableDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UnprocessableDTO {
    #[serde(
        rename = "statusCode",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub status_code: Option<f64>,
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub message: Vec<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
}

/// `UpdateFaqBodyDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateFaqBodyDTO {
    /// faq question as a string
    /// Required by the API.
    pub question: String,
    /// faq answer as a string
    /// Required by the API.
    pub answer: String,
}

/// `UpdateFaqResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateFaqResponseDTO {
    /// Success status of the update operation
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
}

/// `UpdateKnowledgeBaseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateKnowledgeBaseDTO {
    /// field to update the name of the knowledge base
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// field to update the description of the knowledge base
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
}

/// `UpdateKnowledgeBaseResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateKnowledgeBaseResponseDTO {
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
}