Skip to main content

ghl_models/v2/
saas_api.rs

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