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
//! `saas` data models for GoHighLevel API V3 (25 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Saas** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`saas` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/saas.md).
//!
//! Enable with `features = ["saas"]`.
// @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};

/// `AgencyPlanResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct AgencyPlanResponseDto {
    /// Unique identifier for the plan
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")]
    pub plan_id: Option<String>,
    /// Title of the plan
    /// 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>,
    /// Description of the plan
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Array of SaaS products included in the plan
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "saasProducts",
        default,
        skip_serializing_if = "Vec::is_empty"
    )]
    pub saas_products: Vec<String>,
    /// Array of add-ons included in the plan
    #[serde(rename = "addOns", default, skip_serializing_if = "Vec::is_empty")]
    pub add_ons: Vec<String>,
    /// Level of the plan (0-4)
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "planLevel", default, skip_serializing_if = "Option::is_none")]
    pub plan_level: Option<f64>,
    /// Trial period in days
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "trialPeriod",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub trial_period: Option<f64>,
    /// User limit for the plan
    #[serde(rename = "userLimit", default, skip_serializing_if = "Option::is_none")]
    pub user_limit: Option<f64>,
    /// Contact limit for the plan
    #[serde(
        rename = "contactLimit",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub contact_limit: Option<f64>,
    /// Pricing information for the plan
    /// Nested object; raw JSON (see the API docs for its fields).
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub prices: Vec<serde_json::Value>,
    /// Category ID for the plan
    #[serde(
        rename = "categoryId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub category_id: Option<String>,
    /// Snapshot ID for the plan
    #[serde(
        rename = "snapshotId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub snapshot_id: Option<String>,
    /// Product ID for the plan
    #[serde(rename = "productId", default, skip_serializing_if = "Option::is_none")]
    pub product_id: Option<String>,
    /// Indicates if this is a SaaS V2 plan
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "isSaaSV2", default, skip_serializing_if = "Option::is_none")]
    pub is_saa_sv2: Option<bool>,
    /// Provider location ID
    #[serde(
        rename = "providerLocationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub provider_location_id: Option<String>,
    /// 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>,
}

/// `AllowAttachRebillingDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct AllowAttachRebillingDto {
    /// Company ID owning the location
    /// Required by the API.
    #[serde(rename = "companyId")]
    pub company_id: String,
    /// Map of rebilling product code to its config. When provided, this gets stored on the
    /// sub-account so it can be applied when the rebilling config is created. Omit to only mark
    /// the sub-account as awaiting rebilling attach without any pre-configured products.
    /// Possible product keys: `contentAI`, `workflow_premium_actions`, `workflow_ai`,
    /// `conversationAI`, `whatsApp`, `reviewsAI`, `EmailVerification`, `funnelAI`,
    /// `domainPurchase`, `Phone`, `Email`, `agentStudio`, `askai`, `aiStudio`.
    #[serde(
        rename = "attachedRebillingConfig",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub attached_rebilling_config: Option<serde_json::Value>,
}

/// `AllowAttachRebillingResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct AllowAttachRebillingResponseDto {
    /// Indicates if the allow attach rebilling operation succeeded
    /// 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>,
    /// Location ID the rebilling config was attached to
    /// 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>,
    /// Stored rebilling configuration on the location. Markup is the internal percentage value
    /// converted from the request multiplier (e.g. 4 -> 300%, 3 -> 200%).
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "attachedRebillingConfig",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub attached_rebilling_config: Option<serde_json::Value>,
}

/// `AttachedRebillingProductConfigDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct AttachedRebillingProductConfigDto {
    /// Enable rebilling for the product
    /// Required by the API.
    pub enabled: bool,
    /// Additional value to be added in terms of percentage
    /// Required by the API.
    pub markup: f64,
    /// Product price override
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub price: Option<f64>,
}

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

/// `BulkDisableSaasDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BulkDisableSaasDto {
    /// Location IDs
    /// Required by the API.
    #[serde(rename = "locationIds", default, skip_serializing_if = "Vec::is_empty")]
    pub location_ids: Vec<String>,
}

/// `BulkDisableSaasResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BulkDisableSaasResponseDto {
    /// Response data from the bulk disable SaaS operation
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<serde_json::Value>,
}

/// `BulkEnableSaasActionPayloadDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BulkEnableSaasActionPayloadDto {
    /// Price ID for the SaaS plan
    #[serde(rename = "priceId", default, skip_serializing_if = "Option::is_none")]
    pub price_id: Option<String>,
    /// Stripe account ID
    #[serde(
        rename = "stripeAccountId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub stripe_account_id: Option<String>,
    /// SaaS plan ID
    /// Required by the API.
    #[serde(rename = "saasPlanId")]
    pub saas_plan_id: String,
    /// Provider location ID
    #[serde(
        rename = "providerLocationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub provider_location_id: Option<String>,
}

/// `BulkEnableSaasRequestDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BulkEnableSaasRequestDto {
    /// Array of location IDs to enable SaaS for
    /// Required by the API.
    #[serde(rename = "locationIds", default, skip_serializing_if = "Vec::is_empty")]
    pub location_ids: Vec<String>,
    /// Indicates if the SaaS is V2
    /// Required by the API.
    #[serde(rename = "isSaaSV2")]
    pub is_saa_sv2: bool,
    /// Action payload for the bulk enable SaaS operation
    /// Required by the API.
    #[serde(rename = "actionPayload")]
    pub action_payload: BulkEnableSaasActionPayloadDto,
}

/// `BulkEnableSaasResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BulkEnableSaasResponseDto {
    /// Indicates if the bulk enable SaaS 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>,
    /// Message indicating the bulk enable SaaS operation
    /// 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>,
    /// URL for the bulk enable SaaS operation
    #[serde(
        rename = "bulkActionUrl",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub bulk_action_url: Option<String>,
}

/// `ComplimentaryCreditDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ComplimentaryCreditDTO {
    /// Credit amount to be added
    #[serde(
        rename = "complimentaryCreditsAmount",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub complimentary_credits_amount: Option<f64>,
}

/// `EnableSaasDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct EnableSaasDto {
    /// Stripe account id(Required only for SaaS V1)
    #[serde(
        rename = "stripeAccountId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub stripe_account_id: Option<String>,
    /// Name of the stripe customer(Required only for SaaS V1)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Email of the stripe customer(Required only for SaaS V1)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    /// Stripe customer id if exists(Required only for SaaS V1)
    #[serde(
        rename = "stripeCustomerId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub stripe_customer_id: Option<String>,
    /// Required by the API.
    #[serde(rename = "companyId")]
    pub company_id: String,
    /// Denotes if it is a saas v2 or v1 sub-account
    /// Required by the API.
    #[serde(rename = "isSaaSV2")]
    pub is_saa_sv2: bool,
    /// Agency subaccount used for payment provider integration(Required Only for SaaS V2)
    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
    pub contact_id: Option<String>,
    /// Agency Subaccount ID
    #[serde(
        rename = "providerLocationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub provider_location_id: Option<String>,
    /// Description
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Required only while pre-configuring saas subscription
    #[serde(
        rename = "saasPlanId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub saas_plan_id: Option<String>,
    /// Required only while pre-configuring saas subscription
    #[serde(rename = "priceId", default, skip_serializing_if = "Option::is_none")]
    pub price_id: Option<String>,
}

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

/// `GetSaasLocationsResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetSaasLocationsResponseDto {
    /// Array of SaaS locations
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub locations: Vec<SaasLocationDto>,
    /// Nested object; raw JSON (see the API docs for its fields).
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub pagination: Option<serde_json::Value>,
}

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

/// `LocationSubscriptionResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct LocationSubscriptionResponseDto {
    /// 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>,
    /// Indicates if the SaaS is V2
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "isSaaSV2", default, skip_serializing_if = "Option::is_none")]
    pub is_saa_sv2: Option<bool>,
    /// Company ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "companyId", default, skip_serializing_if = "Option::is_none")]
    pub company_id: Option<String>,
    /// SaaS mode
    #[serde(rename = "saasMode", default, skip_serializing_if = "Option::is_none")]
    pub saas_mode: Option<String>,
    /// Subscription ID
    #[serde(
        rename = "subscriptionId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub subscription_id: Option<String>,
    /// Customer ID
    #[serde(
        rename = "customerId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub customer_id: Option<String>,
    /// Product ID
    #[serde(rename = "productId", default, skip_serializing_if = "Option::is_none")]
    pub product_id: Option<String>,
    /// Price ID
    #[serde(rename = "priceId", default, skip_serializing_if = "Option::is_none")]
    pub price_id: Option<String>,
    /// SaaS plan ID
    #[serde(
        rename = "saasPlanId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub saas_plan_id: Option<String>,
    /// Subscription status
    #[serde(
        rename = "subscriptionStatus",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub subscription_status: Option<String>,
}

/// `LocationWalletBalanceDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct LocationWalletBalanceDto {
    /// Wallet Id
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "walletId", default, skip_serializing_if = "Option::is_none")]
    pub wallet_id: Option<String>,
    /// Current wallet balance
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub balance: Option<f64>,
    /// Complimentary credits amount
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "complimentaryCredits",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub complimentary_credits: Option<f64>,
}

/// `PauseLocationDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct PauseLocationDto {
    /// Paused
    /// Required by the API.
    pub paused: bool,
    /// Company ID
    /// Required by the API.
    #[serde(rename = "companyId")]
    pub company_id: String,
}

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

