Skip to main content

ghl_models/v3/
saas.rs

1// @generated by xtask/generate_models.py — do not edit by hand.
2// Source: https://github.com/GoHighLevel/highlevel-api-docs
3// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
4// they aren't held to rustdoc's markdown conventions.
5#![allow(
6    missing_docs,
7    clippy::doc_lazy_continuation,
8    clippy::doc_overindented_list_items
9)]
10
11use serde::{Deserialize, Serialize};
12
13/// `AgencyPlanResponseDto` from the GoHighLevel OpenAPI spec.
14#[derive(Debug, Clone, Default, Serialize, Deserialize)]
15pub struct AgencyPlanResponseDto {
16    /// Unique identifier for the plan
17    /// Required by the API.
18    #[serde(rename = "planId")]
19    pub plan_id: String,
20    /// Title of the plan
21    /// Required by the API.
22    pub title: String,
23    /// Description of the plan
24    /// Required by the API.
25    pub description: String,
26    /// Array of SaaS products included in the plan
27    /// Required by the API.
28    #[serde(
29        rename = "saasProducts",
30        default,
31        skip_serializing_if = "Vec::is_empty"
32    )]
33    pub saas_products: Vec<String>,
34    /// Array of add-ons included in the plan
35    #[serde(rename = "addOns", default, skip_serializing_if = "Vec::is_empty")]
36    pub add_ons: Vec<String>,
37    /// Level of the plan (0-4)
38    /// Required by the API.
39    #[serde(rename = "planLevel")]
40    pub plan_level: f64,
41    /// Trial period in days
42    /// Required by the API.
43    #[serde(rename = "trialPeriod")]
44    pub trial_period: f64,
45    /// User limit for the plan
46    #[serde(rename = "userLimit", default, skip_serializing_if = "Option::is_none")]
47    pub user_limit: Option<f64>,
48    /// Contact limit for the plan
49    #[serde(
50        rename = "contactLimit",
51        default,
52        skip_serializing_if = "Option::is_none"
53    )]
54    pub contact_limit: Option<f64>,
55    /// Pricing information for the plan
56    /// Nested object; raw JSON (see the API docs for its fields).
57    /// Required by the API.
58    #[serde(default, skip_serializing_if = "Vec::is_empty")]
59    pub prices: Vec<serde_json::Value>,
60    /// Category ID for the plan
61    #[serde(
62        rename = "categoryId",
63        default,
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub category_id: Option<String>,
67    /// Snapshot ID for the plan
68    #[serde(
69        rename = "snapshotId",
70        default,
71        skip_serializing_if = "Option::is_none"
72    )]
73    pub snapshot_id: Option<String>,
74    /// Product ID for the plan
75    #[serde(rename = "productId", default, skip_serializing_if = "Option::is_none")]
76    pub product_id: Option<String>,
77    /// Indicates if this is a SaaS V2 plan
78    /// Required by the API.
79    #[serde(rename = "isSaaSV2")]
80    pub is_saa_sv2: bool,
81    /// Provider location ID
82    #[serde(
83        rename = "providerLocationId",
84        default,
85        skip_serializing_if = "Option::is_none"
86    )]
87    pub provider_location_id: Option<String>,
88    /// Creation timestamp
89    /// Required by the API.
90    #[serde(rename = "createdAt")]
91    pub created_at: String,
92    /// Last update timestamp
93    /// Required by the API.
94    #[serde(rename = "updatedAt")]
95    pub updated_at: String,
96}
97
98/// `AllowAttachRebillingDto` from the GoHighLevel OpenAPI spec.
99#[derive(Debug, Clone, Default, Serialize, Deserialize)]
100pub struct AllowAttachRebillingDto {
101    /// Company ID owning the location
102    /// Required by the API.
103    #[serde(rename = "companyId")]
104    pub company_id: String,
105    /// Map of rebilling product code to its config. When provided, this gets stored on the
106    /// sub-account so it can be applied when the rebilling config is created. Omit to only mark
107    /// the sub-account as awaiting rebilling attach without any pre-configured products.
108    /// Possible product keys: `contentAI`, `workflow_premium_actions`, `workflow_ai`,
109    /// `conversationAI`, `whatsApp`, `reviewsAI`, `EmailVerification`, `funnelAI`,
110    /// `domainPurchase`, `Phone`, `Email`, `agentStudio`, `askai`, `aiStudio`.
111    #[serde(
112        rename = "attachedRebillingConfig",
113        default,
114        skip_serializing_if = "Option::is_none"
115    )]
116    pub attached_rebilling_config: Option<serde_json::Value>,
117}
118
119/// `AllowAttachRebillingResponseDto` from the GoHighLevel OpenAPI spec.
120#[derive(Debug, Clone, Default, Serialize, Deserialize)]
121pub struct AllowAttachRebillingResponseDto {
122    /// Indicates if the allow attach rebilling operation succeeded
123    /// Required by the API.
124    pub success: bool,
125    /// Location ID the rebilling config was attached to
126    /// Required by the API.
127    #[serde(rename = "locationId")]
128    pub location_id: String,
129    /// Stored rebilling configuration on the location. Markup is the internal percentage value
130    /// converted from the request multiplier (e.g. 4 -> 300%, 3 -> 200%).
131    /// Required by the API.
132    #[serde(rename = "attachedRebillingConfig")]
133    pub attached_rebilling_config: serde_json::Value,
134}
135
136/// `AttachedRebillingProductConfigDto` from the GoHighLevel OpenAPI spec.
137#[derive(Debug, Clone, Default, Serialize, Deserialize)]
138pub struct AttachedRebillingProductConfigDto {
139    /// Enable rebilling for the product
140    /// Required by the API.
141    pub enabled: bool,
142    /// Additional value to be added in terms of percentage
143    /// Required by the API.
144    pub markup: f64,
145    /// Product price override
146    #[serde(default, skip_serializing_if = "Option::is_none")]
147    pub price: Option<f64>,
148}
149
150/// `BadRequestDTO` from the GoHighLevel OpenAPI spec.
151#[derive(Debug, Clone, Default, Serialize, Deserialize)]
152pub struct BadRequestDTO {
153    /// Status code
154    #[serde(
155        rename = "statusCode",
156        default,
157        skip_serializing_if = "Option::is_none"
158    )]
159    pub status_code: Option<f64>,
160    /// Error message
161    #[serde(default, skip_serializing_if = "Option::is_none")]
162    pub message: Option<String>,
163}
164
165/// `BulkDisableSaasDto` from the GoHighLevel OpenAPI spec.
166#[derive(Debug, Clone, Default, Serialize, Deserialize)]
167pub struct BulkDisableSaasDto {
168    /// Location IDs
169    /// Required by the API.
170    #[serde(rename = "locationIds", default, skip_serializing_if = "Vec::is_empty")]
171    pub location_ids: Vec<String>,
172}
173
174/// `BulkDisableSaasResponseDto` from the GoHighLevel OpenAPI spec.
175#[derive(Debug, Clone, Default, Serialize, Deserialize)]
176pub struct BulkDisableSaasResponseDto {
177    /// Response data from the bulk disable SaaS operation
178    /// Required by the API.
179    pub data: serde_json::Value,
180}
181
182/// `BulkEnableSaasActionPayloadDto` from the GoHighLevel OpenAPI spec.
183#[derive(Debug, Clone, Default, Serialize, Deserialize)]
184pub struct BulkEnableSaasActionPayloadDto {
185    /// Price ID for the SaaS plan
186    #[serde(rename = "priceId", default, skip_serializing_if = "Option::is_none")]
187    pub price_id: Option<String>,
188    /// Stripe account ID
189    #[serde(
190        rename = "stripeAccountId",
191        default,
192        skip_serializing_if = "Option::is_none"
193    )]
194    pub stripe_account_id: Option<String>,
195    /// SaaS plan ID
196    /// Required by the API.
197    #[serde(rename = "saasPlanId")]
198    pub saas_plan_id: String,
199    /// Provider location ID
200    #[serde(
201        rename = "providerLocationId",
202        default,
203        skip_serializing_if = "Option::is_none"
204    )]
205    pub provider_location_id: Option<String>,
206}
207
208/// `BulkEnableSaasRequestDto` from the GoHighLevel OpenAPI spec.
209#[derive(Debug, Clone, Default, Serialize, Deserialize)]
210pub struct BulkEnableSaasRequestDto {
211    /// Array of location IDs to enable SaaS for
212    /// Required by the API.
213    #[serde(rename = "locationIds", default, skip_serializing_if = "Vec::is_empty")]
214    pub location_ids: Vec<String>,
215    /// Indicates if the SaaS is V2
216    /// Required by the API.
217    #[serde(rename = "isSaaSV2")]
218    pub is_saa_sv2: bool,
219    /// Action payload for the bulk enable SaaS operation
220    /// Required by the API.
221    #[serde(rename = "actionPayload")]
222    pub action_payload: BulkEnableSaasActionPayloadDto,
223}
224
225/// `BulkEnableSaasResponseDto` from the GoHighLevel OpenAPI spec.
226#[derive(Debug, Clone, Default, Serialize, Deserialize)]
227pub struct BulkEnableSaasResponseDto {
228    /// Indicates if the bulk enable SaaS operation was successful
229    /// Required by the API.
230    pub success: bool,
231    /// Message indicating the bulk enable SaaS operation
232    /// Required by the API.
233    pub message: String,
234    /// URL for the bulk enable SaaS operation
235    #[serde(
236        rename = "bulkActionUrl",
237        default,
238        skip_serializing_if = "Option::is_none"
239    )]
240    pub bulk_action_url: Option<String>,
241}
242
243/// `ComplimentaryCreditDTO` from the GoHighLevel OpenAPI spec.
244#[derive(Debug, Clone, Default, Serialize, Deserialize)]
245pub struct ComplimentaryCreditDTO {
246    /// Credit amount to be added
247    #[serde(
248        rename = "complimentaryCreditsAmount",
249        default,
250        skip_serializing_if = "Option::is_none"
251    )]
252    pub complimentary_credits_amount: Option<f64>,
253}
254
255/// `EnableSaasDto` from the GoHighLevel OpenAPI spec.
256#[derive(Debug, Clone, Default, Serialize, Deserialize)]
257pub struct EnableSaasDto {
258    /// Stripe account id(Required only for SaaS V1)
259    #[serde(
260        rename = "stripeAccountId",
261        default,
262        skip_serializing_if = "Option::is_none"
263    )]
264    pub stripe_account_id: Option<String>,
265    /// Name of the stripe customer(Required only for SaaS V1)
266    #[serde(default, skip_serializing_if = "Option::is_none")]
267    pub name: Option<String>,
268    /// Email of the stripe customer(Required only for SaaS V1)
269    #[serde(default, skip_serializing_if = "Option::is_none")]
270    pub email: Option<String>,
271    /// Stripe customer id if exists(Required only for SaaS V1)
272    #[serde(
273        rename = "stripeCustomerId",
274        default,
275        skip_serializing_if = "Option::is_none"
276    )]
277    pub stripe_customer_id: Option<String>,
278    /// Required by the API.
279    #[serde(rename = "companyId")]
280    pub company_id: String,
281    /// Denotes if it is a saas v2 or v1 sub-account
282    /// Required by the API.
283    #[serde(rename = "isSaaSV2")]
284    pub is_saa_sv2: bool,
285    /// Agency subaccount used for payment provider integration(Required Only for SaaS V2)
286    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
287    pub contact_id: Option<String>,
288    /// Agency Subaccount ID
289    #[serde(
290        rename = "providerLocationId",
291        default,
292        skip_serializing_if = "Option::is_none"
293    )]
294    pub provider_location_id: Option<String>,
295    /// Description
296    #[serde(default, skip_serializing_if = "Option::is_none")]
297    pub description: Option<String>,
298    /// Required only while pre-configuring saas subscription
299    #[serde(
300        rename = "saasPlanId",
301        default,
302        skip_serializing_if = "Option::is_none"
303    )]
304    pub saas_plan_id: Option<String>,
305    /// Required only while pre-configuring saas subscription
306    #[serde(rename = "priceId", default, skip_serializing_if = "Option::is_none")]
307    pub price_id: Option<String>,
308}
309
310/// `EnableSaasResponseDto` from the GoHighLevel OpenAPI spec.
311#[derive(Debug, Clone, Default, Serialize, Deserialize)]
312pub struct EnableSaasResponseDto {
313    /// Response data from the enable SaaS operation
314    /// Required by the API.
315    pub data: serde_json::Value,
316}
317
318/// `GetSaasLocationsResponseDto` from the GoHighLevel OpenAPI spec.
319#[derive(Debug, Clone, Default, Serialize, Deserialize)]
320pub struct GetSaasLocationsResponseDto {
321    /// Array of SaaS locations
322    /// Required by the API.
323    #[serde(default, skip_serializing_if = "Vec::is_empty")]
324    pub locations: Vec<SaasLocationDto>,
325    /// Nested object; raw JSON (see the API docs for its fields).
326    /// Required by the API.
327    pub pagination: serde_json::Value,
328}
329
330/// `InternalServerErrorDTO` from the GoHighLevel OpenAPI spec.
331#[derive(Debug, Clone, Default, Serialize, Deserialize)]
332pub struct InternalServerErrorDTO {
333    /// Status code
334    #[serde(
335        rename = "statusCode",
336        default,
337        skip_serializing_if = "Option::is_none"
338    )]
339    pub status_code: Option<f64>,
340    /// Error message
341    #[serde(default, skip_serializing_if = "Option::is_none")]
342    pub message: Option<String>,
343}
344
345/// `LocationSubscriptionResponseDto` from the GoHighLevel OpenAPI spec.
346#[derive(Debug, Clone, Default, Serialize, Deserialize)]
347pub struct LocationSubscriptionResponseDto {
348    /// Location ID
349    /// Required by the API.
350    #[serde(rename = "locationId")]
351    pub location_id: String,
352    /// Indicates if the SaaS is V2
353    /// Required by the API.
354    #[serde(rename = "isSaaSV2")]
355    pub is_saa_sv2: bool,
356    /// Company ID
357    /// Required by the API.
358    #[serde(rename = "companyId")]
359    pub company_id: String,
360    /// SaaS mode
361    #[serde(rename = "saasMode", default, skip_serializing_if = "Option::is_none")]
362    pub saas_mode: Option<String>,
363    /// Subscription ID
364    #[serde(
365        rename = "subscriptionId",
366        default,
367        skip_serializing_if = "Option::is_none"
368    )]
369    pub subscription_id: Option<String>,
370    /// Customer ID
371    #[serde(
372        rename = "customerId",
373        default,
374        skip_serializing_if = "Option::is_none"
375    )]
376    pub customer_id: Option<String>,
377    /// Product ID
378    #[serde(rename = "productId", default, skip_serializing_if = "Option::is_none")]
379    pub product_id: Option<String>,
380    /// Price ID
381    #[serde(rename = "priceId", default, skip_serializing_if = "Option::is_none")]
382    pub price_id: Option<String>,
383    /// SaaS plan ID
384    #[serde(
385        rename = "saasPlanId",
386        default,
387        skip_serializing_if = "Option::is_none"
388    )]
389    pub saas_plan_id: Option<String>,
390    /// Subscription status
391    #[serde(
392        rename = "subscriptionStatus",
393        default,
394        skip_serializing_if = "Option::is_none"
395    )]
396    pub subscription_status: Option<String>,
397}
398
399/// `LocationWalletBalanceDto` from the GoHighLevel OpenAPI spec.
400#[derive(Debug, Clone, Default, Serialize, Deserialize)]
401pub struct LocationWalletBalanceDto {
402    /// Wallet Id
403    /// Required by the API.
404    #[serde(rename = "walletId")]
405    pub wallet_id: String,
406    /// Current wallet balance
407    /// Required by the API.
408    pub balance: f64,
409    /// Complimentary credits amount
410    /// Required by the API.
411    #[serde(rename = "complimentaryCredits")]
412    pub complimentary_credits: f64,
413}
414
415/// `PauseLocationDto` from the GoHighLevel OpenAPI spec.
416#[derive(Debug, Clone, Default, Serialize, Deserialize)]
417pub struct PauseLocationDto {
418    /// Paused
419    /// Required by the API.
420    pub paused: bool,
421    /// Company ID
422    /// Required by the API.
423    #[serde(rename = "companyId")]
424    pub company_id: String,
425}
426
427/// `ResourceNotFoundDTO` from the GoHighLevel OpenAPI spec.
428#[derive(Debug, Clone, Default, Serialize, Deserialize)]
429pub struct ResourceNotFoundDTO {
430    /// Status code
431    #[serde(
432        rename = "statusCode",
433        default,
434        skip_serializing_if = "Option::is_none"
435    )]
436    pub status_code: Option<f64>,
437    /// Error message
438    #[serde(default, skip_serializing_if = "Option::is_none")]
439    pub message: Option<String>,
440}
441
442/// `SaasLocationDto` from the GoHighLevel OpenAPI spec.
443#[derive(Debug, Clone, Default, Serialize, Deserialize)]
444pub struct SaasLocationDto {
445    /// Location ID
446    /// Required by the API.
447    #[serde(rename = "locationId")]
448    pub location_id: String,
449    /// Company ID
450    /// Required by the API.
451    #[serde(rename = "companyId")]
452    pub company_id: String,
453    /// SaaS mode
454    /// Required by the API.
455    #[serde(rename = "saasMode")]
456    pub saas_mode: String,
457    /// Subscription ID
458    /// Required by the API.
459    #[serde(rename = "subscriptionId")]
460    pub subscription_id: String,
461    /// Customer ID
462    #[serde(
463        rename = "customerId",
464        default,
465        skip_serializing_if = "Option::is_none"
466    )]
467    pub customer_id: Option<String>,
468    /// Name
469    #[serde(default, skip_serializing_if = "Option::is_none")]
470    pub name: Option<String>,
471    /// Email
472    #[serde(default, skip_serializing_if = "Option::is_none")]
473    pub email: Option<String>,
474    /// Provider location ID
475    #[serde(
476        rename = "providerLocationId",
477        default,
478        skip_serializing_if = "Option::is_none"
479    )]
480    pub provider_location_id: Option<String>,
481    /// Indicates if the SaaS is V2
482    #[serde(rename = "isSaaSV2", default, skip_serializing_if = "Option::is_none")]
483    pub is_saa_sv2: Option<bool>,
484    /// Subscription information
485    #[serde(
486        rename = "subscriptionInfo",
487        default,
488        skip_serializing_if = "Option::is_none"
489    )]
490    pub subscription_info: Option<serde_json::Value>,
491}
492
493/// `SaasPlanResponseDto` from the GoHighLevel OpenAPI spec.
494#[derive(Debug, Clone, Default, Serialize, Deserialize)]
495pub struct SaasPlanResponseDto {
496    /// Unique identifier for the SaaS plan
497    /// Required by the API.
498    #[serde(rename = "planId")]
499    pub plan_id: String,
500    /// Company ID associated with the SaaS plan
501    /// Required by the API.
502    #[serde(rename = "companyId")]
503    pub company_id: String,
504    /// Title of the SaaS plan
505    /// Required by the API.
506    pub title: String,
507    /// Description of the SaaS plan
508    /// Required by the API.
509    pub description: String,
510    /// Array of SaaS products included in the plan
511    /// Required by the API.
512    #[serde(
513        rename = "saasProducts",
514        default,
515        skip_serializing_if = "Vec::is_empty"
516    )]
517    pub saas_products: Vec<String>,
518    /// Array of add-ons included in the plan
519    #[serde(rename = "addOns", default, skip_serializing_if = "Vec::is_empty")]
520    pub add_ons: Vec<String>,
521    /// Level of the plan (0-4)
522    /// Required by the API.
523    #[serde(rename = "planLevel")]
524    pub plan_level: f64,
525    /// Trial period in days
526    /// Required by the API.
527    #[serde(rename = "trialPeriod")]
528    pub trial_period: f64,
529    /// Setup fee for the plan
530    #[serde(rename = "setupFee", default, skip_serializing_if = "Option::is_none")]
531    pub setup_fee: Option<f64>,
532    /// User limit for the plan
533    #[serde(rename = "userLimit", default, skip_serializing_if = "Option::is_none")]
534    pub user_limit: Option<f64>,
535    /// Contact limit for the plan
536    #[serde(
537        rename = "contactLimit",
538        default,
539        skip_serializing_if = "Option::is_none"
540    )]
541    pub contact_limit: Option<f64>,
542    /// Prices for the plan
543    /// Nested object; raw JSON (see the API docs for its fields).
544    /// Required by the API.
545    #[serde(default, skip_serializing_if = "Vec::is_empty")]
546    pub prices: Vec<serde_json::Value>,
547    /// Category ID for the plan
548    #[serde(
549        rename = "categoryId",
550        default,
551        skip_serializing_if = "Option::is_none"
552    )]
553    pub category_id: Option<String>,
554    /// Snapshot ID for the plan
555    #[serde(
556        rename = "snapshotId",
557        default,
558        skip_serializing_if = "Option::is_none"
559    )]
560    pub snapshot_id: Option<String>,
561    /// Provider location ID
562    #[serde(
563        rename = "providerLocationId",
564        default,
565        skip_serializing_if = "Option::is_none"
566    )]
567    pub provider_location_id: Option<String>,
568    /// Product ID for the plan
569    #[serde(rename = "productId", default, skip_serializing_if = "Option::is_none")]
570    pub product_id: Option<String>,
571    /// Indicates if this is a SaaS V2 plan
572    /// Required by the API.
573    #[serde(rename = "isSaaSV2")]
574    pub is_saa_sv2: bool,
575    /// Creation timestamp
576    /// Format: date-time (ISO-8601 string).
577    /// Required by the API.
578    #[serde(rename = "createdAt")]
579    pub created_at: String,
580    /// Last update timestamp
581    /// Format: date-time (ISO-8601 string).
582    /// Required by the API.
583    #[serde(rename = "updatedAt")]
584    pub updated_at: String,
585}
586
587/// `UnauthorizedDTO` from the GoHighLevel OpenAPI spec.
588#[derive(Debug, Clone, Default, Serialize, Deserialize)]
589pub struct UnauthorizedDTO {
590    /// Status code
591    #[serde(
592        rename = "statusCode",
593        default,
594        skip_serializing_if = "Option::is_none"
595    )]
596    pub status_code: Option<f64>,
597    /// Error message
598    #[serde(default, skip_serializing_if = "Option::is_none")]
599    pub message: Option<String>,
600    /// Error message
601    #[serde(default, skip_serializing_if = "Option::is_none")]
602    pub error: Option<String>,
603}
604
605/// `UpdateRebillingDto` from the GoHighLevel OpenAPI spec.
606#[derive(Debug, Clone, Default, Serialize, Deserialize)]
607pub struct UpdateRebillingDto {
608    /// The product to update rebilling for
609    /// Allowed values: `contentAI`, `workflow_premium_actions`, `workflow_ai`,
610    /// `conversationAI`, `EmailNotification`, `whatsApp`, `reviewsAI`, `VERIFIED_CALLER_ID`,
611    /// `WALLET_SALES_TAX`, `NOTIFICATION_SMS`, `EmailSmtp`, `EmailVerification`.
612    /// Required by the API.
613    pub product: String,
614    /// Array of location IDs to update rebilling for
615    /// Required by the API.
616    #[serde(rename = "locationIds", default, skip_serializing_if = "Vec::is_empty")]
617    pub location_ids: Vec<String>,
618    /// Configuration for rebilling settings
619    /// Nested object; raw JSON (see the API docs for its fields).
620    /// Required by the API.
621    pub config: serde_json::Value,
622}
623
624/// `UpdateRebillingResponseDto` from the GoHighLevel OpenAPI spec.
625#[derive(Debug, Clone, Default, Serialize, Deserialize)]
626pub struct UpdateRebillingResponseDto {
627    /// Indicates if the rebilling update was successful
628    /// Required by the API.
629    pub success: bool,
630}
631
632/// `UpdateSubscriptionDto` from the GoHighLevel OpenAPI spec.
633#[derive(Debug, Clone, Default, Serialize, Deserialize)]
634pub struct UpdateSubscriptionDto {
635    /// Subscription ID
636    /// Required by the API.
637    #[serde(rename = "subscriptionId")]
638    pub subscription_id: String,
639    /// Customer ID
640    /// Required by the API.
641    #[serde(rename = "customerId")]
642    pub customer_id: String,
643    /// Company ID
644    /// Required by the API.
645    #[serde(rename = "companyId")]
646    pub company_id: String,
647}