plaid/model/
client_provided_transaction_location.rs

1use serde::{Serialize, Deserialize};
2/**A representation of where a transaction took place.
3
4Use this field to pass in structured location information you may have about your transactions. Providing location data is optional but can increase result quality. If you have unstructured location information, it may be appended to the `description` field.*/
5#[derive(Debug, Clone, Serialize, Deserialize, Default)]
6pub struct ClientProvidedTransactionLocation {
7    ///The street address where the transaction occurred.
8    #[serde(default, skip_serializing_if = "Option::is_none")]
9    pub address: Option<String>,
10    ///The city where the transaction occurred.
11    #[serde(default, skip_serializing_if = "Option::is_none")]
12    pub city: Option<String>,
13    ///The country where the transaction occurred.
14    #[serde(default, skip_serializing_if = "Option::is_none")]
15    pub country: Option<String>,
16    ///The postal code where the transaction occurred.
17    #[serde(default, skip_serializing_if = "Option::is_none")]
18    pub postal_code: Option<String>,
19    ///The region or state where the transaction occurred.
20    #[serde(default, skip_serializing_if = "Option::is_none")]
21    pub region: Option<String>,
22}
23impl std::fmt::Display for ClientProvidedTransactionLocation {
24    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
25        write!(f, "{}", serde_json::to_string(self).unwrap())
26    }
27}