Skip to main content

aptos_client_icp/models/
write_set_change_write_table_item.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WriteSetChangeWriteTableItem {
16    #[serde(rename = "state_key_hash")]
17    pub state_key_hash: String,
18    /// All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte.  Unlike the `Address` type, HexEncodedBytes will not trim any zeros. 
19    #[serde(rename = "handle")]
20    pub handle: String,
21    /// All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte.  Unlike the `Address` type, HexEncodedBytes will not trim any zeros. 
22    #[serde(rename = "key")]
23    pub key: String,
24    /// All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte.  Unlike the `Address` type, HexEncodedBytes will not trim any zeros. 
25    #[serde(rename = "value")]
26    pub value: String,
27    #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
28    pub data: Option<Box<models::DecodedTableData>>,
29    #[serde(rename = "type")]
30    pub r#type: Type,
31}
32
33impl WriteSetChangeWriteTableItem {
34    pub fn new(state_key_hash: String, handle: String, key: String, value: String, r#type: Type) -> WriteSetChangeWriteTableItem {
35        WriteSetChangeWriteTableItem {
36            state_key_hash,
37            handle,
38            key,
39            value,
40            data: None,
41            r#type,
42        }
43    }
44}
45/// 
46#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
47pub enum Type {
48    #[serde(rename = "write_table_item")]
49    WriteTableItem,
50}
51
52impl Default for Type {
53    fn default() -> Type {
54        Self::WriteTableItem
55    }
56}
57