fireblocks_sdk/models/
notification_with_data.rs

1// Fireblocks API
2//
3// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain.  - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
4//
5// The version of the OpenAPI document: 1.8.0
6// Contact: developers@fireblocks.com
7// Generated by: https://openapi-generator.tech
8
9use {
10    crate::models,
11    serde::{Deserialize, Serialize},
12};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct NotificationWithData {
16    #[serde(rename = "id")]
17    pub id: uuid::Uuid,
18    /// The creation date of the notification
19    #[serde(rename = "createdAt")]
20    pub created_at: String,
21    /// The date when the notification was updated
22    #[serde(rename = "updatedAt")]
23    pub updated_at: String,
24    #[serde(rename = "status")]
25    pub status: models::NotificationStatus,
26    #[serde(rename = "eventType")]
27    pub event_type: models::WebhookEvent,
28    /// The event version which the Notification is listen to
29    #[serde(rename = "eventVersion")]
30    pub event_version: f64,
31    /// The resource id of the event which the Notification is listen to
32    #[serde(
33        rename = "resourceId",
34        default,
35        with = "::serde_with::rust::double_option",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub resource_id: Option<Option<uuid::Uuid>>,
39    /// The attempts related to Notification
40    #[serde(rename = "attempts")]
41    pub attempts: Vec<String>,
42    /// notification data
43    #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
44    pub data: Option<serde_json::Value>,
45}
46
47impl NotificationWithData {
48    pub fn new(
49        id: uuid::Uuid,
50        created_at: String,
51        updated_at: String,
52        status: models::NotificationStatus,
53        event_type: models::WebhookEvent,
54        event_version: f64,
55        attempts: Vec<String>,
56    ) -> NotificationWithData {
57        NotificationWithData {
58            id,
59            created_at,
60            updated_at,
61            status,
62            event_type,
63            event_version,
64            resource_id: None,
65            attempts,
66            data: None,
67        }
68    }
69}