plaid/model/
beacon_user.rs

1use serde::{Serialize, Deserialize};
2use super::{BeaconAuditTrail, BeaconUserData, BeaconUserStatus};
3///A Beacon User represents an end user that has been scanned against the Beacon Network.
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct BeaconUser {
6    ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred.
7    pub audit_trail: BeaconAuditTrail,
8    ///A unique ID that identifies the end user in your system. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the `/link/token/create` `client_user_id` to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`.
9    pub client_user_id: String,
10    ///An ISO8601 formatted timestamp.
11    pub created_at: chrono::DateTime<chrono::Utc>,
12    ///ID of the associated Beacon User.
13    pub id: String,
14    ///An array of Plaid Item IDs corresponding to the Accounts associated with this Beacon User.
15    #[serde(default, skip_serializing_if = "Vec::is_empty")]
16    pub item_ids: Vec<String>,
17    ///ID of the associated Beacon Program.
18    pub program_id: String,
19    /**A status of a Beacon User.
20
21`rejected`: The Beacon User has been rejected for fraud. Users can be automatically or manually rejected.
22
23`pending_review`: The Beacon User has been marked for review.
24
25`cleared`: The Beacon User has been cleared of fraud.*/
26    pub status: BeaconUserStatus,
27    ///An ISO8601 formatted timestamp. This field indicates the last time the resource was modified.
28    pub updated_at: chrono::DateTime<chrono::Utc>,
29    ///A Beacon User's data and resulting analysis when checked against duplicate records and the Beacon Fraud Network.
30    pub user: BeaconUserData,
31    ///The `version` field begins with 1 and increments each time the user is updated.
32    pub version: i64,
33}
34impl std::fmt::Display for BeaconUser {
35    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
36        write!(f, "{}", serde_json::to_string(self).unwrap())
37    }
38}