Skip to main content

ghl_models/v2/
saas_api.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/// `BadRequestDTO` from the GoHighLevel OpenAPI spec.
99#[derive(Debug, Clone, Default, Serialize, Deserialize)]
100pub struct BadRequestDTO {
101    /// Status code
102    #[serde(
103        rename = "statusCode",
104        default,
105        skip_serializing_if = "Option::is_none"
106    )]
107    pub status_code: Option<f64>,
108    /// Error message
109    #[serde(default, skip_serializing_if = "Option::is_none")]
110    pub message: Option<String>,
111}
112
113/// `BulkDisableSaasDto` from the GoHighLevel OpenAPI spec.
114#[derive(Debug, Clone, Default, Serialize, Deserialize)]
115pub struct BulkDisableSaasDto {
116    /// Location IDs
117    /// Required by the API.
118    #[serde(rename = "locationIds", default, skip_serializing_if = "Vec::is_empty")]
119    pub location_ids: Vec<String>,
120}
121
122/// `BulkDisableSaasResponseDto` from the GoHighLevel OpenAPI spec.
123#[derive(Debug, Clone, Default, Serialize, Deserialize)]
124pub struct BulkDisableSaasResponseDto {
125    /// Response data from the bulk disable SaaS operation
126    /// Required by the API.
127    pub data: serde_json::Value,
128}
129
130/// `BulkEnableSaasActionPayloadDto` from the GoHighLevel OpenAPI spec.
131#[derive(Debug, Clone, Default, Serialize, Deserialize)]
132pub struct BulkEnableSaasActionPayloadDto {
133    /// Price ID for the SaaS plan
134    #[serde(rename = "priceId", default, skip_serializing_if = "Option::is_none")]
135    pub price_id: Option<String>,
136    /// Stripe account ID
137    #[serde(
138        rename = "stripeAccountId",
139        default,
140        skip_serializing_if = "Option::is_none"
141    )]
142    pub stripe_account_id: Option<String>,
143    /// SaaS plan ID
144    /// Required by the API.
145    #[serde(rename = "saasPlanId")]
146    pub saas_plan_id: String,
147    /// Provider location ID
148    #[serde(
149        rename = "providerLocationId",
150        default,
151        skip_serializing_if = "Option::is_none"
152    )]
153    pub provider_location_id: Option<String>,
154}
155
156/// `BulkEnableSaasRequestDto` from the GoHighLevel OpenAPI spec.
157#[derive(Debug, Clone, Default, Serialize, Deserialize)]
158pub struct BulkEnableSaasRequestDto {
159    /// Array of location IDs to enable SaaS for
160    /// Required by the API.
161    #[serde(rename = "locationIds", default, skip_serializing_if = "Vec::is_empty")]
162    pub location_ids: Vec<String>,
163    /// Indicates if the SaaS is V2
164    /// Required by the API.
165    #[serde(rename = "isSaaSV2")]
166    pub is_saa_sv2: bool,
167    /// Action payload for the bulk enable SaaS operation
168    /// Required by the API.
169    #[serde(rename = "actionPayload")]
170    pub action_payload: BulkEnableSaasActionPayloadDto,
171}
172
173/// `BulkEnableSaasResponseDto` from the GoHighLevel OpenAPI spec.
174#[derive(Debug, Clone, Default, Serialize, Deserialize)]
175pub struct BulkEnableSaasResponseDto {
176    /// Indicates if the bulk enable SaaS operation was successful
177    /// Required by the API.
178    pub success: bool,
179    /// Message indicating the bulk enable SaaS operation
180    /// Required by the API.
181    pub message: String,
182    /// URL for the bulk enable SaaS operation
183    #[serde(
184        rename = "bulkActionUrl",
185        default,
186        skip_serializing_if = "Option::is_none"
187    )]
188    pub bulk_action_url: Option<String>,
189}
190
191/// `EnableSaasDto` from the GoHighLevel OpenAPI spec.
192#[derive(Debug, Clone, Default, Serialize, Deserialize)]
193pub struct EnableSaasDto {
194    /// Stripe account id(Required only for SaaS V1)
195    #[serde(
196        rename = "stripeAccountId",
197        default,
198        skip_serializing_if = "Option::is_none"
199    )]
200    pub stripe_account_id: Option<String>,
201    /// Name of the stripe customer(Required only for SaaS V1)
202    #[serde(default, skip_serializing_if = "Option::is_none")]
203    pub name: Option<String>,
204    /// Email of the stripe customer(Required only for SaaS V1)
205    #[serde(default, skip_serializing_if = "Option::is_none")]
206    pub email: Option<String>,
207    /// Stripe customer id if exists(Required only for SaaS V1)
208    #[serde(
209        rename = "stripeCustomerId",
210        default,
211        skip_serializing_if = "Option::is_none"
212    )]
213    pub stripe_customer_id: Option<String>,
214    /// Required by the API.
215    #[serde(rename = "companyId")]
216    pub company_id: String,
217    /// Denotes if it is a saas v2 or v1 sub-account
218    /// Required by the API.
219    #[serde(rename = "isSaaSV2")]
220    pub is_saa_sv2: bool,
221    /// Agency subaccount used for payment provider integration(Required Only for SaaS V2)
222    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
223    pub contact_id: Option<String>,
224    /// Agency Subaccount ID
225    #[serde(
226        rename = "providerLocationId",
227        default,
228        skip_serializing_if = "Option::is_none"
229    )]
230    pub provider_location_id: Option<String>,
231    /// Description
232    #[serde(default, skip_serializing_if = "Option::is_none")]
233    pub description: Option<String>,
234    /// Required only while pre-configuring saas subscription
235    #[serde(
236        rename = "saasPlanId",
237        default,
238        skip_serializing_if = "Option::is_none"
239    )]
240    pub saas_plan_id: Option<String>,
241    /// Required only while pre-configuring saas subscription
242    #[serde(rename = "priceId", default, skip_serializing_if = "Option::is_none")]
243    pub price_id: Option<String>,
244}
245
246/// `EnableSaasResponseDto` from the GoHighLevel OpenAPI spec.
247#[derive(Debug, Clone, Default, Serialize, Deserialize)]
248pub struct EnableSaasResponseDto {
249    /// Response data from the enable SaaS operation
250    /// Required by the API.
251    pub data: serde_json::Value,
252}
253
254/// `GetSaasLocationsResponseDto` from the GoHighLevel OpenAPI spec.
255#[derive(Debug, Clone, Default, Serialize, Deserialize)]
256pub struct GetSaasLocationsResponseDto {
257    /// Array of SaaS locations
258    /// Required by the API.
259    #[serde(default, skip_serializing_if = "Vec::is_empty")]
260    pub locations: Vec<SaasLocationDto>,
261    /// Nested object; raw JSON (see the API docs for its fields).
262    /// Required by the API.
263    pub pagination: serde_json::Value,
264}
265
266/// `InternalServerErrorDTO` from the GoHighLevel OpenAPI spec.
267#[derive(Debug, Clone, Default, Serialize, Deserialize)]
268pub struct InternalServerErrorDTO {
269    /// Status code
270    #[serde(
271        rename = "statusCode",
272        default,
273        skip_serializing_if = "Option::is_none"
274    )]
275    pub status_code: Option<f64>,
276    /// Error message
277    #[serde(default, skip_serializing_if = "Option::is_none")]
278    pub message: Option<String>,
279}
280
281/// `LocationSubscriptionResponseDto` from the GoHighLevel OpenAPI spec.
282#[derive(Debug, Clone, Default, Serialize, Deserialize)]
283pub struct LocationSubscriptionResponseDto {
284    /// Location ID
285    /// Required by the API.
286    #[serde(rename = "locationId")]
287    pub location_id: String,
288    /// Indicates if the SaaS is V2
289    /// Required by the API.
290    #[serde(rename = "isSaaSV2")]
291    pub is_saa_sv2: bool,
292    /// Company ID
293    /// Required by the API.
294    #[serde(rename = "companyId")]
295    pub company_id: String,
296    /// SaaS mode
297    #[serde(rename = "saasMode", default, skip_serializing_if = "Option::is_none")]
298    pub saas_mode: Option<String>,
299    /// Subscription ID
300    #[serde(
301        rename = "subscriptionId",
302        default,
303        skip_serializing_if = "Option::is_none"
304    )]
305    pub subscription_id: Option<String>,
306    /// Customer ID
307    #[serde(
308        rename = "customerId",
309        default,
310        skip_serializing_if = "Option::is_none"
311    )]
312    pub customer_id: Option<String>,
313    /// Product ID
314    #[serde(rename = "productId", default, skip_serializing_if = "Option::is_none")]
315    pub product_id: Option<String>,
316    /// Price ID
317    #[serde(rename = "priceId", default, skip_serializing_if = "Option::is_none")]
318    pub price_id: Option<String>,
319    /// SaaS plan ID
320    #[serde(
321        rename = "saasPlanId",
322        default,
323        skip_serializing_if = "Option::is_none"
324    )]
325    pub saas_plan_id: Option<String>,
326    /// Subscription status
327    #[serde(
328        rename = "subscriptionStatus",
329        default,
330        skip_serializing_if = "Option::is_none"
331    )]
332    pub subscription_status: Option<String>,
333}
334
335/// `PauseLocationDto` from the GoHighLevel OpenAPI spec.
336#[derive(Debug, Clone, Default, Serialize, Deserialize)]
337pub struct PauseLocationDto {
338    /// Paused
339    /// Required by the API.
340    pub paused: bool,
341    /// Company ID
342    /// Required by the API.
343    #[serde(rename = "companyId")]
344    pub company_id: String,
345}
346
347/// `ResourceNotFoundDTO` from the GoHighLevel OpenAPI spec.
348#[derive(Debug, Clone, Default, Serialize, Deserialize)]
349pub struct ResourceNotFoundDTO {
350    /// Status code
351    #[serde(
352        rename = "statusCode",
353        default,
354        skip_serializing_if = "Option::is_none"
355    )]
356    pub status_code: Option<f64>,
357    /// Error message
358    #[serde(default, skip_serializing_if = "Option::is_none")]
359    pub message: Option<String>,
360}
361
362/// `SaasLocationDto` from the GoHighLevel OpenAPI spec.
363#[derive(Debug, Clone, Default, Serialize, Deserialize)]
364pub struct SaasLocationDto {
365    /// Location ID
366    /// Required by the API.
367    #[serde(rename = "locationId")]
368    pub location_id: String,
369    /// Company ID
370    /// Required by the API.
371    #[serde(rename = "companyId")]
372    pub company_id: String,
373    /// SaaS mode
374    /// Required by the API.
375    #[serde(rename = "saasMode")]
376    pub saas_mode: String,
377    /// Subscription ID
378    /// Required by the API.
379    #[serde(rename = "subscriptionId")]
380    pub subscription_id: String,
381    /// Customer ID
382    #[serde(
383        rename = "customerId",
384        default,
385        skip_serializing_if = "Option::is_none"
386    )]
387    pub customer_id: Option<String>,
388    /// Name
389    #[serde(default, skip_serializing_if = "Option::is_none")]
390    pub name: Option<String>,
391    /// Email
392    #[serde(default, skip_serializing_if = "Option::is_none")]
393    pub email: Option<String>,
394    /// Provider location ID
395    #[serde(
396        rename = "providerLocationId",
397        default,
398        skip_serializing_if = "Option::is_none"
399    )]
400    pub provider_location_id: Option<String>,
401    /// Indicates if the SaaS is V2
402    #[serde(rename = "isSaaSV2", default, skip_serializing_if = "Option::is_none")]
403    pub is_saa_sv2: Option<bool>,
404    /// Subscription information
405    #[serde(
406        rename = "subscriptionInfo",
407        default,
408        skip_serializing_if = "Option::is_none"
409    )]
410    pub subscription_info: Option<serde_json::Value>,
411}
412
413/// `SaasPlanResponseDto` from the GoHighLevel OpenAPI spec.
414#[derive(Debug, Clone, Default, Serialize, Deserialize)]
415pub struct SaasPlanResponseDto {
416    /// Unique identifier for the SaaS plan
417    /// Required by the API.
418    #[serde(rename = "planId")]
419    pub plan_id: String,
420    /// Company ID associated with the SaaS plan
421    /// Required by the API.
422    #[serde(rename = "companyId")]
423    pub company_id: String,
424    /// Title of the SaaS plan
425    /// Required by the API.
426    pub title: String,
427    /// Description of the SaaS plan
428    /// Required by the API.
429    pub description: String,
430    /// Array of SaaS products included in the plan
431    /// Required by the API.
432    #[serde(
433        rename = "saasProducts",
434        default,
435        skip_serializing_if = "Vec::is_empty"
436    )]
437    pub saas_products: Vec<String>,
438    /// Array of add-ons included in the plan
439    #[serde(rename = "addOns", default, skip_serializing_if = "Vec::is_empty")]
440    pub add_ons: Vec<String>,
441    /// Level of the plan (0-4)
442    /// Required by the API.
443    #[serde(rename = "planLevel")]
444    pub plan_level: f64,
445    /// Trial period in days
446    /// Required by the API.
447    #[serde(rename = "trialPeriod")]
448    pub trial_period: f64,
449    /// Setup fee for the plan
450    #[serde(rename = "setupFee", default, skip_serializing_if = "Option::is_none")]
451    pub setup_fee: Option<f64>,
452    /// User limit for the plan
453    #[serde(rename = "userLimit", default, skip_serializing_if = "Option::is_none")]
454    pub user_limit: Option<f64>,
455    /// Contact limit for the plan
456    #[serde(
457        rename = "contactLimit",
458        default,
459        skip_serializing_if = "Option::is_none"
460    )]
461    pub contact_limit: Option<f64>,
462    /// Prices for the plan
463    /// Nested object; raw JSON (see the API docs for its fields).
464    /// Required by the API.
465    #[serde(default, skip_serializing_if = "Vec::is_empty")]
466    pub prices: Vec<serde_json::Value>,
467    /// Category ID for the plan
468    #[serde(
469        rename = "categoryId",
470        default,
471        skip_serializing_if = "Option::is_none"
472    )]
473    pub category_id: Option<String>,
474    /// Snapshot ID for the plan
475    #[serde(
476        rename = "snapshotId",
477        default,
478        skip_serializing_if = "Option::is_none"
479    )]
480    pub snapshot_id: Option<String>,
481    /// Provider location ID
482    #[serde(
483        rename = "providerLocationId",
484        default,
485        skip_serializing_if = "Option::is_none"
486    )]
487    pub provider_location_id: Option<String>,
488    /// Product ID for the plan
489    #[serde(rename = "productId", default, skip_serializing_if = "Option::is_none")]
490    pub product_id: Option<String>,
491    /// Indicates if this is a SaaS V2 plan
492    /// Required by the API.
493    #[serde(rename = "isSaaSV2")]
494    pub is_saa_sv2: bool,
495    /// Creation timestamp
496    /// Format: date-time (ISO-8601 string).
497    /// Required by the API.
498    #[serde(rename = "createdAt")]
499    pub created_at: String,
500    /// Last update timestamp
501    /// Format: date-time (ISO-8601 string).
502    /// Required by the API.
503    #[serde(rename = "updatedAt")]
504    pub updated_at: String,
505}
506
507/// `UnauthorizedDTO` from the GoHighLevel OpenAPI spec.
508#[derive(Debug, Clone, Default, Serialize, Deserialize)]
509pub struct UnauthorizedDTO {
510    /// Status code
511    #[serde(
512        rename = "statusCode",
513        default,
514        skip_serializing_if = "Option::is_none"
515    )]
516    pub status_code: Option<f64>,
517    /// Error message
518    #[serde(default, skip_serializing_if = "Option::is_none")]
519    pub message: Option<String>,
520    /// Error message
521    #[serde(default, skip_serializing_if = "Option::is_none")]
522    pub error: Option<String>,
523}
524
525/// `UpdateRebillingDto` from the GoHighLevel OpenAPI spec.
526#[derive(Debug, Clone, Default, Serialize, Deserialize)]
527pub struct UpdateRebillingDto {
528    /// The product to update rebilling for
529    /// Allowed values: `contentAI`, `workflow_premium_actions`, `workflow_ai`,
530    /// `conversationAI`, `EmailNotification`, `whatsApp`, `reviewsAI`, `VERIFIED_CALLER_ID`,
531    /// `WALLET_SALES_TAX`, `NOTIFICATION_SMS`, `EmailSmtp`, `EmailVerification`.
532    /// Required by the API.
533    pub product: String,
534    /// Array of location IDs to update rebilling for
535    /// Required by the API.
536    #[serde(rename = "locationIds", default, skip_serializing_if = "Vec::is_empty")]
537    pub location_ids: Vec<String>,
538    /// Configuration for rebilling settings
539    /// Nested object; raw JSON (see the API docs for its fields).
540    /// Required by the API.
541    pub config: serde_json::Value,
542}
543
544/// `UpdateRebillingResponseDto` from the GoHighLevel OpenAPI spec.
545#[derive(Debug, Clone, Default, Serialize, Deserialize)]
546pub struct UpdateRebillingResponseDto {
547    /// Indicates if the rebilling update was successful
548    /// Required by the API.
549    pub success: bool,
550}
551
552/// `UpdateSubscriptionDto` from the GoHighLevel OpenAPI spec.
553#[derive(Debug, Clone, Default, Serialize, Deserialize)]
554pub struct UpdateSubscriptionDto {
555    /// Subscription ID
556    /// Required by the API.
557    #[serde(rename = "subscriptionId")]
558    pub subscription_id: String,
559    /// Customer ID
560    /// Required by the API.
561    #[serde(rename = "customerId")]
562    pub customer_id: String,
563    /// Company ID
564    /// Required by the API.
565    #[serde(rename = "companyId")]
566    pub company_id: String,
567}