1#![allow(
14 missing_docs,
15 clippy::doc_lazy_continuation,
16 clippy::doc_overindented_list_items
17)]
18
19use serde::{Deserialize, Serialize};
20
21#[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#[derive(Debug, Clone, Default, Serialize, Deserialize)]
36pub struct CCRecipientItem {
37 pub email: String,
40 pub id: String,
43 #[serde(rename = "imageUrl")]
46 pub image_url: String,
47 #[serde(rename = "contactName")]
50 pub contact_name: String,
51 #[serde(rename = "firstName")]
54 pub first_name: String,
55 #[serde(rename = "lastName")]
58 pub last_name: String,
59}
60
61#[derive(Debug, Clone, Default, Serialize, Deserialize)]
63pub struct DiscountDto {
64 pub id: String,
67 pub value: f64,
70 #[serde(rename = "type")]
74 pub type_: String,
75}
76
77#[derive(Debug, Clone, Default, Serialize, Deserialize)]
79pub struct DocumentDto {
80 #[serde(rename = "locationId")]
83 pub location_id: String,
84 #[serde(rename = "documentId")]
87 pub document_id: String,
88 #[serde(rename = "_id")]
91 pub id: String,
92 pub name: String,
95 #[serde(rename = "type")]
98 pub type_: String,
99 pub deleted: bool,
102 #[serde(rename = "isExpired")]
105 pub is_expired: bool,
106 #[serde(rename = "documentRevision")]
109 pub document_revision: f64,
110 #[serde(
113 rename = "fillableFields",
114 default,
115 skip_serializing_if = "Vec::is_empty"
116 )]
117 pub fillable_fields: Vec<FillableFieldsDTO>,
118 #[serde(rename = "grandTotal")]
121 pub grand_total: GrandTotalDto,
122 pub locale: String,
125 #[serde(default, skip_serializing_if = "Vec::is_empty")]
129 pub status: Vec<String>,
130 #[serde(
134 rename = "paymentStatus",
135 default,
136 skip_serializing_if = "Vec::is_empty"
137 )]
138 pub payment_status: Vec<String>,
139 #[serde(default, skip_serializing_if = "Vec::is_empty")]
142 pub recipients: Vec<RecipientItem>,
143 #[serde(default, skip_serializing_if = "Vec::is_empty")]
146 pub links: Vec<ProposalEstimateLinksDto>,
147 #[serde(rename = "updatedAt")]
150 pub updated_at: String,
151 #[serde(rename = "createdAt")]
154 pub created_at: String,
155}
156
157#[derive(Debug, Clone, Default, Serialize, Deserialize)]
159pub struct DocumentListResponseDto {
160 #[serde(default, skip_serializing_if = "Vec::is_empty")]
163 pub documents: Vec<DocumentDto>,
164 pub total: f64,
167 #[serde(
169 rename = "whiteLabelBaseUrl",
170 default,
171 skip_serializing_if = "Option::is_none"
172 )]
173 pub white_label_base_url: Option<f64>,
174 #[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
183pub type ELEMENTSLOOKUP = String;
189
190pub type EntityReference = String;
194
195#[derive(Debug, Clone, Default, Serialize, Deserialize)]
197pub struct FillableFieldsDTO {
198 #[serde(rename = "fieldId")]
201 pub field_id: String,
202 #[serde(rename = "isRequired")]
205 pub is_required: bool,
206 #[serde(rename = "hasCompleted")]
209 pub has_completed: bool,
210 pub recipient: String,
213 #[serde(rename = "entityType")]
215 pub entity_type: EntityReference,
216 pub id: String,
219 #[serde(rename = "type")]
221 pub type_: ELEMENTSLOOKUP,
222 pub value: String,
225}
226
227#[derive(Debug, Clone, Default, Serialize, Deserialize)]
229pub struct GrandTotalDto {
230 pub amount: f64,
233 pub currency: String,
236 #[serde(rename = "discountPercentage")]
239 pub discount_percentage: f64,
240 #[serde(default, skip_serializing_if = "Vec::is_empty")]
243 pub discounts: Vec<DiscountDto>,
244}
245
246#[derive(Debug, Clone, Default, Serialize, Deserialize)]
248pub struct NotificationSendSettingDto {
249 #[serde(rename = "templateId")]
251 pub template_id: String,
252 pub subject: String,
254}
255
256#[derive(Debug, Clone, Default, Serialize, Deserialize)]
258pub struct NotificationSenderSettingDto {
259 #[serde(rename = "fromEmail")]
261 pub from_email: String,
262 #[serde(rename = "fromName")]
264 pub from_name: String,
265}
266
267#[derive(Debug, Clone, Default, Serialize, Deserialize)]
269pub struct NotificationSettingsDto {
270 pub receive: NotificationSendSettingDto,
272 pub sender: NotificationSenderSettingDto,
274}
275
276#[derive(Debug, Clone, Default, Serialize, Deserialize)]
278pub struct ProposalEstimateLinksDto {
279 #[serde(rename = "referenceId")]
282 pub reference_id: String,
283 #[serde(rename = "documentId")]
286 pub document_id: String,
287 #[serde(rename = "recipientId")]
290 pub recipient_id: String,
291 #[serde(rename = "entityName")]
295 pub entity_name: String,
296 #[serde(rename = "recipientCategory")]
300 pub recipient_category: String,
301 #[serde(rename = "documentRevision")]
304 pub document_revision: f64,
305 #[serde(rename = "createdBy")]
308 pub created_by: String,
309 pub deleted: bool,
312}
313
314#[derive(Debug, Clone, Default, Serialize, Deserialize)]
316pub struct RecipientItem {
317 pub id: String,
320 #[serde(rename = "firstName", default, skip_serializing_if = "Option::is_none")]
322 pub first_name: Option<String>,
323 #[serde(rename = "lastName", default, skip_serializing_if = "Option::is_none")]
325 pub last_name: Option<String>,
326 pub email: String,
329 #[serde(
331 rename = "phoneNumber",
332 default,
333 skip_serializing_if = "Option::is_none"
334 )]
335 pub phone_number: Option<String>,
336 #[serde(default, skip_serializing_if = "Option::is_none")]
338 pub phone: Option<String>,
339 #[serde(rename = "hasCompleted")]
342 pub has_completed: bool,
343 pub role: String,
347 #[serde(rename = "isPrimary")]
350 pub is_primary: bool,
351 #[serde(rename = "signingOrder")]
354 pub signing_order: f64,
355 #[serde(rename = "imgUrl", default, skip_serializing_if = "Option::is_none")]
357 pub img_url: Option<String>,
358 #[serde(default, skip_serializing_if = "Option::is_none")]
360 pub ip: Option<String>,
361 #[serde(rename = "userAgent", default, skip_serializing_if = "Option::is_none")]
363 pub user_agent: Option<String>,
364 #[serde(
366 rename = "signedDate",
367 default,
368 skip_serializing_if = "Option::is_none"
369 )]
370 pub signed_date: Option<String>,
371 #[serde(
373 rename = "contactName",
374 default,
375 skip_serializing_if = "Option::is_none"
376 )]
377 pub contact_name: Option<String>,
378 #[serde(default, skip_serializing_if = "Option::is_none")]
380 pub country: Option<String>,
381 #[serde(
383 rename = "entityName",
384 default,
385 skip_serializing_if = "Option::is_none"
386 )]
387 pub entity_name: Option<String>,
388 #[serde(
390 rename = "initialsImgUrl",
391 default,
392 skip_serializing_if = "Option::is_none"
393 )]
394 pub initials_img_url: Option<String>,
395 #[serde(
397 rename = "lastViewedAt",
398 default,
399 skip_serializing_if = "Option::is_none"
400 )]
401 pub last_viewed_at: Option<String>,
402 #[serde(rename = "shareLink", default, skip_serializing_if = "Option::is_none")]
404 pub share_link: Option<String>,
405}
406
407#[derive(Debug, Clone, Default, Serialize, Deserialize)]
409pub struct SendDocumentDto {
410 #[serde(rename = "locationId")]
413 pub location_id: String,
414 #[serde(rename = "documentId")]
417 pub document_id: String,
418 #[serde(
420 rename = "documentName",
421 default,
422 skip_serializing_if = "Option::is_none"
423 )]
424 pub document_name: Option<String>,
425 #[serde(default, skip_serializing_if = "Option::is_none")]
428 pub medium: Option<String>,
429 #[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 #[serde(rename = "sentBy")]
445 pub sent_by: String,
446}
447
448#[derive(Debug, Clone, Default, Serialize, Deserialize)]
450pub struct SendDocumentFromPublicApiBodyDto {
451 #[serde(rename = "templateId")]
454 pub template_id: String,
455 #[serde(rename = "userId")]
458 pub user_id: String,
459 #[serde(
461 rename = "sendDocument",
462 default,
463 skip_serializing_if = "Option::is_none"
464 )]
465 pub send_document: Option<bool>,
466 #[serde(rename = "locationId")]
469 pub location_id: String,
470 #[serde(rename = "contactId")]
473 pub contact_id: String,
474 #[serde(
476 rename = "opportunityId",
477 default,
478 skip_serializing_if = "Option::is_none"
479 )]
480 pub opportunity_id: Option<String>,
481}
482
483#[derive(Debug, Clone, Default, Serialize, Deserialize)]
485pub struct SendDocumentResponseDto {
486 pub success: bool,
489 #[serde(default, skip_serializing_if = "Vec::is_empty")]
492 pub links: Vec<ProposalEstimateLinksDto>,
493}
494
495#[derive(Debug, Clone, Default, Serialize, Deserialize)]
497pub struct SendTemplateResponseDto {
498 pub success: bool,
501 #[serde(default, skip_serializing_if = "Vec::is_empty")]
504 pub links: Vec<ProposalEstimateLinksDto>,
505}
506
507#[derive(Debug, Clone, Default, Serialize, Deserialize)]
509pub struct TemplateListPaginationResponseDTO {
510 #[serde(default, skip_serializing_if = "Vec::is_empty")]
513 pub data: Vec<TemplateListResponseDTO>,
514 pub total: f64,
517 #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
519 pub trace_id: Option<String>,
520}
521
522#[derive(Debug, Clone, Default, Serialize, Deserialize)]
524pub struct TemplateListResponseDTO {
525 #[serde(rename = "_id")]
528 pub id: String,
529 pub deleted: bool,
532 pub version: f64,
535 pub name: String,
538 #[serde(rename = "locationId")]
541 pub location_id: String,
542 #[serde(rename = "type")]
546 pub type_: String,
547 #[serde(rename = "updatedBy")]
550 pub updated_by: String,
551 #[serde(rename = "isPublicDocument")]
554 pub is_public_document: bool,
555 #[serde(rename = "createdAt")]
558 pub created_at: String,
559 #[serde(rename = "updatedAt")]
562 pub updated_at: String,
563 #[serde(rename = "id")]
566 pub id_alt: String,
567 #[serde(
569 rename = "documentCount",
570 default,
571 skip_serializing_if = "Option::is_none"
572 )]
573 pub document_count: Option<f64>,
574 #[serde(
576 rename = "docFormUrl",
577 default,
578 skip_serializing_if = "Option::is_none"
579 )]
580 pub doc_form_url: Option<String>,
581}
582
583#[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}