Skip to main content

aptos_client_icp/models/
decoded_table_data.rs

1/*
2 * Aptos Node API
3 *
4 * The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
5 *
6 * The version of the OpenAPI document: 1.2.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// DecodedTableData : Decoded table data
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DecodedTableData {
17    /// Key of table in JSON
18    #[serde(rename = "key", deserialize_with = "Option::deserialize")]
19    pub key: Option<serde_json::Value>,
20    /// Type of key
21    #[serde(rename = "key_type")]
22    pub key_type: String,
23    /// Value of table in JSON
24    #[serde(rename = "value", deserialize_with = "Option::deserialize")]
25    pub value: Option<serde_json::Value>,
26    /// Type of value
27    #[serde(rename = "value_type")]
28    pub value_type: String,
29}
30
31impl DecodedTableData {
32    /// Decoded table data
33    pub fn new(key: Option<serde_json::Value>, key_type: String, value: Option<serde_json::Value>, value_type: String) -> DecodedTableData {
34        DecodedTableData {
35            key,
36            key_type,
37            value,
38            value_type,
39        }
40    }
41}
42