aptos_client_icp/models/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/// WriteTableItem : Change set to write a table item
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WriteTableItem {
17 #[serde(rename = "state_key_hash")]
18 pub state_key_hash: String,
19 /// 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.
20 #[serde(rename = "handle")]
21 pub handle: String,
22 /// 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.
23 #[serde(rename = "key")]
24 pub key: String,
25 /// 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.
26 #[serde(rename = "value")]
27 pub value: String,
28 #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
29 pub data: Option<Box<models::DecodedTableData>>,
30}
31
32impl WriteTableItem {
33 /// Change set to write a table item
34 pub fn new(state_key_hash: String, handle: String, key: String, value: String) -> WriteTableItem {
35 WriteTableItem {
36 state_key_hash,
37 handle,
38 key,
39 value,
40 data: None,
41 }
42 }
43}
44