deriv_api_schema/
document_upload_request.rs

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