coinbase_mesh/models/sub_network_identifier.rs
1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// SubNetworkIdentifier : In blockchains with sharded state, the SubNetworkIdentifier is required to query some object on a specific shard. This identifier is optional for all non-sharded blockchains.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SubNetworkIdentifier {
17 #[serde(rename = "network")]
18 pub network: String,
19 #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
20 pub metadata: Option<serde_json::Value>,
21}
22
23impl SubNetworkIdentifier {
24 /// In blockchains with sharded state, the SubNetworkIdentifier is required to query some object on a specific shard. This identifier is optional for all non-sharded blockchains.
25 pub fn new(network: String) -> SubNetworkIdentifier {
26 SubNetworkIdentifier {
27 network,
28 metadata: None,
29 }
30 }
31}
32