Skip to main content

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