plaid/model/
investments_default_update_webhook.rs

1use serde::{Serialize, Deserialize};
2use super::{PlaidError, WebhookEnvironmentValues};
3///Fired when new transactions have been detected on an investment account.
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct InvestmentsDefaultUpdateWebhook {
6    ///The number of canceled transactions reported since the last time this webhook was fired.
7    pub canceled_investments_transactions: f64,
8    ///The Plaid environment the webhook was sent from
9    pub environment: WebhookEnvironmentValues,
10    ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead.
11    #[serde(default, skip_serializing_if = "Option::is_none")]
12    pub error: Option<PlaidError>,
13    ///The `item_id` of the Item associated with this webhook, warning, or error
14    pub item_id: String,
15    ///The number of new transactions reported since the last time this webhook was fired.
16    pub new_investments_transactions: f64,
17    ///`DEFAULT_UPDATE`
18    pub webhook_code: String,
19    ///`INVESTMENTS_TRANSACTIONS`
20    pub webhook_type: String,
21}
22impl std::fmt::Display for InvestmentsDefaultUpdateWebhook {
23    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
24        write!(f, "{}", serde_json::to_string(self).unwrap())
25    }
26}