1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Rosetta
 *
 * Build Once. Integrate Your Blockchain Everywhere.
 *
 * The version of the OpenAPI document: 1.4.13
 *
 * Generated by: https://openapi-generator.tech
 */

/// BlockEvent : BlockEvent represents the addition or removal of a BlockIdentifier from storage. Streaming BlockEvents allows lightweight clients to update their own state without needing to implement their own syncing logic.

#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
pub struct BlockEvent {
    /// sequence is the unique identifier of a BlockEvent within the context of a NetworkIdentifier.
    #[serde(rename = "sequence")]
    pub sequence: i64,
    #[serde(rename = "block_identifier")]
    pub block_identifier: crate::BlockIdentifier,
    #[serde(rename = "type")]
    pub r#type: crate::BlockEventType,
}

impl BlockEvent {
    /// BlockEvent represents the addition or removal of a BlockIdentifier from storage. Streaming BlockEvents allows lightweight clients to update their own state without needing to implement their own syncing logic.
    pub fn new(
        sequence: i64,
        block_identifier: crate::BlockIdentifier,
        r#type: crate::BlockEventType,
    ) -> BlockEvent {
        BlockEvent {
            sequence,
            block_identifier,
            r#type,
        }
    }
}