/// `SaasLocationDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct SaasLocationDto {
    /// 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>,
    /// Company ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "companyId", default, skip_serializing_if = "Option::is_none")]
    pub company_id: Option<String>,
    /// SaaS mode
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "saasMode", default, skip_serializing_if = "Option::is_none")]
    pub saas_mode: Option<String>,
    /// Subscription ID
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "subscriptionId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub subscription_id: Option<String>,
    /// Customer ID
    #[serde(
        rename = "customerId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub customer_id: Option<String>,
    /// Name
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Email
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    /// Provider location ID
    #[serde(
        rename = "providerLocationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub provider_location_id: Option<String>,
    /// Indicates if the SaaS is V2
    #[serde(rename = "isSaaSV2", default, skip_serializing_if = "Option::is_none")]
    pub is_saa_sv2: Option<bool>,
    /// Subscription information
    #[serde(
        rename = "subscriptionInfo",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub subscription_info: Option<serde_json::Value>,
}

/// `SaasPlanResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct SaasPlanResponseDto {
    /// Unique identifier for the SaaS plan
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")]
    pub plan_id: Option<String>,
    /// Company ID associated with the SaaS plan
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "companyId", default, skip_serializing_if = "Option::is_none")]
    pub company_id: Option<String>,
    /// Title of the SaaS plan
    /// 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>,
    /// Description of the SaaS plan
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Array of SaaS products included in the plan
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "saasProducts",
        default,
        skip_serializing_if = "Vec::is_empty"
    )]
    pub saas_products: Vec<String>,
    /// Array of add-ons included in the plan
    #[serde(rename = "addOns", default, skip_serializing_if = "Vec::is_empty")]
    pub add_ons: Vec<String>,
    /// Level of the plan (0-4)
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "planLevel", default, skip_serializing_if = "Option::is_none")]
    pub plan_level: Option<f64>,
    /// Trial period in days
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(
        rename = "trialPeriod",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub trial_period: Option<f64>,
    /// Setup fee for the plan
    #[serde(rename = "setupFee", default, skip_serializing_if = "Option::is_none")]
    pub setup_fee: Option<f64>,
    /// User limit for the plan
    #[serde(rename = "userLimit", default, skip_serializing_if = "Option::is_none")]
    pub user_limit: Option<f64>,
    /// Contact limit for the plan
    #[serde(
        rename = "contactLimit",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub contact_limit: Option<f64>,
    /// Prices for the plan
    /// Nested object; raw JSON (see the API docs for its fields).
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub prices: Vec<serde_json::Value>,
    /// Category ID for the plan
    #[serde(
        rename = "categoryId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub category_id: Option<String>,
    /// Snapshot ID for the plan
    #[serde(
        rename = "snapshotId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub snapshot_id: Option<String>,
    /// Provider location ID
    #[serde(
        rename = "providerLocationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub provider_location_id: Option<String>,
    /// Product ID for the plan
    #[serde(rename = "productId", default, skip_serializing_if = "Option::is_none")]
    pub product_id: Option<String>,
    /// Indicates if this is a SaaS V2 plan
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "isSaaSV2", default, skip_serializing_if = "Option::is_none")]
    pub is_saa_sv2: Option<bool>,
    /// Creation timestamp
    /// Format: date-time (ISO-8601 string).
    /// 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
    /// Format: date-time (ISO-8601 string).
    /// 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>,
}

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

/// `UpdateRebillingDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateRebillingDto {
    /// The product to update rebilling for
    /// Allowed values: `contentAI`, `workflow_premium_actions`, `workflow_ai`,
    /// `conversationAI`, `EmailNotification`, `whatsApp`, `reviewsAI`, `VERIFIED_CALLER_ID`,
    /// `WALLET_SALES_TAX`, `NOTIFICATION_SMS`, `EmailSmtp`, `EmailVerification`.
    /// Required by the API.
    pub product: String,
    /// Array of location IDs to update rebilling for
    /// Required by the API.
    #[serde(rename = "locationIds", default, skip_serializing_if = "Vec::is_empty")]
    pub location_ids: Vec<String>,
    /// Configuration for rebilling settings
    /// Nested object; raw JSON (see the API docs for its fields).
    /// Required by the API.
    pub config: serde_json::Value,
}

/// `UpdateRebillingResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateRebillingResponseDto {
    /// Indicates if the rebilling update 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>,
}

/// `UpdateSubscriptionDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateSubscriptionDto {
    /// Subscription ID
    /// Required by the API.
    #[serde(rename = "subscriptionId")]
    pub subscription_id: String,
    /// Customer ID
    /// Required by the API.
    #[serde(rename = "customerId")]
    pub customer_id: String,
    /// Company ID
    /// Required by the API.
    #[serde(rename = "companyId")]
    pub company_id: String,
}