aptos-client-icp 0.0.1

The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
Documentation
/*
 * 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,
        }
    }
}