aptos_client_icp/models/table_item_request.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/// TableItemRequest : Table Item request for the GetTableItem API
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TableItemRequest {
17 /// String representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` Vector type value examples: - `vector<u8>` - `vector<vector<u64>>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).
18 #[serde(rename = "key_type")]
19 pub key_type: String,
20 /// String representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` Vector type value examples: - `vector<u8>` - `vector<vector<u64>>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).
21 #[serde(rename = "value_type")]
22 pub value_type: String,
23 /// The value of the table item's key
24 #[serde(rename = "key", deserialize_with = "Option::deserialize")]
25 pub key: Option<serde_json::Value>,
26}
27
28impl TableItemRequest {
29 /// Table Item request for the GetTableItem API
30 pub fn new(key_type: String, value_type: String, key: Option<serde_json::Value>) -> TableItemRequest {
31 TableItemRequest {
32 key_type,
33 value_type,
34 key,
35 }
36 }
37}
38