coinbase_mesh/models/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/// NetworkIdentifier : The network_identifier specifies which network a particular object is associated with.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NetworkIdentifier {
17 #[serde(rename = "blockchain")]
18 pub blockchain: String,
19 /// If a blockchain has a specific chain-id or network identifier, it should go in this field. It is up to the client to determine which network-specific identifier is mainnet or testnet.
20 #[serde(rename = "network")]
21 pub network: String,
22 #[serde(rename = "sub_network_identifier", skip_serializing_if = "Option::is_none")]
23 pub sub_network_identifier: Option<Box<models::SubNetworkIdentifier>>,
24}
25
26impl NetworkIdentifier {
27 /// The network_identifier specifies which network a particular object is associated with.
28 pub fn new(blockchain: String, network: String) -> NetworkIdentifier {
29 NetworkIdentifier {
30 blockchain,
31 network,
32 sub_network_identifier: None,
33 }
34 }
35}
36