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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Aptos Node API
*
* The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
*
* The version of the OpenAPI document: 1.2.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// IndexResponse : The struct holding all data returned to the client by the index endpoint (i.e., GET \"/\"). Only for responding in JSON
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IndexResponse {
/// Chain ID of the current chain
#[serde(rename = "chain_id")]
pub chain_id: i32,
/// A string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
#[serde(rename = "epoch")]
pub epoch: String,
/// A string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
#[serde(rename = "ledger_version")]
pub ledger_version: String,
/// A string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
#[serde(rename = "oldest_ledger_version")]
pub oldest_ledger_version: String,
/// A string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
#[serde(rename = "ledger_timestamp")]
pub ledger_timestamp: String,
#[serde(rename = "node_role")]
pub node_role: models::RoleType,
/// A string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
#[serde(rename = "oldest_block_height")]
pub oldest_block_height: String,
/// A string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
#[serde(rename = "block_height")]
pub block_height: String,
/// Git hash of the build of the API endpoint. Can be used to determine the exact software version used by the API endpoint.
#[serde(rename = "git_hash", skip_serializing_if = "Option::is_none")]
pub git_hash: Option<String>,
}
impl IndexResponse {
/// The struct holding all data returned to the client by the index endpoint (i.e., GET \"/\"). Only for responding in JSON
pub fn new(chain_id: i32, epoch: String, ledger_version: String, oldest_ledger_version: String, ledger_timestamp: String, node_role: models::RoleType, oldest_block_height: String, block_height: String) -> IndexResponse {
IndexResponse {
chain_id,
epoch,
ledger_version,
oldest_ledger_version,
ledger_timestamp,
node_role,
oldest_block_height,
block_height,
git_hash: None,
}
}
}