1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Generated automatically by schema_generator.rs - DO NOT EDIT.
// Source: ./deriv-api-docs/config/v3/document_upload/send.json
// Use direct crate names for imports
use serde::{Deserialize, Serialize};
use serde_json::Value;
// Import required types from the *same* crate
use crate::document_format::DocumentFormat;
use crate::document_type::DocumentType;
use crate::page_type::PageType;
use crate::proof_of_ownership::ProofOfOwnership;
/// Request KYC information from client
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub struct DocumentUploadRequest {
/// Document file format\n
// Correct serde attribute construction - Use helper
pub document_format: DocumentFormat,
/// [Optional] Document ID (required for Passport, Proof of ID and Driver's License)\n
// Correct serde attribute construction - Use helper
#[serde(skip_serializing_if = "Option::is_none")]
pub document_id: Option<String>,
/// 2-letter country code, mandatory for POI only\n
// Correct serde attribute construction - Use helper
#[serde(skip_serializing_if = "Option::is_none")]
pub document_issuing_country: Option<String>,
/// Document type\n
// Correct serde attribute construction - Use helper
pub document_type: DocumentType,
/// Must be `1`\n
// Correct serde attribute construction - Use helper
pub document_upload: i64,
/// The checksum of the file to be uploaded\n
// Correct serde attribute construction - Use helper
pub expected_checksum: String,
/// [Optional] Document expiration date (required for Passport, Proof of ID and Driver's License)\n
// Correct serde attribute construction - Use helper
#[serde(skip_serializing_if = "Option::is_none")]
pub expiration_date: Option<String>,
/// Document size (should be less than 10MB)\n
// Correct serde attribute construction - Use helper
pub file_size: i64,
/// [Optional] Boolean value that indicates whether this document is lifetime valid (only applies to POI document types, cancels out the expiration_date given if any)\n
// Correct serde attribute construction - Use helper
#[serde(skip_serializing_if = "Option::is_none")]
pub lifetime_valid: Option<String>,
/// [Optional] The login id of the user. Mandatory when multiple tokens were provided during authorize.\n
// Correct serde attribute construction - Use helper
#[serde(skip_serializing_if = "Option::is_none")]
pub loginid: Option<String>,
/// [Optional] To determine document side\n
// Correct serde attribute construction - Use helper
#[serde(skip_serializing_if = "Option::is_none")]
pub page_type: Option<PageType>,
/// [Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.\n
// Correct serde attribute construction - Use helper
#[serde(skip_serializing_if = "Option::is_none")]
pub passthrough: Option<Value>,
/// [Optional] It contains info about the proof of ownership being uploaded (mandatory for proof_of_ownership document type)\n
// Correct serde attribute construction - Use helper
#[serde(skip_serializing_if = "Option::is_none")]
pub proof_of_ownership: Option<ProofOfOwnership>,
/// [Optional] Used to map request to response.\n
// Correct serde attribute construction - Use helper
#[serde(skip_serializing_if = "Option::is_none")]
pub req_id: Option<i64>,
}