Skip to main content

ghl_models/v2/
proposals.rs

1//! `proposals` data models for GoHighLevel API V2 (21 types).
2//!
3//! Generated from HighLevel's official OpenAPI spec for the
4//! **Proposals** module. Every endpoint that uses these types, with its
5//! parameters, required scopes and enum values, is documented in the
6//! [`proposals` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/proposals.md).
7//!
8//! Enable with `features = ["proposals"]`.
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/// `BadRequestDTO` from the GoHighLevel OpenAPI spec.
22#[derive(Debug, Clone, Default, Serialize, Deserialize)]
23pub struct BadRequestDTO {
24    #[serde(
25        rename = "statusCode",
26        default,
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub status_code: Option<f64>,
30    #[serde(default, skip_serializing_if = "Option::is_none")]
31    pub message: Option<String>,
32}
33
34/// `CCRecipientItem` from the GoHighLevel OpenAPI spec.
35#[derive(Debug, Clone, Default, Serialize, Deserialize)]
36pub struct CCRecipientItem {
37    /// Email
38    /// Required by the API.
39    pub email: String,
40    /// Contact ID
41    /// Required by the API.
42    pub id: String,
43    /// Contact Image URL
44    /// Required by the API.
45    #[serde(rename = "imageUrl")]
46    pub image_url: String,
47    /// Contact Name
48    /// Required by the API.
49    #[serde(rename = "contactName")]
50    pub contact_name: String,
51    /// First Name
52    /// Required by the API.
53    #[serde(rename = "firstName")]
54    pub first_name: String,
55    /// Last Name
56    /// Required by the API.
57    #[serde(rename = "lastName")]
58    pub last_name: String,
59}
60
61/// `DiscountDto` from the GoHighLevel OpenAPI spec.
62#[derive(Debug, Clone, Default, Serialize, Deserialize)]
63pub struct DiscountDto {
64    /// Unique identifier for the discount
65    /// Required by the API.
66    pub id: String,
67    /// Discount value (either a percentage or custom amount)
68    /// Required by the API.
69    pub value: f64,
70    /// Type of discount
71    /// Allowed values: `percentage`, `custom_amount`.
72    /// Required by the API.
73    #[serde(rename = "type")]
74    pub type_: String,
75}
76
77/// `DocumentDto` from the GoHighLevel OpenAPI spec.
78#[derive(Debug, Clone, Default, Serialize, Deserialize)]
79pub struct DocumentDto {
80    /// Location Id
81    /// Required by the API.
82    #[serde(rename = "locationId")]
83    pub location_id: String,
84    /// Document Id
85    /// Required by the API.
86    #[serde(rename = "documentId")]
87    pub document_id: String,
88    /// Unique identifier
89    /// Required by the API.
90    #[serde(rename = "_id")]
91    pub id: String,
92    /// Name of the document
93    /// Required by the API.
94    pub name: String,
95    /// Type of the document
96    /// Required by the API.
97    #[serde(rename = "type")]
98    pub type_: String,
99    /// Whether the document is deleted
100    /// Required by the API.
101    pub deleted: bool,
102    /// Whether the document is expired
103    /// Required by the API.
104    #[serde(rename = "isExpired")]
105    pub is_expired: bool,
106    /// Number of times document is moved to draft state
107    /// Required by the API.
108    #[serde(rename = "documentRevision")]
109    pub document_revision: f64,
110    /// Fillable fields
111    /// Required by the API.
112    #[serde(
113        rename = "fillableFields",
114        default,
115        skip_serializing_if = "Vec::is_empty"
116    )]
117    pub fillable_fields: Vec<FillableFieldsDTO>,
118    /// Grand total object of the document
119    /// Required by the API.
120    #[serde(rename = "grandTotal")]
121    pub grand_total: GrandTotalDto,
122    /// Locale of the location
123    /// Required by the API.
124    pub locale: String,
125    /// Document status
126    /// Allowed values: `draft`, `sent`, `viewed`, `completed`, `accepted`.
127    /// Required by the API.
128    #[serde(default, skip_serializing_if = "Vec::is_empty")]
129    pub status: Vec<String>,
130    /// Payment status
131    /// Allowed values: `waiting_for_payment`, `paid`, `no_payment`.
132    /// Required by the API.
133    #[serde(
134        rename = "paymentStatus",
135        default,
136        skip_serializing_if = "Vec::is_empty"
137    )]
138    pub payment_status: Vec<String>,
139    /// Recipients
140    /// Required by the API.
141    #[serde(default, skip_serializing_if = "Vec::is_empty")]
142    pub recipients: Vec<RecipientItem>,
143    /// Links for the document if its sent
144    /// Required by the API.
145    #[serde(default, skip_serializing_if = "Vec::is_empty")]
146    pub links: Vec<ProposalEstimateLinksDto>,
147    /// Date start from (ISO 8601)
148    /// Required by the API.
149    #[serde(rename = "updatedAt")]
150    pub updated_at: String,
151    /// Date to (ISO 8601)
152    /// Required by the API.
153    #[serde(rename = "createdAt")]
154    pub created_at: String,
155}
156
157/// `DocumentListResponseDto` from the GoHighLevel OpenAPI spec.
158#[derive(Debug, Clone, Default, Serialize, Deserialize)]
159pub struct DocumentListResponseDto {
160    /// List of documents
161    /// Required by the API.
162    #[serde(default, skip_serializing_if = "Vec::is_empty")]
163    pub documents: Vec<DocumentDto>,
164    /// Total records available
165    /// Required by the API.
166    pub total: f64,
167    /// WhiteLabel url for document
168    #[serde(
169        rename = "whiteLabelBaseUrl",
170        default,
171        skip_serializing_if = "Option::is_none"
172    )]
173    pub white_label_base_url: Option<f64>,
174    /// WhiteLabel url for invoice
175    #[serde(
176        rename = "whiteLabelBaseUrlForInvoice",
177        default,
178        skip_serializing_if = "Option::is_none"
179    )]
180    pub white_label_base_url_for_invoice: Option<f64>,
181}
182
183/// Element type
184/// Allowed values: `Page`, `Text`, `Image`, `Video`, `Table`, `ProductList`, `PageBreak`,
185/// `Signature`, `PaymentDetails`, `TextField`, `DateField`, `InitialsField`, `Checkbox`,
186/// `Row`, `Column`.
187/// Kept as `String` so new upstream values don't break deserialization.
188pub type ELEMENTSLOOKUP = String;
189
190/// Entity type
191/// Allowed values: `contacts`, `users`.
192/// Kept as `String` so new upstream values don't break deserialization.
193pub type EntityReference = String;
194
195/// `FillableFieldsDTO` from the GoHighLevel OpenAPI spec.
196#[derive(Debug, Clone, Default, Serialize, Deserialize)]
197pub struct FillableFieldsDTO {
198    /// Field Id
199    /// Required by the API.
200    #[serde(rename = "fieldId")]
201    pub field_id: String,
202    /// Is the field required
203    /// Required by the API.
204    #[serde(rename = "isRequired")]
205    pub is_required: bool,
206    /// Has the field been completed
207    /// Required by the API.
208    #[serde(rename = "hasCompleted")]
209    pub has_completed: bool,
210    /// Recipient
211    /// Required by the API.
212    pub recipient: String,
213    /// Required by the API.
214    #[serde(rename = "entityType")]
215    pub entity_type: EntityReference,
216    /// Id
217    /// Required by the API.
218    pub id: String,
219    /// Required by the API.
220    #[serde(rename = "type")]
221    pub type_: ELEMENTSLOOKUP,
222    /// Value of the field
223    /// Required by the API.
224    pub value: String,
225}
226
227/// `GrandTotalDto` from the GoHighLevel OpenAPI spec.
228#[derive(Debug, Clone, Default, Serialize, Deserialize)]
229pub struct GrandTotalDto {
230    /// Total amount before discounts
231    /// Required by the API.
232    pub amount: f64,
233    /// Currency of the total amount
234    /// Required by the API.
235    pub currency: String,
236    /// Total discount percentage applied
237    /// Required by the API.
238    #[serde(rename = "discountPercentage")]
239    pub discount_percentage: f64,
240    /// List of applied discounts
241    /// Required by the API.
242    #[serde(default, skip_serializing_if = "Vec::is_empty")]
243    pub discounts: Vec<DiscountDto>,
244}
245
246/// `NotificationSendSettingDto` from the GoHighLevel OpenAPI spec.
247#[derive(Debug, Clone, Default, Serialize, Deserialize)]
248pub struct NotificationSendSettingDto {
249    /// Required by the API.
250    #[serde(rename = "templateId")]
251    pub template_id: String,
252    /// Required by the API.
253    pub subject: String,
254}
255
256/// `NotificationSenderSettingDto` from the GoHighLevel OpenAPI spec.
257#[derive(Debug, Clone, Default, Serialize, Deserialize)]
258pub struct NotificationSenderSettingDto {
259    /// Required by the API.
260    #[serde(rename = "fromEmail")]
261    pub from_email: String,
262    /// Required by the API.
263    #[serde(rename = "fromName")]
264    pub from_name: String,
265}
266
267/// `NotificationSettingsDto` from the GoHighLevel OpenAPI spec.
268#[derive(Debug, Clone, Default, Serialize, Deserialize)]
269pub struct NotificationSettingsDto {
270    /// Required by the API.
271    pub receive: NotificationSendSettingDto,
272    /// Required by the API.
273    pub sender: NotificationSenderSettingDto,
274}
275
276/// `ProposalEstimateLinksDto` from the GoHighLevel OpenAPI spec.
277#[derive(Debug, Clone, Default, Serialize, Deserialize)]
278pub struct ProposalEstimateLinksDto {
279    /// Reference ID
280    /// Required by the API.
281    #[serde(rename = "referenceId")]
282    pub reference_id: String,
283    /// Document ID
284    /// Required by the API.
285    #[serde(rename = "documentId")]
286    pub document_id: String,
287    /// Recipient ID
288    /// Required by the API.
289    #[serde(rename = "recipientId")]
290    pub recipient_id: String,
291    /// Entity name that the recipient belongs to
292    /// Allowed values: `contacts`, `users`.
293    /// Required by the API.
294    #[serde(rename = "entityName")]
295    pub entity_name: String,
296    /// Recipient category (recipient, cc, or bcc)
297    /// Allowed values: `recipient`, `cc`, `bcc`.
298    /// Required by the API.
299    #[serde(rename = "recipientCategory")]
300    pub recipient_category: String,
301    /// Document revision number
302    /// Required by the API.
303    #[serde(rename = "documentRevision")]
304    pub document_revision: f64,
305    /// Created by user ID
306    /// Required by the API.
307    #[serde(rename = "createdBy")]
308    pub created_by: String,
309    /// Whether the document is deleted
310    /// Required by the API.
311    pub deleted: bool,
312}
313
314/// `RecipientItem` from the GoHighLevel OpenAPI spec.
315#[derive(Debug, Clone, Default, Serialize, Deserialize)]
316pub struct RecipientItem {
317    /// Recipient Id
318    /// Required by the API.
319    pub id: String,
320    /// Recipient First Name
321    #[serde(rename = "firstName", default, skip_serializing_if = "Option::is_none")]
322    pub first_name: Option<String>,
323    /// Recipient Last Name
324    #[serde(rename = "lastName", default, skip_serializing_if = "Option::is_none")]
325    pub last_name: Option<String>,
326    /// Recipient Email
327    /// Required by the API.
328    pub email: String,
329    /// Recipient Phone Number
330    #[serde(
331        rename = "phoneNumber",
332        default,
333        skip_serializing_if = "Option::is_none"
334    )]
335    pub phone_number: Option<String>,
336    /// Recipient Phone
337    #[serde(default, skip_serializing_if = "Option::is_none")]
338    pub phone: Option<String>,
339    /// Recipient has completed the document
340    /// Required by the API.
341    #[serde(rename = "hasCompleted")]
342    pub has_completed: bool,
343    /// Recipient role
344    /// Allowed values: `user`, `signer`.
345    /// Required by the API.
346    pub role: String,
347    /// Recipient is primary
348    /// Required by the API.
349    #[serde(rename = "isPrimary")]
350    pub is_primary: bool,
351    /// Recipient signing order
352    /// Required by the API.
353    #[serde(rename = "signingOrder")]
354    pub signing_order: f64,
355    /// Recipient image url
356    #[serde(rename = "imgUrl", default, skip_serializing_if = "Option::is_none")]
357    pub img_url: Option<String>,
358    /// Recipient ip
359    #[serde(default, skip_serializing_if = "Option::is_none")]
360    pub ip: Option<String>,
361    /// Recipient user agent
362    #[serde(rename = "userAgent", default, skip_serializing_if = "Option::is_none")]
363    pub user_agent: Option<String>,
364    /// Recipient signed date
365    #[serde(
366        rename = "signedDate",
367        default,
368        skip_serializing_if = "Option::is_none"
369    )]
370    pub signed_date: Option<String>,
371    /// Recipient contact name
372    #[serde(
373        rename = "contactName",
374        default,
375        skip_serializing_if = "Option::is_none"
376    )]
377    pub contact_name: Option<String>,
378    /// Recipient country
379    #[serde(default, skip_serializing_if = "Option::is_none")]
380    pub country: Option<String>,
381    /// Recipient entity name
382    #[serde(
383        rename = "entityName",
384        default,
385        skip_serializing_if = "Option::is_none"
386    )]
387    pub entity_name: Option<String>,
388    /// Recipient initials image url
389    #[serde(
390        rename = "initialsImgUrl",
391        default,
392        skip_serializing_if = "Option::is_none"
393    )]
394    pub initials_img_url: Option<String>,
395    /// Recipient last viewed date
396    #[serde(
397        rename = "lastViewedAt",
398        default,
399        skip_serializing_if = "Option::is_none"
400    )]
401    pub last_viewed_at: Option<String>,
402    /// Share link
403    #[serde(rename = "shareLink", default, skip_serializing_if = "Option::is_none")]
404    pub share_link: Option<String>,
405}
406
407/// `SendDocumentDto` from the GoHighLevel OpenAPI spec.
408#[derive(Debug, Clone, Default, Serialize, Deserialize)]
409pub struct SendDocumentDto {
410    /// Location Id
411    /// Required by the API.
412    #[serde(rename = "locationId")]
413    pub location_id: String,
414    /// Document Id
415    /// Required by the API.
416    #[serde(rename = "documentId")]
417    pub document_id: String,
418    /// Document Name
419    #[serde(
420        rename = "documentName",
421        default,
422        skip_serializing_if = "Option::is_none"
423    )]
424    pub document_name: Option<String>,
425    /// Medium to be used for sending the document
426    /// Allowed values: `link`, `email`.
427    #[serde(default, skip_serializing_if = "Option::is_none")]
428    pub medium: Option<String>,
429    /// CC Recipient
430    #[serde(
431        rename = "ccRecipients",
432        default,
433        skip_serializing_if = "Vec::is_empty"
434    )]
435    pub cc_recipients: Vec<CCRecipientItem>,
436    #[serde(
437        rename = "notificationSettings",
438        default,
439        skip_serializing_if = "Option::is_none"
440    )]
441    pub notification_settings: Option<NotificationSettingsDto>,
442    /// Sent ByUser Id
443    /// Required by the API.
444    #[serde(rename = "sentBy")]
445    pub sent_by: String,
446}
447
448/// `SendDocumentFromPublicApiBodyDto` from the GoHighLevel OpenAPI spec.
449#[derive(Debug, Clone, Default, Serialize, Deserialize)]
450pub struct SendDocumentFromPublicApiBodyDto {
451    /// Template Id
452    /// Required by the API.
453    #[serde(rename = "templateId")]
454    pub template_id: String,
455    /// User Id
456    /// Required by the API.
457    #[serde(rename = "userId")]
458    pub user_id: String,
459    /// Send Document
460    #[serde(
461        rename = "sendDocument",
462        default,
463        skip_serializing_if = "Option::is_none"
464    )]
465    pub send_document: Option<bool>,
466    /// Location Id
467    /// Required by the API.
468    #[serde(rename = "locationId")]
469    pub location_id: String,
470    /// Contact Id
471    /// Required by the API.
472    #[serde(rename = "contactId")]
473    pub contact_id: String,
474    /// Opportunity Id
475    #[serde(
476        rename = "opportunityId",
477        default,
478        skip_serializing_if = "Option::is_none"
479    )]
480    pub opportunity_id: Option<String>,
481}
482
483/// `SendDocumentResponseDto` from the GoHighLevel OpenAPI spec.
484#[derive(Debug, Clone, Default, Serialize, Deserialize)]
485pub struct SendDocumentResponseDto {
486    /// Success status
487    /// Required by the API.
488    pub success: bool,
489    /// Links for all recipients
490    /// Required by the API.
491    #[serde(default, skip_serializing_if = "Vec::is_empty")]
492    pub links: Vec<ProposalEstimateLinksDto>,
493}
494
495/// `SendTemplateResponseDto` from the GoHighLevel OpenAPI spec.
496#[derive(Debug, Clone, Default, Serialize, Deserialize)]
497pub struct SendTemplateResponseDto {
498    /// Success status
499    /// Required by the API.
500    pub success: bool,
501    /// Links for all recipients
502    /// Required by the API.
503    #[serde(default, skip_serializing_if = "Vec::is_empty")]
504    pub links: Vec<ProposalEstimateLinksDto>,
505}
506
507/// `TemplateListPaginationResponseDTO` from the GoHighLevel OpenAPI spec.
508#[derive(Debug, Clone, Default, Serialize, Deserialize)]
509pub struct TemplateListPaginationResponseDTO {
510    /// Array of templates
511    /// Required by the API.
512    #[serde(default, skip_serializing_if = "Vec::is_empty")]
513    pub data: Vec<TemplateListResponseDTO>,
514    /// Total number of templates
515    /// Required by the API.
516    pub total: f64,
517    /// Trace ID for request tracking
518    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
519    pub trace_id: Option<String>,
520}
521
522/// `TemplateListResponseDTO` from the GoHighLevel OpenAPI spec.
523#[derive(Debug, Clone, Default, Serialize, Deserialize)]
524pub struct TemplateListResponseDTO {
525    /// Template ID
526    /// Required by the API.
527    #[serde(rename = "_id")]
528    pub id: String,
529    /// Whether the template is deleted
530    /// Required by the API.
531    pub deleted: bool,
532    /// Template version
533    /// Required by the API.
534    pub version: f64,
535    /// Template name
536    /// Required by the API.
537    pub name: String,
538    /// Location ID
539    /// Required by the API.
540    #[serde(rename = "locationId")]
541    pub location_id: String,
542    /// Template type
543    /// Allowed values: `proposal`, `estimate`, `contentLibrary`.
544    /// Required by the API.
545    #[serde(rename = "type")]
546    pub type_: String,
547    /// User ID who last updated the template
548    /// Required by the API.
549    #[serde(rename = "updatedBy")]
550    pub updated_by: String,
551    /// Whether the template is a public document
552    /// Required by the API.
553    #[serde(rename = "isPublicDocument")]
554    pub is_public_document: bool,
555    /// Template creation date
556    /// Required by the API.
557    #[serde(rename = "createdAt")]
558    pub created_at: String,
559    /// Template last update date
560    /// Required by the API.
561    #[serde(rename = "updatedAt")]
562    pub updated_at: String,
563    /// Template ID (alias for _id)
564    /// Required by the API.
565    #[serde(rename = "id")]
566    pub id_alt: String,
567    /// Document count (only present when isPublicDocument is true)
568    #[serde(
569        rename = "documentCount",
570        default,
571        skip_serializing_if = "Option::is_none"
572    )]
573    pub document_count: Option<f64>,
574    /// Document form URL (only present when isPublicDocument is true)
575    #[serde(
576        rename = "docFormUrl",
577        default,
578        skip_serializing_if = "Option::is_none"
579    )]
580    pub doc_form_url: Option<String>,
581}
582
583/// `UnauthorizedDTO` from the GoHighLevel OpenAPI spec.
584#[derive(Debug, Clone, Default, Serialize, Deserialize)]
585pub struct UnauthorizedDTO {
586    #[serde(
587        rename = "statusCode",
588        default,
589        skip_serializing_if = "Option::is_none"
590    )]
591    pub status_code: Option<f64>,
592    #[serde(default, skip_serializing_if = "Option::is_none")]
593    pub message: Option<String>,
594    #[serde(default, skip_serializing_if = "Option::is_none")]
595    pub error: Option<String>,
596}