fireblocks_sdk/models/
network_connection_response.rs1use {
10 crate::models,
11 serde::{Deserialize, Serialize},
12};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct NetworkConnectionResponse {
16 #[serde(rename = "id")]
17 pub id: String,
18 #[serde(rename = "localChannel", skip_serializing_if = "Option::is_none")]
20 pub local_channel: Option<models::NetworkChannel>,
21 #[serde(rename = "remoteChannel", skip_serializing_if = "Option::is_none")]
23 pub remote_channel: Option<models::NetworkChannel>,
24 #[serde(rename = "status")]
25 pub status: models::NetworkConnectionStatus,
26 #[serde(rename = "localNetworkId")]
27 pub local_network_id: models::NetworkId,
28 #[serde(rename = "remoteNetworkId")]
29 pub remote_network_id: models::NetworkId,
30 #[serde(rename = "routingPolicy")]
31 pub routing_policy:
32 std::collections::HashMap<String, models::NetworkConnectionRoutingPolicyValue>,
33}
34
35impl NetworkConnectionResponse {
36 pub fn new(
37 id: String,
38 status: models::NetworkConnectionStatus,
39 local_network_id: models::NetworkId,
40 remote_network_id: models::NetworkId,
41 routing_policy: std::collections::HashMap<
42 String,
43 models::NetworkConnectionRoutingPolicyValue,
44 >,
45 ) -> NetworkConnectionResponse {
46 NetworkConnectionResponse {
47 id,
48 local_channel: None,
49 remote_channel: None,
50 status,
51 local_network_id,
52 remote_network_id,
53 routing_policy,
54 }
55 }
56}