coinbase_mesh/models/
events_blocks_request.rs

1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere. 
5 *
6 * The version of the OpenAPI document: 1.4.13
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// EventsBlocksRequest : EventsBlocksRequest is utilized to fetch a sequence of BlockEvents indicating which blocks were added and removed from storage to reach the current state. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct EventsBlocksRequest {
17    #[serde(rename = "network_identifier")]
18    pub network_identifier: Box<models::NetworkIdentifier>,
19    /// offset is the offset into the event stream to sync events from. If this field is not populated, we return the limit events backwards from tip. If this is set to 0, we start from the beginning. 
20    #[serde(rename = "offset", skip_serializing_if = "Option::is_none")]
21    pub offset: Option<i64>,
22    /// limit is the maximum number of events to fetch in one call. The implementation may return <= limit events. 
23    #[serde(rename = "limit", skip_serializing_if = "Option::is_none")]
24    pub limit: Option<i64>,
25}
26
27impl EventsBlocksRequest {
28    /// EventsBlocksRequest is utilized to fetch a sequence of BlockEvents indicating which blocks were added and removed from storage to reach the current state. 
29    pub fn new(network_identifier: models::NetworkIdentifier) -> EventsBlocksRequest {
30        EventsBlocksRequest {
31            network_identifier: Box::new(network_identifier),
32            offset: None,
33            limit: None,
34        }
35    }
36}
37