plaid/model/identity_verification_document_address_response.rs
1use serde::{Serialize, Deserialize};
2/**The address extracted from the document. The address must at least contain the following fields to be a valid address: `street`, `city`, `country`. If any are missing or unable to be extracted, the address will be null.
3
4`region`, and `postal_code` may be null based on the addressing system. For example:
5
6Addresses from the United Kingdom will not include a region
7
8Addresses from Hong Kong will not include postal code
9
10Note: Optical Character Recognition (OCR) technology may sometimes extract incorrect data from a document.*/
11#[derive(Debug, Clone, Serialize, Deserialize, Default)]
12pub struct IdentityVerificationDocumentAddressResponse {
13 ///City extracted from the document.
14 pub city: String,
15 ///Valid, capitalized, two-letter ISO code representing the country extracted from the document. Must be in ISO 3166-1 alpha-2 form.
16 pub country: String,
17 ///The postal code extracted from the document. Between 2 and 10 alphanumeric characters. For US-based addresses this must be 5 numeric digits.
18 #[serde(default, skip_serializing_if = "Option::is_none")]
19 pub postal_code: Option<String>,
20 ///An ISO 3166-2 subdivision code extracted from the document. Related terms would be "state", "province", "prefecture", "zone", "subdivision", etc.
21 #[serde(default, skip_serializing_if = "Option::is_none")]
22 pub region: Option<String>,
23 ///The full street address extracted from the document.
24 pub street: String,
25}
26impl std::fmt::Display for IdentityVerificationDocumentAddressResponse {
27 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
28 write!(f, "{}", serde_json::to_string(self).unwrap())
29 }
30}