1#![allow(
6 missing_docs,
7 clippy::doc_lazy_continuation,
8 clippy::doc_overindented_list_items
9)]
10
11use serde::{Deserialize, Serialize};
12
13#[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#[derive(Debug, Clone, Default, Serialize, Deserialize)]
28pub struct CCRecipientItem {
29 pub email: String,
32 pub id: String,
35 #[serde(rename = "imageUrl")]
38 pub image_url: String,
39 #[serde(rename = "contactName")]
42 pub contact_name: String,
43 #[serde(rename = "firstName")]
46 pub first_name: String,
47 #[serde(rename = "lastName")]
50 pub last_name: String,
51}
52
53#[derive(Debug, Clone, Default, Serialize, Deserialize)]
55pub struct DiscountDto {
56 pub id: String,
59 pub value: f64,
62 #[serde(rename = "type")]
66 pub type_: String,
67}
68
69#[derive(Debug, Clone, Default, Serialize, Deserialize)]
71pub struct DocumentDto {
72 #[serde(rename = "locationId")]
75 pub location_id: String,
76 #[serde(rename = "documentId")]
79 pub document_id: String,
80 #[serde(rename = "_id")]
83 pub id: String,
84 pub name: String,
87 #[serde(rename = "type")]
90 pub type_: String,
91 pub deleted: bool,
94 #[serde(rename = "isExpired")]
97 pub is_expired: bool,
98 #[serde(rename = "documentRevision")]
101 pub document_revision: f64,
102 #[serde(
105 rename = "fillableFields",
106 default,
107 skip_serializing_if = "Vec::is_empty"
108 )]
109 pub fillable_fields: Vec<FillableFieldsDTO>,
110 #[serde(rename = "grandTotal")]
113 pub grand_total: GrandTotalDto,
114 pub locale: String,
117 #[serde(default, skip_serializing_if = "Vec::is_empty")]
121 pub status: Vec<String>,
122 #[serde(
126 rename = "paymentStatus",
127 default,
128 skip_serializing_if = "Vec::is_empty"
129 )]
130 pub payment_status: Vec<String>,
131 #[serde(default, skip_serializing_if = "Vec::is_empty")]
134 pub recipients: Vec<RecipientItem>,
135 #[serde(default, skip_serializing_if = "Vec::is_empty")]
138 pub links: Vec<ProposalEstimateLinksDto>,
139 #[serde(rename = "updatedAt")]
142 pub updated_at: String,
143 #[serde(rename = "createdAt")]
146 pub created_at: String,
147}
148
149#[derive(Debug, Clone, Default, Serialize, Deserialize)]
151pub struct DocumentListResponseDto {
152 #[serde(default, skip_serializing_if = "Vec::is_empty")]
155 pub documents: Vec<DocumentDto>,
156 pub total: f64,
159 #[serde(
161 rename = "whiteLabelBaseUrl",
162 default,
163 skip_serializing_if = "Option::is_none"
164 )]
165 pub white_label_base_url: Option<f64>,
166 #[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
175pub type ELEMENTSLOOKUP = String;
181
182pub type EntityReference = String;
186
187#[derive(Debug, Clone, Default, Serialize, Deserialize)]
189pub struct FillableFieldsDTO {
190 #[serde(rename = "fieldId")]
193 pub field_id: String,
194 #[serde(rename = "isRequired")]
197 pub is_required: bool,
198 #[serde(rename = "hasCompleted")]
201 pub has_completed: bool,
202 pub recipient: String,
205 #[serde(rename = "entityType")]
207 pub entity_type: EntityReference,
208 pub id: String,
211 #[serde(rename = "type")]
213 pub type_: ELEMENTSLOOKUP,
214 pub value: String,
217}
218
219#[derive(Debug, Clone, Default, Serialize, Deserialize)]
221pub struct GrandTotalDto {
222 pub amount: f64,
225 pub currency: String,
228 #[serde(rename = "discountPercentage")]
231 pub discount_percentage: f64,
232 #[serde(default, skip_serializing_if = "Vec::is_empty")]
235 pub discounts: Vec<DiscountDto>,
236}
237
238#[derive(Debug, Clone, Default, Serialize, Deserialize)]
240pub struct NotificationSendSettingDto {
241 #[serde(rename = "templateId")]
243 pub template_id: String,
244 pub subject: String,
246}
247
248#[derive(Debug, Clone, Default, Serialize, Deserialize)]
250pub struct NotificationSenderSettingDto {
251 #[serde(rename = "fromEmail")]
253 pub from_email: String,
254 #[serde(rename = "fromName")]
256 pub from_name: String,
257}
258
259#[derive(Debug, Clone, Default, Serialize, Deserialize)]
261pub struct NotificationSettingsDto {
262 pub receive: NotificationSendSettingDto,
264 pub sender: NotificationSenderSettingDto,
266}
267
268#[derive(Debug, Clone, Default, Serialize, Deserialize)]
270pub struct ProposalEstimateLinksDto {
271 #[serde(rename = "referenceId")]
274 pub reference_id: String,
275 #[serde(rename = "documentId")]
278 pub document_id: String,
279 #[serde(rename = "recipientId")]
282 pub recipient_id: String,
283 #[serde(rename = "entityName")]
287 pub entity_name: String,
288 #[serde(rename = "recipientCategory")]
292 pub recipient_category: String,
293 #[serde(rename = "documentRevision")]
296 pub document_revision: f64,
297 #[serde(rename = "createdBy")]
300 pub created_by: String,
301 pub deleted: bool,
304}
305
306#[derive(Debug, Clone, Default, Serialize, Deserialize)]
308pub struct RecipientItem {
309 pub id: String,
312 #[serde(rename = "firstName", default, skip_serializing_if = "Option::is_none")]
314 pub first_name: Option<String>,
315 #[serde(rename = "lastName", default, skip_serializing_if = "Option::is_none")]
317 pub last_name: Option<String>,
318 pub email: String,
321 #[serde(
323 rename = "phoneNumber",
324 default,
325 skip_serializing_if = "Option::is_none"
326 )]
327 pub phone_number: Option<String>,
328 #[serde(default, skip_serializing_if = "Option::is_none")]
330 pub phone: Option<String>,
331 #[serde(rename = "hasCompleted")]
334 pub has_completed: bool,
335 pub role: String,
339 #[serde(rename = "isPrimary")]
342 pub is_primary: bool,
343 #[serde(rename = "signingOrder")]
346 pub signing_order: f64,
347 #[serde(rename = "imgUrl", default, skip_serializing_if = "Option::is_none")]
349 pub img_url: Option<String>,
350 #[serde(default, skip_serializing_if = "Option::is_none")]
352 pub ip: Option<String>,
353 #[serde(rename = "userAgent", default, skip_serializing_if = "Option::is_none")]
355 pub user_agent: Option<String>,
356 #[serde(
358 rename = "signedDate",
359 default,
360 skip_serializing_if = "Option::is_none"
361 )]
362 pub signed_date: Option<String>,
363 #[serde(
365 rename = "contactName",
366 default,
367 skip_serializing_if = "Option::is_none"
368 )]
369 pub contact_name: Option<String>,
370 #[serde(default, skip_serializing_if = "Option::is_none")]
372 pub country: Option<String>,
373 #[serde(
375 rename = "entityName",
376 default,
377 skip_serializing_if = "Option::is_none"
378 )]
379 pub entity_name: Option<String>,
380 #[serde(
382 rename = "initialsImgUrl",
383 default,
384 skip_serializing_if = "Option::is_none"
385 )]
386 pub initials_img_url: Option<String>,
387 #[serde(
389 rename = "lastViewedAt",
390 default,
391 skip_serializing_if = "Option::is_none"
392 )]
393 pub last_viewed_at: Option<String>,
394 #[serde(rename = "shareLink", default, skip_serializing_if = "Option::is_none")]
396 pub share_link: Option<String>,
397}
398
399#[derive(Debug, Clone, Default, Serialize, Deserialize)]
401pub struct SendDocumentDto {
402 #[serde(rename = "locationId")]
405 pub location_id: String,
406 #[serde(rename = "documentId")]
409 pub document_id: String,
410 #[serde(
412 rename = "documentName",
413 default,
414 skip_serializing_if = "Option::is_none"
415 )]
416 pub document_name: Option<String>,
417 #[serde(default, skip_serializing_if = "Option::is_none")]
420 pub medium: Option<String>,
421 #[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 #[serde(rename = "sentBy")]
437 pub sent_by: String,
438}
439
440#[derive(Debug, Clone, Default, Serialize, Deserialize)]
442pub struct SendDocumentFromPublicApiBodyDto {
443 #[serde(rename = "templateId")]
446 pub template_id: String,
447 #[serde(rename = "userId")]
450 pub user_id: String,
451 #[serde(
453 rename = "sendDocument",
454 default,
455 skip_serializing_if = "Option::is_none"
456 )]
457 pub send_document: Option<bool>,
458 #[serde(rename = "locationId")]
461 pub location_id: String,
462 #[serde(rename = "contactId")]
465 pub contact_id: String,
466 #[serde(
468 rename = "opportunityId",
469 default,
470 skip_serializing_if = "Option::is_none"
471 )]
472 pub opportunity_id: Option<String>,
473}
474
475#[derive(Debug, Clone, Default, Serialize, Deserialize)]
477pub struct SendDocumentResponseDto {
478 pub success: bool,
481 #[serde(default, skip_serializing_if = "Vec::is_empty")]
484 pub links: Vec<ProposalEstimateLinksDto>,
485}
486
487#[derive(Debug, Clone, Default, Serialize, Deserialize)]
489pub struct SendTemplateResponseDto {
490 pub success: bool,
493 #[serde(default, skip_serializing_if = "Vec::is_empty")]
496 pub links: Vec<ProposalEstimateLinksDto>,
497}
498
499#[derive(Debug, Clone, Default, Serialize, Deserialize)]
501pub struct TemplateListPaginationResponseDTO {
502 #[serde(default, skip_serializing_if = "Vec::is_empty")]
505 pub data: Vec<TemplateListResponseDTO>,
506 pub total: f64,
509 #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
511 pub trace_id: Option<String>,
512}
513
514#[derive(Debug, Clone, Default, Serialize, Deserialize)]
516pub struct TemplateListResponseDTO {
517 #[serde(rename = "_id")]
520 pub id: String,
521 pub deleted: bool,
524 pub version: f64,
527 pub name: String,
530 #[serde(rename = "locationId")]
533 pub location_id: String,
534 #[serde(rename = "type")]
538 pub type_: String,
539 #[serde(rename = "updatedBy")]
542 pub updated_by: String,
543 #[serde(rename = "isPublicDocument")]
546 pub is_public_document: bool,
547 #[serde(rename = "createdAt")]
550 pub created_at: String,
551 #[serde(rename = "updatedAt")]
554 pub updated_at: String,
555 #[serde(rename = "id")]
558 pub id_alt: String,
559 #[serde(
561 rename = "documentCount",
562 default,
563 skip_serializing_if = "Option::is_none"
564 )]
565 pub document_count: Option<f64>,
566 #[serde(
568 rename = "docFormUrl",
569 default,
570 skip_serializing_if = "Option::is_none"
571 )]
572 pub doc_form_url: Option<String>,
573}
574
575#[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}