Skip to main content

blockfrost_openapi/models/
snapshot_download_message.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4/// SnapshotDownloadMessage : SnapshotDownloadMessage represents a downloaded snapshot event
5#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
6pub struct SnapshotDownloadMessage {
7    /// Digest that is signed by the signer participants
8    #[serde(rename = "digest")]
9    pub digest: String,
10    #[serde(rename = "beacon")]
11    pub beacon: models::CardanoDbBeacon,
12    /// Size of the snapshot file in Bytes
13    #[serde(rename = "size")]
14    pub size: i64,
15    /// Locations where the binary content of the snapshot can be retrieved
16    #[serde(rename = "locations")]
17    pub locations: Vec<String>,
18    /// Compression algorithm for the snapshot archive
19    #[serde(rename = "compression_algorithm")]
20    pub compression_algorithm: String,
21    /// Version of the Cardano node which is used to create snapshot archives.
22    #[serde(rename = "cardano_node_version")]
23    pub cardano_node_version: String,
24}
25
26impl SnapshotDownloadMessage {
27    /// SnapshotDownloadMessage represents a downloaded snapshot event
28    pub fn new(digest: String, beacon: models::CardanoDbBeacon, size: i64, locations: Vec<String>, compression_algorithm: String, cardano_node_version: String) -> SnapshotDownloadMessage {
29        SnapshotDownloadMessage {
30            digest,
31            beacon,
32            size,
33            locations,
34            compression_algorithm,
35            cardano_node_version,
36        }
37    }
38}
39