fireblocks_sdk/apis/fireblocks_network_api.rs
1// Fireblocks API
2//
3// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
4//
5// The version of the OpenAPI document: 1.8.0
6// Contact: developers@fireblocks.com
7// Generated by: https://openapi-generator.tech
8
9use {
10 super::{Error, configuration},
11 crate::{
12 apis::{ContentType, ResponseContent},
13 models,
14 },
15 async_trait::async_trait,
16 reqwest,
17 serde::{Deserialize, Serialize, de::Error as _},
18 std::sync::Arc,
19};
20
21#[async_trait]
22pub trait FireblocksNetworkApi: Send + Sync {
23 /// GET /network_connections/{connectionId}/is_third_party_routing/
24 /// {assetType}
25 ///
26 /// The Fireblocks Network allows for flexibility around incoming deposits.
27 /// A receiver can receive network deposits to locations other than
28 /// Fireblocks. This endpoint validates whether future transactions are
29 /// routed to the displayed recipient or to a 3rd party. </br>Endpoint
30 /// Permission: Admin, Non-Signing Admin.
31 async fn check_third_party_routing(
32 &self,
33 params: CheckThirdPartyRoutingParams,
34 ) -> Result<models::ThirdPartyRouting, Error<CheckThirdPartyRoutingError>>;
35
36 /// POST /network_connections
37 ///
38 /// Initiates a new network connection. **Note:** This API call is subject to Flexible Routing Schemes. Your routing policy defines how your transactions are routed. You can choose 1 of the 3 different schemes mentioned below for each asset type: - **None**; Defines the profile routing to no destination for that asset type. Incoming transactions to asset types routed to `None` will fail. - **Custom**; Route to an account that you choose. If you remove the account, incoming transactions will fail until you choose another one. - **Default**; Use the routing specified by the network profile the connection is connected to. This scheme is also referred to as \"Profile Routing\" Default Workspace Presets: - Network Profile Crypto → **Custom** - Network Profile FIAT → **None** - Network Connection Crypto → **Default** - Network Connection FIAT → **Default** Supported asset groups for routing policy can be found at `/network_ids/routing_policy_asset_groups` **Note**: By default, Custom routing scheme uses (`dstId` = `0`, `dstType` = `VAULT`). Learn more about Fireblocks Network in the following [guide](https://developers.fireblocks.com/docs/connect-to-the-fireblocks-network). </br>Endpoint Permission: Admin, Non-Signing Admin.
39 async fn create_network_connection(
40 &self,
41 params: CreateNetworkConnectionParams,
42 ) -> Result<models::NetworkConnectionResponse, Error<CreateNetworkConnectionError>>;
43
44 /// POST /network_ids
45 ///
46 /// Creates a new Network ID. **Note:** This API call is subject to
47 /// Flexible Routing Schemes. Your routing policy defines how your
48 /// transactions are routed. You can choose 1 of the 3 different schemes
49 /// mentioned below for each asset type: - **None**; Defines the profile
50 /// routing to no destination for that asset type. Incoming transactions to
51 /// asset types routed to `None` will fail. - **Custom**; Route to an
52 /// account that you choose. If you remove the account, incoming
53 /// transactions will fail until you choose another one. - **Default**;
54 /// Use the routing specified by the network profile the connection is
55 /// connected to. This scheme is also referred to as \"Profile Routing\"
56 /// Default Workspace Presets: - Network Profile Crypto → **Custom** -
57 /// Network Profile FIAT → **None** - Network Connection Crypto →
58 /// **Default** - Network Connection FIAT → **Default** Supported asset
59 /// groups for routing policy can be found at
60 /// `/network_ids/routing_policy_asset_groups` **Note**: By default, Custom
61 /// routing scheme uses (`dstId` = `0`, `dstType` = `VAULT`). </br>Endpoint
62 /// Permission: Admin, Non-Signing Admin.
63 async fn create_network_id(
64 &self,
65 params: CreateNetworkIdParams,
66 ) -> Result<models::NetworkIdResponse, Error<CreateNetworkIdError>>;
67
68 /// DELETE /network_connections/{connectionId}
69 ///
70 /// Deletes an existing network connection specified by its connection ID.
71 /// **Note:** This API call is subject to Flexible Routing Schemes. Your
72 /// routing policy defines how your transactions are routed. You can choose
73 /// 1 of the 3 different schemes mentioned below for each asset type: -
74 /// **None**; Defines the profile routing to no destination for that asset
75 /// type. Incoming transactions to asset types routed to `None` will fail.
76 /// - **Custom**; Route to an account that you choose. If you remove the
77 /// account, incoming transactions will fail until you choose another one.
78 /// - **Default**; Use the routing specified by the network profile the
79 /// connection is connected to. This scheme is also referred to as \"Profile
80 /// Routing\" Default Workspace Presets: - Network Profile Crypto →
81 /// **Custom** - Network Profile FIAT → **None** - Network Connection
82 /// Crypto → **Default** - Network Connection FIAT → **Default**
83 /// **Note**: By default, Custom routing scheme uses (`dstId` = `0`,
84 /// `dstType` = `VAULT`). </br>Endpoint Permission: Admin, Non-Signing
85 /// Admin.
86 async fn delete_network_connection(
87 &self,
88 params: DeleteNetworkConnectionParams,
89 ) -> Result<models::DeleteNetworkConnectionResponse, Error<DeleteNetworkConnectionError>>;
90
91 /// DELETE /network_ids/{networkId}
92 ///
93 /// Deletes a network by its ID. **Note:** This API call is subject to
94 /// Flexible Routing Schemes. Your routing policy defines how your
95 /// transactions are routed. You can choose 1 of the 3 different schemes
96 /// mentioned below for each asset type: - **None**; Defines the profile
97 /// routing to no destination for that asset type. Incoming transactions to
98 /// asset types routed to `None` will fail. - **Custom**; Route to an
99 /// account that you choose. If you remove the account, incoming
100 /// transactions will fail until you choose another one. - **Default**;
101 /// Use the routing specified by the network profile the connection is
102 /// connected to. This scheme is also referred to as \"Profile Routing\"
103 /// Default Workspace Presets: - Network Profile Crypto → **Custom** -
104 /// Network Profile FIAT → **None** - Network Connection Crypto →
105 /// **Default** - Network Connection FIAT → **Default** **Note**: By
106 /// default, Custom routing scheme uses (`dstId` = `0`, `dstType` =
107 /// `VAULT`). </br>Endpoint Permission: Admin, Non-Signing Admin.
108 async fn delete_network_id(
109 &self,
110 params: DeleteNetworkIdParams,
111 ) -> Result<models::DeleteNetworkIdResponse, Error<DeleteNetworkIdError>>;
112
113 /// GET /network_connections/{connectionId}
114 ///
115 /// Gets a network connection by ID. **Note:** This API call is subject to
116 /// Flexible Routing Schemes. Your routing policy defines how your
117 /// transactions are routed. You can choose 1 of the 3 different schemes
118 /// mentioned below for each asset type: - **None**; Defines the profile
119 /// routing to no destination for that asset type. Incoming transactions to
120 /// asset types routed to `None` will fail. - **Custom**; Route to an
121 /// account that you choose. If you remove the account, incoming
122 /// transactions will fail until you choose another one. - **Default**;
123 /// Use the routing specified by the network profile the connection is
124 /// connected to. This scheme is also referred to as \"Profile Routing\"
125 /// Default Workspace Presets: - Network Profile Crypto → **Custom** -
126 /// Network Profile FIAT → **None** - Network Connection Crypto →
127 /// **Default** - Network Connection FIAT → **Default** **Note**: By
128 /// default, Custom routing scheme uses (`dstId` = `0`, `dstType` =
129 /// `VAULT`). </br>Endpoint Permission: Admin, Non-Signing Admin.
130 async fn get_network(
131 &self,
132 params: GetNetworkParams,
133 ) -> Result<models::NetworkConnectionResponse, Error<GetNetworkError>>;
134
135 /// GET /network_connections
136 ///
137 /// Returns all network connections. **Note:** This API call is subject to
138 /// Flexible Routing Schemes. Your routing policy defines how your
139 /// transactions are routed. You can choose 1 of the 3 different schemes
140 /// mentioned below for each asset type: - **None**; Defines the profile
141 /// routing to no destination for that asset type. Incoming transactions to
142 /// asset types routed to `None` will fail. - **Custom**; Route to an
143 /// account that you choose. If you remove the account, incoming
144 /// transactions will fail until you choose another one. - **Default**;
145 /// Use the routing specified by the network profile the connection is
146 /// connected to. This scheme is also referred to as \"Profile Routing\"
147 /// Default Workspace Presets: - Network Profile Crypto → **Custom** -
148 /// Network Profile FIAT → **None** - Network Connection Crypto →
149 /// **Default** - Network Connection FIAT → **Default** - **Note**:
150 /// By default, Custom routing scheme uses (`dstId` = `0`, `dstType` =
151 /// `VAULT`). </br>Endpoint Permission: Admin, Non-Signing Admin.
152 async fn get_network_connections(
153 &self,
154 ) -> Result<Vec<models::NetworkConnectionResponse>, Error<GetNetworkConnectionsError>>;
155
156 /// GET /network_ids/{networkId}
157 ///
158 /// Retrieves a network by its ID. **Note:** This API call is subject to
159 /// Flexible Routing Schemes. Your routing policy defines how your
160 /// transactions are routed. You can choose 1 of the 3 different schemes
161 /// mentioned below for each asset type: - **None**; Defines the profile
162 /// routing to no destination for that asset type. Incoming transactions to
163 /// asset types routed to `None` will fail. - **Custom**; Route to an
164 /// account that you choose. If you remove the account, incoming
165 /// transactions will fail until you choose another one. - **Default**;
166 /// Use the routing specified by the network profile the connection is
167 /// connected to. This scheme is also referred to as \"Profile Routing\"
168 /// Default Workspace Presets: - Network Profile Crypto → **Custom** -
169 /// Network Profile FIAT → **None** - Network Connection Crypto →
170 /// **Default** - Network Connection FIAT → **Default** **Note**: By
171 /// default, Custom routing scheme uses (`dstId` = `0`, `dstType` =
172 /// `VAULT`). </br>Endpoint Permission: Admin, Non-Signing Admin.
173 async fn get_network_id(
174 &self,
175 params: GetNetworkIdParams,
176 ) -> Result<models::NetworkIdResponse, Error<GetNetworkIdError>>;
177
178 /// GET /network_ids
179 ///
180 /// Retrieves a list of all local and discoverable remote network IDs.
181 /// **Note:** This API call is subject to Flexible Routing Schemes. Your
182 /// routing policy defines how your transactions are routed. You can choose
183 /// 1 of the 3 different schemes mentioned below for each asset type: -
184 /// **None**; Defines the profile routing to no destination for that asset
185 /// type. Incoming transactions to asset types routed to `None` will fail.
186 /// - **Custom**; Route to an account that you choose. If you remove the
187 /// account, incoming transactions will fail until you choose another one.
188 /// - **Default**; Use the routing specified by the network profile the
189 /// connection is connected to. This scheme is also referred to as \"Profile
190 /// Routing\" Default Workspace Presets: - Network Profile Crypto →
191 /// **Custom** - Network Profile FIAT → **None** - Network Connection
192 /// Crypto → **Default** - Network Connection FIAT → **Default**
193 /// **Note**: By default, Custom routing scheme uses (`dstId` = `0`,
194 /// `dstType` = `VAULT`). </br>Endpoint Permission: Admin, Non-Signing
195 /// Admin.
196 async fn get_network_ids(
197 &self,
198 ) -> Result<Vec<models::NetworkIdResponse>, Error<GetNetworkIdsError>>;
199
200 /// GET /network_ids/routing_policy_asset_groups
201 ///
202 /// Retrieves a list of all enabled routing policy asset groups. Your
203 /// routing policy defines how your transactions are routed. You can use one
204 /// or more enabled routing policy asset groups to describe connection or
205 /// network id routing policy. </br>Endpoint Permission: Admin, Non-Signing
206 /// Admin.
207 async fn get_routing_policy_asset_groups(
208 &self,
209 ) -> Result<Vec<String>, Error<GetRoutingPolicyAssetGroupsError>>;
210
211 /// GET /network_ids/search
212 ///
213 /// Retrieves a list of all local and discoverable remote network IDs. Can
214 /// be filtered. **Note:** This API call is subject to Flexible Routing
215 /// Schemes. Your routing policy defines how your transactions are routed.
216 /// You can choose 1 of the 3 different schemes mentioned below for each
217 /// asset type: - **None**; Defines the profile routing to no destination
218 /// for that asset type. Incoming transactions to asset types routed to
219 /// `None` will fail. - **Custom**; Route to an account that you choose.
220 /// If you remove the account, incoming transactions will fail until you
221 /// choose another one. - **Default**; Use the routing specified by the
222 /// network profile the connection is connected to. This scheme is also
223 /// referred to as \"Profile Routing\" Default Workspace Presets: -
224 /// Network Profile Crypto → **Custom** - Network Profile FIAT → **None**
225 /// - Network Connection Crypto → **Default** - Network Connection FIAT →
226 /// **Default** - **Note**: By default, Custom routing scheme uses
227 /// (`dstId` = `0`, `dstType` = `VAULT`).
228 async fn search_network_ids(
229 &self,
230 params: SearchNetworkIdsParams,
231 ) -> Result<models::SearchNetworkIdsResponse, Error<SearchNetworkIdsError>>;
232
233 /// PATCH /network_ids/{networkId}/set_discoverability
234 ///
235 /// Update whether or not the network ID is discoverable by others.
236 /// **Note:** This API call is subject to Flexible Routing Schemes. Your
237 /// routing policy defines how your transactions are routed. You can choose
238 /// 1 of the 3 different schemes mentioned below for each asset type: -
239 /// **None**; Defines the profile routing to no destination for that asset
240 /// type. Incoming transactions to asset types routed to `None` will fail.
241 /// - **Custom**; Route to an account that you choose. If you remove the
242 /// account, incoming transactions will fail until you choose another one.
243 /// - **Default**; Use the routing specified by the network profile the
244 /// connection is connected to. This scheme is also referred to as \"Profile
245 /// Routing\" Default Workspace Presets: - Network Profile Crypto →
246 /// **Custom** - Network Profile FIAT → **None** - Network Connection
247 /// Crypto → **Default** - Network Connection FIAT → **Default**
248 /// **Note**: By default, Custom routing scheme uses (`dstId` = `0`,
249 /// `dstType` = `VAULT`). </br>Endpoint Permission: Admin, Non-Signing
250 /// Admin.
251 async fn set_network_id_discoverability(
252 &self,
253 params: SetNetworkIdDiscoverabilityParams,
254 ) -> Result<models::SetNetworkIdResponse, Error<SetNetworkIdDiscoverabilityError>>;
255
256 /// PATCH /network_ids/{networkId}/set_name
257 ///
258 /// Updates name of a specified network ID. **Note:** This API call is
259 /// subject to Flexible Routing Schemes. Your routing policy defines how
260 /// your transactions are routed. You can choose 1 of the 3 different
261 /// schemes mentioned below for each asset type: - **None**; Defines the
262 /// profile routing to no destination for that asset type. Incoming
263 /// transactions to asset types routed to `None` will fail. - **Custom**;
264 /// Route to an account that you choose. If you remove the account, incoming
265 /// transactions will fail until you choose another one. - **Default**;
266 /// Use the routing specified by the network profile the connection is
267 /// connected to. This scheme is also referred to as \"Profile Routing\"
268 /// Default Workspace Presets: - Network Profile Crypto → **Custom** -
269 /// Network Profile FIAT → **None** - Network Connection Crypto →
270 /// **Default** - Network Connection FIAT → **Default** **Note**: By
271 /// default, Custom routing scheme uses (`dstId` = `0`, `dstType` =
272 /// `VAULT`). </br>Endpoint Permission: Admin, Non-Signing Admin.
273 async fn set_network_id_name(
274 &self,
275 params: SetNetworkIdNameParams,
276 ) -> Result<models::SetNetworkIdResponse, Error<SetNetworkIdNameError>>;
277
278 /// PATCH /network_ids/{networkId}/set_routing_policy
279 ///
280 /// Updates the routing policy of a specified network ID. **Note:** This
281 /// API call is subject to Flexible Routing Schemes. Your routing policy
282 /// defines how your transactions are routed. You can choose 1 of the 3
283 /// different schemes mentioned below for each asset type: - **None**;
284 /// Defines the profile routing to no destination for that asset type.
285 /// Incoming transactions to asset types routed to `None` will fail. -
286 /// **Custom**; Route to an account that you choose. If you remove the
287 /// account, incoming transactions will fail until you choose another one.
288 /// - **Default**; Use the routing specified by the network profile the
289 /// connection is connected to. This scheme is also referred to as \"Profile
290 /// Routing\" Default Workspace Presets: - Network Profile Crypto →
291 /// **Custom** - Network Profile FIAT → **None** - Network Connection
292 /// Crypto → **Default** - Network Connection FIAT → **Default**
293 /// Supported asset groups for routing policy can be found at
294 /// `/network_ids/routing_policy_asset_groups` **Note**: By default, Custom
295 /// routing scheme uses (`dstId` = `0`, `dstType` = `VAULT`). </br>Endpoint
296 /// Permission: Admin, Non-Signing Admin.
297 async fn set_network_id_routing_policy(
298 &self,
299 params: SetNetworkIdRoutingPolicyParams,
300 ) -> Result<models::SetNetworkIdResponse, Error<SetNetworkIdRoutingPolicyError>>;
301
302 /// PATCH /network_connections/{connectionId}/set_routing_policy
303 ///
304 /// Updates an existing network connection's routing policy. **Note:** This
305 /// API call is subject to Flexible Routing Schemes. Your routing policy
306 /// defines how your transactions are routed. You can choose 1 of the 3
307 /// different schemes mentioned below for each asset type: - **None**;
308 /// Defines the profile routing to no destination for that asset type.
309 /// Incoming transactions to asset types routed to `None` will fail. -
310 /// **Custom**; Route to an account that you choose. If you remove the
311 /// account, incoming transactions will fail until you choose another one.
312 /// - **Default**; Use the routing specified by the network profile the
313 /// connection is connected to. This scheme is also referred to as \"Profile
314 /// Routing\" Default Workspace Presets: - Network Profile Crypto →
315 /// **Custom** - Network Profile FIAT → **None** - Network Connection
316 /// Crypto → **Default** - Network Connection FIAT → **Default**
317 /// Supported asset groups for routing policy can be found at
318 /// `/network_ids/routing_policy_asset_groups` **Note**: By default, Custom
319 /// routing scheme uses (`dstId` = `0`, `dstType` = `VAULT`). </br>Endpoint
320 /// Permission: Admin, Non-Signing Admin.
321 async fn set_routing_policy(
322 &self,
323 params: SetRoutingPolicyParams,
324 ) -> Result<models::SetRoutingPolicyResponse, Error<SetRoutingPolicyError>>;
325}
326
327pub struct FireblocksNetworkApiClient {
328 configuration: Arc<configuration::Configuration>,
329}
330
331impl FireblocksNetworkApiClient {
332 pub fn new(configuration: Arc<configuration::Configuration>) -> Self {
333 Self { configuration }
334 }
335}
336
337/// struct for passing parameters to the method
338/// [`FireblocksNetworkApi::check_third_party_routing`]
339#[derive(Clone, Debug)]
340#[cfg_attr(feature = "bon", derive(::bon::Builder))]
341pub struct CheckThirdPartyRoutingParams {
342 /// The ID of the network connection
343 pub connection_id: String,
344 /// The destination asset type
345 pub asset_type: String,
346}
347
348/// struct for passing parameters to the method
349/// [`FireblocksNetworkApi::create_network_connection`]
350#[derive(Clone, Debug)]
351#[cfg_attr(feature = "bon", derive(::bon::Builder))]
352pub struct CreateNetworkConnectionParams {
353 /// A unique identifier for the request. If the request is sent multiple
354 /// times with the same idempotency key, the server will return the same
355 /// response as the first request. The idempotency key is valid for 24
356 /// hours.
357 pub idempotency_key: Option<String>,
358 pub network_connection: Option<models::NetworkConnection>,
359}
360
361/// struct for passing parameters to the method
362/// [`FireblocksNetworkApi::create_network_id`]
363#[derive(Clone, Debug)]
364#[cfg_attr(feature = "bon", derive(::bon::Builder))]
365pub struct CreateNetworkIdParams {
366 /// A unique identifier for the request. If the request is sent multiple
367 /// times with the same idempotency key, the server will return the same
368 /// response as the first request. The idempotency key is valid for 24
369 /// hours.
370 pub idempotency_key: Option<String>,
371 pub create_network_id_request: Option<models::CreateNetworkIdRequest>,
372}
373
374/// struct for passing parameters to the method
375/// [`FireblocksNetworkApi::delete_network_connection`]
376#[derive(Clone, Debug)]
377#[cfg_attr(feature = "bon", derive(::bon::Builder))]
378pub struct DeleteNetworkConnectionParams {
379 /// The ID of the network connection to delete
380 pub connection_id: String,
381}
382
383/// struct for passing parameters to the method
384/// [`FireblocksNetworkApi::delete_network_id`]
385#[derive(Clone, Debug)]
386#[cfg_attr(feature = "bon", derive(::bon::Builder))]
387pub struct DeleteNetworkIdParams {
388 /// The ID of the network
389 pub network_id: String,
390}
391
392/// struct for passing parameters to the method
393/// [`FireblocksNetworkApi::get_network`]
394#[derive(Clone, Debug)]
395#[cfg_attr(feature = "bon", derive(::bon::Builder))]
396pub struct GetNetworkParams {
397 /// The ID of the connection
398 pub connection_id: String,
399}
400
401/// struct for passing parameters to the method
402/// [`FireblocksNetworkApi::get_network_id`]
403#[derive(Clone, Debug)]
404#[cfg_attr(feature = "bon", derive(::bon::Builder))]
405pub struct GetNetworkIdParams {
406 /// The ID of the network
407 pub network_id: String,
408}
409
410/// struct for passing parameters to the method
411/// [`FireblocksNetworkApi::search_network_ids`]
412#[derive(Clone, Debug)]
413#[cfg_attr(feature = "bon", derive(::bon::Builder))]
414pub struct SearchNetworkIdsParams {
415 /// Search string - displayName networkId. Optional
416 pub search: Option<String>,
417 /// Exclude your networkIds. Optional, default false
418 pub exclude_self: Option<bool>,
419 /// Exclude connected networkIds. Optional, default false
420 pub exclude_connected: Option<bool>,
421 /// ID of the record after which to fetch $limit records
422 pub page_cursor: Option<String>,
423 /// Number of records to fetch. By default, it is 50
424 pub page_size: Option<f64>,
425}
426
427/// struct for passing parameters to the method
428/// [`FireblocksNetworkApi::set_network_id_discoverability`]
429#[derive(Clone, Debug)]
430#[cfg_attr(feature = "bon", derive(::bon::Builder))]
431pub struct SetNetworkIdDiscoverabilityParams {
432 /// The ID of the network
433 pub network_id: String,
434 pub set_network_id_discoverability_request: models::SetNetworkIdDiscoverabilityRequest,
435}
436
437/// struct for passing parameters to the method
438/// [`FireblocksNetworkApi::set_network_id_name`]
439#[derive(Clone, Debug)]
440#[cfg_attr(feature = "bon", derive(::bon::Builder))]
441pub struct SetNetworkIdNameParams {
442 /// The ID of the network
443 pub network_id: String,
444 pub set_network_id_name_request: models::SetNetworkIdNameRequest,
445}
446
447/// struct for passing parameters to the method
448/// [`FireblocksNetworkApi::set_network_id_routing_policy`]
449#[derive(Clone, Debug)]
450#[cfg_attr(feature = "bon", derive(::bon::Builder))]
451pub struct SetNetworkIdRoutingPolicyParams {
452 /// The ID of the network
453 pub network_id: String,
454 pub set_network_id_routing_policy_request: Option<models::SetNetworkIdRoutingPolicyRequest>,
455}
456
457/// struct for passing parameters to the method
458/// [`FireblocksNetworkApi::set_routing_policy`]
459#[derive(Clone, Debug)]
460#[cfg_attr(feature = "bon", derive(::bon::Builder))]
461pub struct SetRoutingPolicyParams {
462 /// The ID of the network connection
463 pub connection_id: String,
464 pub set_routing_policy_request: Option<models::SetRoutingPolicyRequest>,
465}
466
467#[async_trait]
468impl FireblocksNetworkApi for FireblocksNetworkApiClient {
469 /// The Fireblocks Network allows for flexibility around incoming deposits.
470 /// A receiver can receive network deposits to locations other than
471 /// Fireblocks. This endpoint validates whether future transactions are
472 /// routed to the displayed recipient or to a 3rd party. </br>Endpoint
473 /// Permission: Admin, Non-Signing Admin.
474 async fn check_third_party_routing(
475 &self,
476 params: CheckThirdPartyRoutingParams,
477 ) -> Result<models::ThirdPartyRouting, Error<CheckThirdPartyRoutingError>> {
478 let CheckThirdPartyRoutingParams {
479 connection_id,
480 asset_type,
481 } = params;
482
483 let local_var_configuration = &self.configuration;
484
485 let local_var_client = &local_var_configuration.client;
486
487 let local_var_uri_str = format!(
488 "{}/network_connections/{connectionId}/is_third_party_routing/{assetType}",
489 local_var_configuration.base_path,
490 connectionId = crate::apis::urlencode(connection_id),
491 assetType = crate::apis::urlencode(asset_type)
492 );
493 let mut local_var_req_builder =
494 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
495
496 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
497 local_var_req_builder = local_var_req_builder
498 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
499 }
500
501 let local_var_req = local_var_req_builder.build()?;
502 let local_var_resp = local_var_client.execute(local_var_req).await?;
503
504 let local_var_status = local_var_resp.status();
505 let local_var_content_type = local_var_resp
506 .headers()
507 .get("content-type")
508 .and_then(|v| v.to_str().ok())
509 .unwrap_or("application/octet-stream");
510 let local_var_content_type = super::ContentType::from(local_var_content_type);
511 let local_var_content = local_var_resp.text().await?;
512
513 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
514 match local_var_content_type {
515 ContentType::Json => {
516 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
517 }
518 ContentType::Text => {
519 return Err(Error::from(serde_json::Error::custom(
520 "Received `text/plain` content type response that cannot be converted to \
521 `models::ThirdPartyRouting`",
522 )));
523 }
524 ContentType::Unsupported(local_var_unknown_type) => {
525 return Err(Error::from(serde_json::Error::custom(format!(
526 "Received `{local_var_unknown_type}` content type response that cannot be \
527 converted to `models::ThirdPartyRouting`"
528 ))));
529 }
530 }
531 } else {
532 let local_var_entity: Option<CheckThirdPartyRoutingError> =
533 serde_json::from_str(&local_var_content).ok();
534 let local_var_error = ResponseContent {
535 status: local_var_status,
536 content: local_var_content,
537 entity: local_var_entity,
538 };
539 Err(Error::ResponseError(local_var_error))
540 }
541 }
542
543 /// Initiates a new network connection. **Note:** This API call is subject to Flexible Routing Schemes. Your routing policy defines how your transactions are routed. You can choose 1 of the 3 different schemes mentioned below for each asset type: - **None**; Defines the profile routing to no destination for that asset type. Incoming transactions to asset types routed to `None` will fail. - **Custom**; Route to an account that you choose. If you remove the account, incoming transactions will fail until you choose another one. - **Default**; Use the routing specified by the network profile the connection is connected to. This scheme is also referred to as \"Profile Routing\" Default Workspace Presets: - Network Profile Crypto → **Custom** - Network Profile FIAT → **None** - Network Connection Crypto → **Default** - Network Connection FIAT → **Default** Supported asset groups for routing policy can be found at `/network_ids/routing_policy_asset_groups` **Note**: By default, Custom routing scheme uses (`dstId` = `0`, `dstType` = `VAULT`). Learn more about Fireblocks Network in the following [guide](https://developers.fireblocks.com/docs/connect-to-the-fireblocks-network). </br>Endpoint Permission: Admin, Non-Signing Admin.
544 async fn create_network_connection(
545 &self,
546 params: CreateNetworkConnectionParams,
547 ) -> Result<models::NetworkConnectionResponse, Error<CreateNetworkConnectionError>> {
548 let CreateNetworkConnectionParams {
549 idempotency_key,
550 network_connection,
551 } = params;
552
553 let local_var_configuration = &self.configuration;
554
555 let local_var_client = &local_var_configuration.client;
556
557 let local_var_uri_str =
558 format!("{}/network_connections", local_var_configuration.base_path);
559 let mut local_var_req_builder =
560 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
561
562 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
563 local_var_req_builder = local_var_req_builder
564 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
565 }
566 if let Some(local_var_param_value) = idempotency_key {
567 local_var_req_builder =
568 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
569 }
570 local_var_req_builder = local_var_req_builder.json(&network_connection);
571
572 let local_var_req = local_var_req_builder.build()?;
573 let local_var_resp = local_var_client.execute(local_var_req).await?;
574
575 let local_var_status = local_var_resp.status();
576 let local_var_content_type = local_var_resp
577 .headers()
578 .get("content-type")
579 .and_then(|v| v.to_str().ok())
580 .unwrap_or("application/octet-stream");
581 let local_var_content_type = super::ContentType::from(local_var_content_type);
582 let local_var_content = local_var_resp.text().await?;
583
584 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
585 match local_var_content_type {
586 ContentType::Json => {
587 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
588 }
589 ContentType::Text => {
590 return Err(Error::from(serde_json::Error::custom(
591 "Received `text/plain` content type response that cannot be converted to \
592 `models::NetworkConnectionResponse`",
593 )));
594 }
595 ContentType::Unsupported(local_var_unknown_type) => {
596 return Err(Error::from(serde_json::Error::custom(format!(
597 "Received `{local_var_unknown_type}` content type response that cannot be \
598 converted to `models::NetworkConnectionResponse`"
599 ))));
600 }
601 }
602 } else {
603 let local_var_entity: Option<CreateNetworkConnectionError> =
604 serde_json::from_str(&local_var_content).ok();
605 let local_var_error = ResponseContent {
606 status: local_var_status,
607 content: local_var_content,
608 entity: local_var_entity,
609 };
610 Err(Error::ResponseError(local_var_error))
611 }
612 }
613
614 /// Creates a new Network ID. **Note:** This API call is subject to
615 /// Flexible Routing Schemes. Your routing policy defines how your
616 /// transactions are routed. You can choose 1 of the 3 different schemes
617 /// mentioned below for each asset type: - **None**; Defines the profile
618 /// routing to no destination for that asset type. Incoming transactions to
619 /// asset types routed to `None` will fail. - **Custom**; Route to an
620 /// account that you choose. If you remove the account, incoming
621 /// transactions will fail until you choose another one. - **Default**;
622 /// Use the routing specified by the network profile the connection is
623 /// connected to. This scheme is also referred to as \"Profile Routing\"
624 /// Default Workspace Presets: - Network Profile Crypto → **Custom** -
625 /// Network Profile FIAT → **None** - Network Connection Crypto →
626 /// **Default** - Network Connection FIAT → **Default** Supported asset
627 /// groups for routing policy can be found at
628 /// `/network_ids/routing_policy_asset_groups` **Note**: By default, Custom
629 /// routing scheme uses (`dstId` = `0`, `dstType` = `VAULT`). </br>Endpoint
630 /// Permission: Admin, Non-Signing Admin.
631 async fn create_network_id(
632 &self,
633 params: CreateNetworkIdParams,
634 ) -> Result<models::NetworkIdResponse, Error<CreateNetworkIdError>> {
635 let CreateNetworkIdParams {
636 idempotency_key,
637 create_network_id_request,
638 } = params;
639
640 let local_var_configuration = &self.configuration;
641
642 let local_var_client = &local_var_configuration.client;
643
644 let local_var_uri_str = format!("{}/network_ids", local_var_configuration.base_path);
645 let mut local_var_req_builder =
646 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
647
648 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
649 local_var_req_builder = local_var_req_builder
650 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
651 }
652 if let Some(local_var_param_value) = idempotency_key {
653 local_var_req_builder =
654 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
655 }
656 local_var_req_builder = local_var_req_builder.json(&create_network_id_request);
657
658 let local_var_req = local_var_req_builder.build()?;
659 let local_var_resp = local_var_client.execute(local_var_req).await?;
660
661 let local_var_status = local_var_resp.status();
662 let local_var_content_type = local_var_resp
663 .headers()
664 .get("content-type")
665 .and_then(|v| v.to_str().ok())
666 .unwrap_or("application/octet-stream");
667 let local_var_content_type = super::ContentType::from(local_var_content_type);
668 let local_var_content = local_var_resp.text().await?;
669
670 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
671 match local_var_content_type {
672 ContentType::Json => {
673 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
674 }
675 ContentType::Text => {
676 return Err(Error::from(serde_json::Error::custom(
677 "Received `text/plain` content type response that cannot be converted to \
678 `models::NetworkIdResponse`",
679 )));
680 }
681 ContentType::Unsupported(local_var_unknown_type) => {
682 return Err(Error::from(serde_json::Error::custom(format!(
683 "Received `{local_var_unknown_type}` content type response that cannot be \
684 converted to `models::NetworkIdResponse`"
685 ))));
686 }
687 }
688 } else {
689 let local_var_entity: Option<CreateNetworkIdError> =
690 serde_json::from_str(&local_var_content).ok();
691 let local_var_error = ResponseContent {
692 status: local_var_status,
693 content: local_var_content,
694 entity: local_var_entity,
695 };
696 Err(Error::ResponseError(local_var_error))
697 }
698 }
699
700 /// Deletes an existing network connection specified by its connection ID.
701 /// **Note:** This API call is subject to Flexible Routing Schemes. Your
702 /// routing policy defines how your transactions are routed. You can choose
703 /// 1 of the 3 different schemes mentioned below for each asset type: -
704 /// **None**; Defines the profile routing to no destination for that asset
705 /// type. Incoming transactions to asset types routed to `None` will fail.
706 /// - **Custom**; Route to an account that you choose. If you remove the
707 /// account, incoming transactions will fail until you choose another one.
708 /// - **Default**; Use the routing specified by the network profile the
709 /// connection is connected to. This scheme is also referred to as \"Profile
710 /// Routing\" Default Workspace Presets: - Network Profile Crypto →
711 /// **Custom** - Network Profile FIAT → **None** - Network Connection
712 /// Crypto → **Default** - Network Connection FIAT → **Default**
713 /// **Note**: By default, Custom routing scheme uses (`dstId` = `0`,
714 /// `dstType` = `VAULT`). </br>Endpoint Permission: Admin, Non-Signing
715 /// Admin.
716 async fn delete_network_connection(
717 &self,
718 params: DeleteNetworkConnectionParams,
719 ) -> Result<models::DeleteNetworkConnectionResponse, Error<DeleteNetworkConnectionError>> {
720 let DeleteNetworkConnectionParams { connection_id } = params;
721
722 let local_var_configuration = &self.configuration;
723
724 let local_var_client = &local_var_configuration.client;
725
726 let local_var_uri_str = format!(
727 "{}/network_connections/{connectionId}",
728 local_var_configuration.base_path,
729 connectionId = crate::apis::urlencode(connection_id)
730 );
731 let mut local_var_req_builder =
732 local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
733
734 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
735 local_var_req_builder = local_var_req_builder
736 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
737 }
738
739 let local_var_req = local_var_req_builder.build()?;
740 let local_var_resp = local_var_client.execute(local_var_req).await?;
741
742 let local_var_status = local_var_resp.status();
743 let local_var_content_type = local_var_resp
744 .headers()
745 .get("content-type")
746 .and_then(|v| v.to_str().ok())
747 .unwrap_or("application/octet-stream");
748 let local_var_content_type = super::ContentType::from(local_var_content_type);
749 let local_var_content = local_var_resp.text().await?;
750
751 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
752 match local_var_content_type {
753 ContentType::Json => {
754 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
755 }
756 ContentType::Text => {
757 return Err(Error::from(serde_json::Error::custom(
758 "Received `text/plain` content type response that cannot be converted to \
759 `models::DeleteNetworkConnectionResponse`",
760 )));
761 }
762 ContentType::Unsupported(local_var_unknown_type) => {
763 return Err(Error::from(serde_json::Error::custom(format!(
764 "Received `{local_var_unknown_type}` content type response that cannot be \
765 converted to `models::DeleteNetworkConnectionResponse`"
766 ))));
767 }
768 }
769 } else {
770 let local_var_entity: Option<DeleteNetworkConnectionError> =
771 serde_json::from_str(&local_var_content).ok();
772 let local_var_error = ResponseContent {
773 status: local_var_status,
774 content: local_var_content,
775 entity: local_var_entity,
776 };
777 Err(Error::ResponseError(local_var_error))
778 }
779 }
780
781 /// Deletes a network by its ID. **Note:** This API call is subject to
782 /// Flexible Routing Schemes. Your routing policy defines how your
783 /// transactions are routed. You can choose 1 of the 3 different schemes
784 /// mentioned below for each asset type: - **None**; Defines the profile
785 /// routing to no destination for that asset type. Incoming transactions to
786 /// asset types routed to `None` will fail. - **Custom**; Route to an
787 /// account that you choose. If you remove the account, incoming
788 /// transactions will fail until you choose another one. - **Default**;
789 /// Use the routing specified by the network profile the connection is
790 /// connected to. This scheme is also referred to as \"Profile Routing\"
791 /// Default Workspace Presets: - Network Profile Crypto → **Custom** -
792 /// Network Profile FIAT → **None** - Network Connection Crypto →
793 /// **Default** - Network Connection FIAT → **Default** **Note**: By
794 /// default, Custom routing scheme uses (`dstId` = `0`, `dstType` =
795 /// `VAULT`). </br>Endpoint Permission: Admin, Non-Signing Admin.
796 async fn delete_network_id(
797 &self,
798 params: DeleteNetworkIdParams,
799 ) -> Result<models::DeleteNetworkIdResponse, Error<DeleteNetworkIdError>> {
800 let DeleteNetworkIdParams { network_id } = params;
801
802 let local_var_configuration = &self.configuration;
803
804 let local_var_client = &local_var_configuration.client;
805
806 let local_var_uri_str = format!(
807 "{}/network_ids/{networkId}",
808 local_var_configuration.base_path,
809 networkId = crate::apis::urlencode(network_id)
810 );
811 let mut local_var_req_builder =
812 local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
813
814 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
815 local_var_req_builder = local_var_req_builder
816 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
817 }
818
819 let local_var_req = local_var_req_builder.build()?;
820 let local_var_resp = local_var_client.execute(local_var_req).await?;
821
822 let local_var_status = local_var_resp.status();
823 let local_var_content_type = local_var_resp
824 .headers()
825 .get("content-type")
826 .and_then(|v| v.to_str().ok())
827 .unwrap_or("application/octet-stream");
828 let local_var_content_type = super::ContentType::from(local_var_content_type);
829 let local_var_content = local_var_resp.text().await?;
830
831 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
832 match local_var_content_type {
833 ContentType::Json => {
834 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
835 }
836 ContentType::Text => {
837 return Err(Error::from(serde_json::Error::custom(
838 "Received `text/plain` content type response that cannot be converted to \
839 `models::DeleteNetworkIdResponse`",
840 )));
841 }
842 ContentType::Unsupported(local_var_unknown_type) => {
843 return Err(Error::from(serde_json::Error::custom(format!(
844 "Received `{local_var_unknown_type}` content type response that cannot be \
845 converted to `models::DeleteNetworkIdResponse`"
846 ))));
847 }
848 }
849 } else {
850 let local_var_entity: Option<DeleteNetworkIdError> =
851 serde_json::from_str(&local_var_content).ok();
852 let local_var_error = ResponseContent {
853 status: local_var_status,
854 content: local_var_content,
855 entity: local_var_entity,
856 };
857 Err(Error::ResponseError(local_var_error))
858 }
859 }
860
861 /// Gets a network connection by ID. **Note:** This API call is subject to
862 /// Flexible Routing Schemes. Your routing policy defines how your
863 /// transactions are routed. You can choose 1 of the 3 different schemes
864 /// mentioned below for each asset type: - **None**; Defines the profile
865 /// routing to no destination for that asset type. Incoming transactions to
866 /// asset types routed to `None` will fail. - **Custom**; Route to an
867 /// account that you choose. If you remove the account, incoming
868 /// transactions will fail until you choose another one. - **Default**;
869 /// Use the routing specified by the network profile the connection is
870 /// connected to. This scheme is also referred to as \"Profile Routing\"
871 /// Default Workspace Presets: - Network Profile Crypto → **Custom** -
872 /// Network Profile FIAT → **None** - Network Connection Crypto →
873 /// **Default** - Network Connection FIAT → **Default** **Note**: By
874 /// default, Custom routing scheme uses (`dstId` = `0`, `dstType` =
875 /// `VAULT`). </br>Endpoint Permission: Admin, Non-Signing Admin.
876 async fn get_network(
877 &self,
878 params: GetNetworkParams,
879 ) -> Result<models::NetworkConnectionResponse, Error<GetNetworkError>> {
880 let GetNetworkParams { connection_id } = params;
881
882 let local_var_configuration = &self.configuration;
883
884 let local_var_client = &local_var_configuration.client;
885
886 let local_var_uri_str = format!(
887 "{}/network_connections/{connectionId}",
888 local_var_configuration.base_path,
889 connectionId = crate::apis::urlencode(connection_id)
890 );
891 let mut local_var_req_builder =
892 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
893
894 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
895 local_var_req_builder = local_var_req_builder
896 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
897 }
898
899 let local_var_req = local_var_req_builder.build()?;
900 let local_var_resp = local_var_client.execute(local_var_req).await?;
901
902 let local_var_status = local_var_resp.status();
903 let local_var_content_type = local_var_resp
904 .headers()
905 .get("content-type")
906 .and_then(|v| v.to_str().ok())
907 .unwrap_or("application/octet-stream");
908 let local_var_content_type = super::ContentType::from(local_var_content_type);
909 let local_var_content = local_var_resp.text().await?;
910
911 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
912 match local_var_content_type {
913 ContentType::Json => {
914 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
915 }
916 ContentType::Text => {
917 return Err(Error::from(serde_json::Error::custom(
918 "Received `text/plain` content type response that cannot be converted to \
919 `models::NetworkConnectionResponse`",
920 )));
921 }
922 ContentType::Unsupported(local_var_unknown_type) => {
923 return Err(Error::from(serde_json::Error::custom(format!(
924 "Received `{local_var_unknown_type}` content type response that cannot be \
925 converted to `models::NetworkConnectionResponse`"
926 ))));
927 }
928 }
929 } else {
930 let local_var_entity: Option<GetNetworkError> =
931 serde_json::from_str(&local_var_content).ok();
932 let local_var_error = ResponseContent {
933 status: local_var_status,
934 content: local_var_content,
935 entity: local_var_entity,
936 };
937 Err(Error::ResponseError(local_var_error))
938 }
939 }
940
941 /// Returns all network connections. **Note:** This API call is subject to
942 /// Flexible Routing Schemes. Your routing policy defines how your
943 /// transactions are routed. You can choose 1 of the 3 different schemes
944 /// mentioned below for each asset type: - **None**; Defines the profile
945 /// routing to no destination for that asset type. Incoming transactions to
946 /// asset types routed to `None` will fail. - **Custom**; Route to an
947 /// account that you choose. If you remove the account, incoming
948 /// transactions will fail until you choose another one. - **Default**;
949 /// Use the routing specified by the network profile the connection is
950 /// connected to. This scheme is also referred to as \"Profile Routing\"
951 /// Default Workspace Presets: - Network Profile Crypto → **Custom** -
952 /// Network Profile FIAT → **None** - Network Connection Crypto →
953 /// **Default** - Network Connection FIAT → **Default** - **Note**:
954 /// By default, Custom routing scheme uses (`dstId` = `0`, `dstType` =
955 /// `VAULT`). </br>Endpoint Permission: Admin, Non-Signing Admin.
956 async fn get_network_connections(
957 &self,
958 ) -> Result<Vec<models::NetworkConnectionResponse>, Error<GetNetworkConnectionsError>> {
959 let local_var_configuration = &self.configuration;
960
961 let local_var_client = &local_var_configuration.client;
962
963 let local_var_uri_str =
964 format!("{}/network_connections", local_var_configuration.base_path);
965 let mut local_var_req_builder =
966 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
967
968 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
969 local_var_req_builder = local_var_req_builder
970 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
971 }
972
973 let local_var_req = local_var_req_builder.build()?;
974 let local_var_resp = local_var_client.execute(local_var_req).await?;
975
976 let local_var_status = local_var_resp.status();
977 let local_var_content_type = local_var_resp
978 .headers()
979 .get("content-type")
980 .and_then(|v| v.to_str().ok())
981 .unwrap_or("application/octet-stream");
982 let local_var_content_type = super::ContentType::from(local_var_content_type);
983 let local_var_content = local_var_resp.text().await?;
984
985 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
986 match local_var_content_type {
987 ContentType::Json => {
988 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
989 }
990 ContentType::Text => {
991 return Err(Error::from(serde_json::Error::custom(
992 "Received `text/plain` content type response that cannot be converted to \
993 `Vec<models::NetworkConnectionResponse>`",
994 )));
995 }
996 ContentType::Unsupported(local_var_unknown_type) => {
997 return Err(Error::from(serde_json::Error::custom(format!(
998 "Received `{local_var_unknown_type}` content type response that cannot be \
999 converted to `Vec<models::NetworkConnectionResponse>`"
1000 ))));
1001 }
1002 }
1003 } else {
1004 let local_var_entity: Option<GetNetworkConnectionsError> =
1005 serde_json::from_str(&local_var_content).ok();
1006 let local_var_error = ResponseContent {
1007 status: local_var_status,
1008 content: local_var_content,
1009 entity: local_var_entity,
1010 };
1011 Err(Error::ResponseError(local_var_error))
1012 }
1013 }
1014
1015 /// Retrieves a network by its ID. **Note:** This API call is subject to
1016 /// Flexible Routing Schemes. Your routing policy defines how your
1017 /// transactions are routed. You can choose 1 of the 3 different schemes
1018 /// mentioned below for each asset type: - **None**; Defines the profile
1019 /// routing to no destination for that asset type. Incoming transactions to
1020 /// asset types routed to `None` will fail. - **Custom**; Route to an
1021 /// account that you choose. If you remove the account, incoming
1022 /// transactions will fail until you choose another one. - **Default**;
1023 /// Use the routing specified by the network profile the connection is
1024 /// connected to. This scheme is also referred to as \"Profile Routing\"
1025 /// Default Workspace Presets: - Network Profile Crypto → **Custom** -
1026 /// Network Profile FIAT → **None** - Network Connection Crypto →
1027 /// **Default** - Network Connection FIAT → **Default** **Note**: By
1028 /// default, Custom routing scheme uses (`dstId` = `0`, `dstType` =
1029 /// `VAULT`). </br>Endpoint Permission: Admin, Non-Signing Admin.
1030 async fn get_network_id(
1031 &self,
1032 params: GetNetworkIdParams,
1033 ) -> Result<models::NetworkIdResponse, Error<GetNetworkIdError>> {
1034 let GetNetworkIdParams { network_id } = params;
1035
1036 let local_var_configuration = &self.configuration;
1037
1038 let local_var_client = &local_var_configuration.client;
1039
1040 let local_var_uri_str = format!(
1041 "{}/network_ids/{networkId}",
1042 local_var_configuration.base_path,
1043 networkId = crate::apis::urlencode(network_id)
1044 );
1045 let mut local_var_req_builder =
1046 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1047
1048 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1049 local_var_req_builder = local_var_req_builder
1050 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1051 }
1052
1053 let local_var_req = local_var_req_builder.build()?;
1054 let local_var_resp = local_var_client.execute(local_var_req).await?;
1055
1056 let local_var_status = local_var_resp.status();
1057 let local_var_content_type = local_var_resp
1058 .headers()
1059 .get("content-type")
1060 .and_then(|v| v.to_str().ok())
1061 .unwrap_or("application/octet-stream");
1062 let local_var_content_type = super::ContentType::from(local_var_content_type);
1063 let local_var_content = local_var_resp.text().await?;
1064
1065 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1066 match local_var_content_type {
1067 ContentType::Json => {
1068 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1069 }
1070 ContentType::Text => {
1071 return Err(Error::from(serde_json::Error::custom(
1072 "Received `text/plain` content type response that cannot be converted to \
1073 `models::NetworkIdResponse`",
1074 )));
1075 }
1076 ContentType::Unsupported(local_var_unknown_type) => {
1077 return Err(Error::from(serde_json::Error::custom(format!(
1078 "Received `{local_var_unknown_type}` content type response that cannot be \
1079 converted to `models::NetworkIdResponse`"
1080 ))));
1081 }
1082 }
1083 } else {
1084 let local_var_entity: Option<GetNetworkIdError> =
1085 serde_json::from_str(&local_var_content).ok();
1086 let local_var_error = ResponseContent {
1087 status: local_var_status,
1088 content: local_var_content,
1089 entity: local_var_entity,
1090 };
1091 Err(Error::ResponseError(local_var_error))
1092 }
1093 }
1094
1095 /// Retrieves a list of all local and discoverable remote network IDs.
1096 /// **Note:** This API call is subject to Flexible Routing Schemes. Your
1097 /// routing policy defines how your transactions are routed. You can choose
1098 /// 1 of the 3 different schemes mentioned below for each asset type: -
1099 /// **None**; Defines the profile routing to no destination for that asset
1100 /// type. Incoming transactions to asset types routed to `None` will fail.
1101 /// - **Custom**; Route to an account that you choose. If you remove the
1102 /// account, incoming transactions will fail until you choose another one.
1103 /// - **Default**; Use the routing specified by the network profile the
1104 /// connection is connected to. This scheme is also referred to as \"Profile
1105 /// Routing\" Default Workspace Presets: - Network Profile Crypto →
1106 /// **Custom** - Network Profile FIAT → **None** - Network Connection
1107 /// Crypto → **Default** - Network Connection FIAT → **Default**
1108 /// **Note**: By default, Custom routing scheme uses (`dstId` = `0`,
1109 /// `dstType` = `VAULT`). </br>Endpoint Permission: Admin, Non-Signing
1110 /// Admin.
1111 async fn get_network_ids(
1112 &self,
1113 ) -> Result<Vec<models::NetworkIdResponse>, Error<GetNetworkIdsError>> {
1114 let local_var_configuration = &self.configuration;
1115
1116 let local_var_client = &local_var_configuration.client;
1117
1118 let local_var_uri_str = format!("{}/network_ids", local_var_configuration.base_path);
1119 let mut local_var_req_builder =
1120 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1121
1122 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1123 local_var_req_builder = local_var_req_builder
1124 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1125 }
1126
1127 let local_var_req = local_var_req_builder.build()?;
1128 let local_var_resp = local_var_client.execute(local_var_req).await?;
1129
1130 let local_var_status = local_var_resp.status();
1131 let local_var_content_type = local_var_resp
1132 .headers()
1133 .get("content-type")
1134 .and_then(|v| v.to_str().ok())
1135 .unwrap_or("application/octet-stream");
1136 let local_var_content_type = super::ContentType::from(local_var_content_type);
1137 let local_var_content = local_var_resp.text().await?;
1138
1139 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1140 match local_var_content_type {
1141 ContentType::Json => {
1142 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1143 }
1144 ContentType::Text => {
1145 return Err(Error::from(serde_json::Error::custom(
1146 "Received `text/plain` content type response that cannot be converted to \
1147 `Vec<models::NetworkIdResponse>`",
1148 )));
1149 }
1150 ContentType::Unsupported(local_var_unknown_type) => {
1151 return Err(Error::from(serde_json::Error::custom(format!(
1152 "Received `{local_var_unknown_type}` content type response that cannot be \
1153 converted to `Vec<models::NetworkIdResponse>`"
1154 ))));
1155 }
1156 }
1157 } else {
1158 let local_var_entity: Option<GetNetworkIdsError> =
1159 serde_json::from_str(&local_var_content).ok();
1160 let local_var_error = ResponseContent {
1161 status: local_var_status,
1162 content: local_var_content,
1163 entity: local_var_entity,
1164 };
1165 Err(Error::ResponseError(local_var_error))
1166 }
1167 }
1168
1169 /// Retrieves a list of all enabled routing policy asset groups. Your
1170 /// routing policy defines how your transactions are routed. You can use one
1171 /// or more enabled routing policy asset groups to describe connection or
1172 /// network id routing policy. </br>Endpoint Permission: Admin, Non-Signing
1173 /// Admin.
1174 async fn get_routing_policy_asset_groups(
1175 &self,
1176 ) -> Result<Vec<String>, Error<GetRoutingPolicyAssetGroupsError>> {
1177 let local_var_configuration = &self.configuration;
1178
1179 let local_var_client = &local_var_configuration.client;
1180
1181 let local_var_uri_str = format!(
1182 "{}/network_ids/routing_policy_asset_groups",
1183 local_var_configuration.base_path
1184 );
1185 let mut local_var_req_builder =
1186 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1187
1188 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1189 local_var_req_builder = local_var_req_builder
1190 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1191 }
1192
1193 let local_var_req = local_var_req_builder.build()?;
1194 let local_var_resp = local_var_client.execute(local_var_req).await?;
1195
1196 let local_var_status = local_var_resp.status();
1197 let local_var_content_type = local_var_resp
1198 .headers()
1199 .get("content-type")
1200 .and_then(|v| v.to_str().ok())
1201 .unwrap_or("application/octet-stream");
1202 let local_var_content_type = super::ContentType::from(local_var_content_type);
1203 let local_var_content = local_var_resp.text().await?;
1204
1205 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1206 match local_var_content_type {
1207 ContentType::Json => {
1208 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1209 }
1210 ContentType::Text => {
1211 return Err(Error::from(serde_json::Error::custom(
1212 "Received `text/plain` content type response that cannot be converted to \
1213 `Vec<String>`",
1214 )));
1215 }
1216 ContentType::Unsupported(local_var_unknown_type) => {
1217 return Err(Error::from(serde_json::Error::custom(format!(
1218 "Received `{local_var_unknown_type}` content type response that cannot be \
1219 converted to `Vec<String>`"
1220 ))));
1221 }
1222 }
1223 } else {
1224 let local_var_entity: Option<GetRoutingPolicyAssetGroupsError> =
1225 serde_json::from_str(&local_var_content).ok();
1226 let local_var_error = ResponseContent {
1227 status: local_var_status,
1228 content: local_var_content,
1229 entity: local_var_entity,
1230 };
1231 Err(Error::ResponseError(local_var_error))
1232 }
1233 }
1234
1235 /// Retrieves a list of all local and discoverable remote network IDs. Can
1236 /// be filtered. **Note:** This API call is subject to Flexible Routing
1237 /// Schemes. Your routing policy defines how your transactions are routed.
1238 /// You can choose 1 of the 3 different schemes mentioned below for each
1239 /// asset type: - **None**; Defines the profile routing to no destination
1240 /// for that asset type. Incoming transactions to asset types routed to
1241 /// `None` will fail. - **Custom**; Route to an account that you choose.
1242 /// If you remove the account, incoming transactions will fail until you
1243 /// choose another one. - **Default**; Use the routing specified by the
1244 /// network profile the connection is connected to. This scheme is also
1245 /// referred to as \"Profile Routing\" Default Workspace Presets: -
1246 /// Network Profile Crypto → **Custom** - Network Profile FIAT → **None**
1247 /// - Network Connection Crypto → **Default** - Network Connection FIAT →
1248 /// **Default** - **Note**: By default, Custom routing scheme uses
1249 /// (`dstId` = `0`, `dstType` = `VAULT`).
1250 async fn search_network_ids(
1251 &self,
1252 params: SearchNetworkIdsParams,
1253 ) -> Result<models::SearchNetworkIdsResponse, Error<SearchNetworkIdsError>> {
1254 let SearchNetworkIdsParams {
1255 search,
1256 exclude_self,
1257 exclude_connected,
1258 page_cursor,
1259 page_size,
1260 } = params;
1261
1262 let local_var_configuration = &self.configuration;
1263
1264 let local_var_client = &local_var_configuration.client;
1265
1266 let local_var_uri_str = format!("{}/network_ids/search", local_var_configuration.base_path);
1267 let mut local_var_req_builder =
1268 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1269
1270 if let Some(ref param_value) = search {
1271 local_var_req_builder =
1272 local_var_req_builder.query(&[("search", ¶m_value.to_string())]);
1273 }
1274 if let Some(ref param_value) = exclude_self {
1275 local_var_req_builder =
1276 local_var_req_builder.query(&[("excludeSelf", ¶m_value.to_string())]);
1277 }
1278 if let Some(ref param_value) = exclude_connected {
1279 local_var_req_builder =
1280 local_var_req_builder.query(&[("excludeConnected", ¶m_value.to_string())]);
1281 }
1282 if let Some(ref param_value) = page_cursor {
1283 local_var_req_builder =
1284 local_var_req_builder.query(&[("pageCursor", ¶m_value.to_string())]);
1285 }
1286 if let Some(ref param_value) = page_size {
1287 local_var_req_builder =
1288 local_var_req_builder.query(&[("pageSize", ¶m_value.to_string())]);
1289 }
1290 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1291 local_var_req_builder = local_var_req_builder
1292 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1293 }
1294
1295 let local_var_req = local_var_req_builder.build()?;
1296 let local_var_resp = local_var_client.execute(local_var_req).await?;
1297
1298 let local_var_status = local_var_resp.status();
1299 let local_var_content_type = local_var_resp
1300 .headers()
1301 .get("content-type")
1302 .and_then(|v| v.to_str().ok())
1303 .unwrap_or("application/octet-stream");
1304 let local_var_content_type = super::ContentType::from(local_var_content_type);
1305 let local_var_content = local_var_resp.text().await?;
1306
1307 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1308 match local_var_content_type {
1309 ContentType::Json => {
1310 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1311 }
1312 ContentType::Text => {
1313 return Err(Error::from(serde_json::Error::custom(
1314 "Received `text/plain` content type response that cannot be converted to \
1315 `models::SearchNetworkIdsResponse`",
1316 )));
1317 }
1318 ContentType::Unsupported(local_var_unknown_type) => {
1319 return Err(Error::from(serde_json::Error::custom(format!(
1320 "Received `{local_var_unknown_type}` content type response that cannot be \
1321 converted to `models::SearchNetworkIdsResponse`"
1322 ))));
1323 }
1324 }
1325 } else {
1326 let local_var_entity: Option<SearchNetworkIdsError> =
1327 serde_json::from_str(&local_var_content).ok();
1328 let local_var_error = ResponseContent {
1329 status: local_var_status,
1330 content: local_var_content,
1331 entity: local_var_entity,
1332 };
1333 Err(Error::ResponseError(local_var_error))
1334 }
1335 }
1336
1337 /// Update whether or not the network ID is discoverable by others.
1338 /// **Note:** This API call is subject to Flexible Routing Schemes. Your
1339 /// routing policy defines how your transactions are routed. You can choose
1340 /// 1 of the 3 different schemes mentioned below for each asset type: -
1341 /// **None**; Defines the profile routing to no destination for that asset
1342 /// type. Incoming transactions to asset types routed to `None` will fail.
1343 /// - **Custom**; Route to an account that you choose. If you remove the
1344 /// account, incoming transactions will fail until you choose another one.
1345 /// - **Default**; Use the routing specified by the network profile the
1346 /// connection is connected to. This scheme is also referred to as \"Profile
1347 /// Routing\" Default Workspace Presets: - Network Profile Crypto →
1348 /// **Custom** - Network Profile FIAT → **None** - Network Connection
1349 /// Crypto → **Default** - Network Connection FIAT → **Default**
1350 /// **Note**: By default, Custom routing scheme uses (`dstId` = `0`,
1351 /// `dstType` = `VAULT`). </br>Endpoint Permission: Admin, Non-Signing
1352 /// Admin.
1353 async fn set_network_id_discoverability(
1354 &self,
1355 params: SetNetworkIdDiscoverabilityParams,
1356 ) -> Result<models::SetNetworkIdResponse, Error<SetNetworkIdDiscoverabilityError>> {
1357 let SetNetworkIdDiscoverabilityParams {
1358 network_id,
1359 set_network_id_discoverability_request,
1360 } = params;
1361
1362 let local_var_configuration = &self.configuration;
1363
1364 let local_var_client = &local_var_configuration.client;
1365
1366 let local_var_uri_str = format!(
1367 "{}/network_ids/{networkId}/set_discoverability",
1368 local_var_configuration.base_path,
1369 networkId = crate::apis::urlencode(network_id)
1370 );
1371 let mut local_var_req_builder =
1372 local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1373
1374 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1375 local_var_req_builder = local_var_req_builder
1376 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1377 }
1378 local_var_req_builder = local_var_req_builder.json(&set_network_id_discoverability_request);
1379
1380 let local_var_req = local_var_req_builder.build()?;
1381 let local_var_resp = local_var_client.execute(local_var_req).await?;
1382
1383 let local_var_status = local_var_resp.status();
1384 let local_var_content_type = local_var_resp
1385 .headers()
1386 .get("content-type")
1387 .and_then(|v| v.to_str().ok())
1388 .unwrap_or("application/octet-stream");
1389 let local_var_content_type = super::ContentType::from(local_var_content_type);
1390 let local_var_content = local_var_resp.text().await?;
1391
1392 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1393 match local_var_content_type {
1394 ContentType::Json => {
1395 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1396 }
1397 ContentType::Text => {
1398 return Err(Error::from(serde_json::Error::custom(
1399 "Received `text/plain` content type response that cannot be converted to \
1400 `models::SetNetworkIdResponse`",
1401 )));
1402 }
1403 ContentType::Unsupported(local_var_unknown_type) => {
1404 return Err(Error::from(serde_json::Error::custom(format!(
1405 "Received `{local_var_unknown_type}` content type response that cannot be \
1406 converted to `models::SetNetworkIdResponse`"
1407 ))));
1408 }
1409 }
1410 } else {
1411 let local_var_entity: Option<SetNetworkIdDiscoverabilityError> =
1412 serde_json::from_str(&local_var_content).ok();
1413 let local_var_error = ResponseContent {
1414 status: local_var_status,
1415 content: local_var_content,
1416 entity: local_var_entity,
1417 };
1418 Err(Error::ResponseError(local_var_error))
1419 }
1420 }
1421
1422 /// Updates name of a specified network ID. **Note:** This API call is
1423 /// subject to Flexible Routing Schemes. Your routing policy defines how
1424 /// your transactions are routed. You can choose 1 of the 3 different
1425 /// schemes mentioned below for each asset type: - **None**; Defines the
1426 /// profile routing to no destination for that asset type. Incoming
1427 /// transactions to asset types routed to `None` will fail. - **Custom**;
1428 /// Route to an account that you choose. If you remove the account, incoming
1429 /// transactions will fail until you choose another one. - **Default**;
1430 /// Use the routing specified by the network profile the connection is
1431 /// connected to. This scheme is also referred to as \"Profile Routing\"
1432 /// Default Workspace Presets: - Network Profile Crypto → **Custom** -
1433 /// Network Profile FIAT → **None** - Network Connection Crypto →
1434 /// **Default** - Network Connection FIAT → **Default** **Note**: By
1435 /// default, Custom routing scheme uses (`dstId` = `0`, `dstType` =
1436 /// `VAULT`). </br>Endpoint Permission: Admin, Non-Signing Admin.
1437 async fn set_network_id_name(
1438 &self,
1439 params: SetNetworkIdNameParams,
1440 ) -> Result<models::SetNetworkIdResponse, Error<SetNetworkIdNameError>> {
1441 let SetNetworkIdNameParams {
1442 network_id,
1443 set_network_id_name_request,
1444 } = params;
1445
1446 let local_var_configuration = &self.configuration;
1447
1448 let local_var_client = &local_var_configuration.client;
1449
1450 let local_var_uri_str = format!(
1451 "{}/network_ids/{networkId}/set_name",
1452 local_var_configuration.base_path,
1453 networkId = crate::apis::urlencode(network_id)
1454 );
1455 let mut local_var_req_builder =
1456 local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1457
1458 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1459 local_var_req_builder = local_var_req_builder
1460 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1461 }
1462 local_var_req_builder = local_var_req_builder.json(&set_network_id_name_request);
1463
1464 let local_var_req = local_var_req_builder.build()?;
1465 let local_var_resp = local_var_client.execute(local_var_req).await?;
1466
1467 let local_var_status = local_var_resp.status();
1468 let local_var_content_type = local_var_resp
1469 .headers()
1470 .get("content-type")
1471 .and_then(|v| v.to_str().ok())
1472 .unwrap_or("application/octet-stream");
1473 let local_var_content_type = super::ContentType::from(local_var_content_type);
1474 let local_var_content = local_var_resp.text().await?;
1475
1476 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1477 match local_var_content_type {
1478 ContentType::Json => {
1479 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1480 }
1481 ContentType::Text => {
1482 return Err(Error::from(serde_json::Error::custom(
1483 "Received `text/plain` content type response that cannot be converted to \
1484 `models::SetNetworkIdResponse`",
1485 )));
1486 }
1487 ContentType::Unsupported(local_var_unknown_type) => {
1488 return Err(Error::from(serde_json::Error::custom(format!(
1489 "Received `{local_var_unknown_type}` content type response that cannot be \
1490 converted to `models::SetNetworkIdResponse`"
1491 ))));
1492 }
1493 }
1494 } else {
1495 let local_var_entity: Option<SetNetworkIdNameError> =
1496 serde_json::from_str(&local_var_content).ok();
1497 let local_var_error = ResponseContent {
1498 status: local_var_status,
1499 content: local_var_content,
1500 entity: local_var_entity,
1501 };
1502 Err(Error::ResponseError(local_var_error))
1503 }
1504 }
1505
1506 /// Updates the routing policy of a specified network ID. **Note:** This
1507 /// API call is subject to Flexible Routing Schemes. Your routing policy
1508 /// defines how your transactions are routed. You can choose 1 of the 3
1509 /// different schemes mentioned below for each asset type: - **None**;
1510 /// Defines the profile routing to no destination for that asset type.
1511 /// Incoming transactions to asset types routed to `None` will fail. -
1512 /// **Custom**; Route to an account that you choose. If you remove the
1513 /// account, incoming transactions will fail until you choose another one.
1514 /// - **Default**; Use the routing specified by the network profile the
1515 /// connection is connected to. This scheme is also referred to as \"Profile
1516 /// Routing\" Default Workspace Presets: - Network Profile Crypto →
1517 /// **Custom** - Network Profile FIAT → **None** - Network Connection
1518 /// Crypto → **Default** - Network Connection FIAT → **Default**
1519 /// Supported asset groups for routing policy can be found at
1520 /// `/network_ids/routing_policy_asset_groups` **Note**: By default, Custom
1521 /// routing scheme uses (`dstId` = `0`, `dstType` = `VAULT`). </br>Endpoint
1522 /// Permission: Admin, Non-Signing Admin.
1523 async fn set_network_id_routing_policy(
1524 &self,
1525 params: SetNetworkIdRoutingPolicyParams,
1526 ) -> Result<models::SetNetworkIdResponse, Error<SetNetworkIdRoutingPolicyError>> {
1527 let SetNetworkIdRoutingPolicyParams {
1528 network_id,
1529 set_network_id_routing_policy_request,
1530 } = params;
1531
1532 let local_var_configuration = &self.configuration;
1533
1534 let local_var_client = &local_var_configuration.client;
1535
1536 let local_var_uri_str = format!(
1537 "{}/network_ids/{networkId}/set_routing_policy",
1538 local_var_configuration.base_path,
1539 networkId = crate::apis::urlencode(network_id)
1540 );
1541 let mut local_var_req_builder =
1542 local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1543
1544 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1545 local_var_req_builder = local_var_req_builder
1546 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1547 }
1548 local_var_req_builder = local_var_req_builder.json(&set_network_id_routing_policy_request);
1549
1550 let local_var_req = local_var_req_builder.build()?;
1551 let local_var_resp = local_var_client.execute(local_var_req).await?;
1552
1553 let local_var_status = local_var_resp.status();
1554 let local_var_content_type = local_var_resp
1555 .headers()
1556 .get("content-type")
1557 .and_then(|v| v.to_str().ok())
1558 .unwrap_or("application/octet-stream");
1559 let local_var_content_type = super::ContentType::from(local_var_content_type);
1560 let local_var_content = local_var_resp.text().await?;
1561
1562 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1563 match local_var_content_type {
1564 ContentType::Json => {
1565 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1566 }
1567 ContentType::Text => {
1568 return Err(Error::from(serde_json::Error::custom(
1569 "Received `text/plain` content type response that cannot be converted to \
1570 `models::SetNetworkIdResponse`",
1571 )));
1572 }
1573 ContentType::Unsupported(local_var_unknown_type) => {
1574 return Err(Error::from(serde_json::Error::custom(format!(
1575 "Received `{local_var_unknown_type}` content type response that cannot be \
1576 converted to `models::SetNetworkIdResponse`"
1577 ))));
1578 }
1579 }
1580 } else {
1581 let local_var_entity: Option<SetNetworkIdRoutingPolicyError> =
1582 serde_json::from_str(&local_var_content).ok();
1583 let local_var_error = ResponseContent {
1584 status: local_var_status,
1585 content: local_var_content,
1586 entity: local_var_entity,
1587 };
1588 Err(Error::ResponseError(local_var_error))
1589 }
1590 }
1591
1592 /// Updates an existing network connection's routing policy. **Note:** This
1593 /// API call is subject to Flexible Routing Schemes. Your routing policy
1594 /// defines how your transactions are routed. You can choose 1 of the 3
1595 /// different schemes mentioned below for each asset type: - **None**;
1596 /// Defines the profile routing to no destination for that asset type.
1597 /// Incoming transactions to asset types routed to `None` will fail. -
1598 /// **Custom**; Route to an account that you choose. If you remove the
1599 /// account, incoming transactions will fail until you choose another one.
1600 /// - **Default**; Use the routing specified by the network profile the
1601 /// connection is connected to. This scheme is also referred to as \"Profile
1602 /// Routing\" Default Workspace Presets: - Network Profile Crypto →
1603 /// **Custom** - Network Profile FIAT → **None** - Network Connection
1604 /// Crypto → **Default** - Network Connection FIAT → **Default**
1605 /// Supported asset groups for routing policy can be found at
1606 /// `/network_ids/routing_policy_asset_groups` **Note**: By default, Custom
1607 /// routing scheme uses (`dstId` = `0`, `dstType` = `VAULT`). </br>Endpoint
1608 /// Permission: Admin, Non-Signing Admin.
1609 async fn set_routing_policy(
1610 &self,
1611 params: SetRoutingPolicyParams,
1612 ) -> Result<models::SetRoutingPolicyResponse, Error<SetRoutingPolicyError>> {
1613 let SetRoutingPolicyParams {
1614 connection_id,
1615 set_routing_policy_request,
1616 } = params;
1617
1618 let local_var_configuration = &self.configuration;
1619
1620 let local_var_client = &local_var_configuration.client;
1621
1622 let local_var_uri_str = format!(
1623 "{}/network_connections/{connectionId}/set_routing_policy",
1624 local_var_configuration.base_path,
1625 connectionId = crate::apis::urlencode(connection_id)
1626 );
1627 let mut local_var_req_builder =
1628 local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1629
1630 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1631 local_var_req_builder = local_var_req_builder
1632 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1633 }
1634 local_var_req_builder = local_var_req_builder.json(&set_routing_policy_request);
1635
1636 let local_var_req = local_var_req_builder.build()?;
1637 let local_var_resp = local_var_client.execute(local_var_req).await?;
1638
1639 let local_var_status = local_var_resp.status();
1640 let local_var_content_type = local_var_resp
1641 .headers()
1642 .get("content-type")
1643 .and_then(|v| v.to_str().ok())
1644 .unwrap_or("application/octet-stream");
1645 let local_var_content_type = super::ContentType::from(local_var_content_type);
1646 let local_var_content = local_var_resp.text().await?;
1647
1648 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1649 match local_var_content_type {
1650 ContentType::Json => {
1651 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1652 }
1653 ContentType::Text => {
1654 return Err(Error::from(serde_json::Error::custom(
1655 "Received `text/plain` content type response that cannot be converted to \
1656 `models::SetRoutingPolicyResponse`",
1657 )));
1658 }
1659 ContentType::Unsupported(local_var_unknown_type) => {
1660 return Err(Error::from(serde_json::Error::custom(format!(
1661 "Received `{local_var_unknown_type}` content type response that cannot be \
1662 converted to `models::SetRoutingPolicyResponse`"
1663 ))));
1664 }
1665 }
1666 } else {
1667 let local_var_entity: Option<SetRoutingPolicyError> =
1668 serde_json::from_str(&local_var_content).ok();
1669 let local_var_error = ResponseContent {
1670 status: local_var_status,
1671 content: local_var_content,
1672 entity: local_var_entity,
1673 };
1674 Err(Error::ResponseError(local_var_error))
1675 }
1676 }
1677}
1678
1679/// struct for typed errors of method
1680/// [`FireblocksNetworkApi::check_third_party_routing`]
1681#[derive(Debug, Clone, Serialize, Deserialize)]
1682#[serde(untagged)]
1683pub enum CheckThirdPartyRoutingError {
1684 DefaultResponse(models::ErrorSchema),
1685 UnknownValue(serde_json::Value),
1686}
1687
1688/// struct for typed errors of method
1689/// [`FireblocksNetworkApi::create_network_connection`]
1690#[derive(Debug, Clone, Serialize, Deserialize)]
1691#[serde(untagged)]
1692pub enum CreateNetworkConnectionError {
1693 DefaultResponse(models::ErrorSchema),
1694 UnknownValue(serde_json::Value),
1695}
1696
1697/// struct for typed errors of method
1698/// [`FireblocksNetworkApi::create_network_id`]
1699#[derive(Debug, Clone, Serialize, Deserialize)]
1700#[serde(untagged)]
1701pub enum CreateNetworkIdError {
1702 DefaultResponse(models::ErrorSchema),
1703 UnknownValue(serde_json::Value),
1704}
1705
1706/// struct for typed errors of method
1707/// [`FireblocksNetworkApi::delete_network_connection`]
1708#[derive(Debug, Clone, Serialize, Deserialize)]
1709#[serde(untagged)]
1710pub enum DeleteNetworkConnectionError {
1711 DefaultResponse(models::ErrorSchema),
1712 UnknownValue(serde_json::Value),
1713}
1714
1715/// struct for typed errors of method
1716/// [`FireblocksNetworkApi::delete_network_id`]
1717#[derive(Debug, Clone, Serialize, Deserialize)]
1718#[serde(untagged)]
1719pub enum DeleteNetworkIdError {
1720 DefaultResponse(models::ErrorSchema),
1721 UnknownValue(serde_json::Value),
1722}
1723
1724/// struct for typed errors of method [`FireblocksNetworkApi::get_network`]
1725#[derive(Debug, Clone, Serialize, Deserialize)]
1726#[serde(untagged)]
1727pub enum GetNetworkError {
1728 DefaultResponse(models::ErrorSchema),
1729 UnknownValue(serde_json::Value),
1730}
1731
1732/// struct for typed errors of method
1733/// [`FireblocksNetworkApi::get_network_connections`]
1734#[derive(Debug, Clone, Serialize, Deserialize)]
1735#[serde(untagged)]
1736pub enum GetNetworkConnectionsError {
1737 DefaultResponse(models::ErrorSchema),
1738 UnknownValue(serde_json::Value),
1739}
1740
1741/// struct for typed errors of method [`FireblocksNetworkApi::get_network_id`]
1742#[derive(Debug, Clone, Serialize, Deserialize)]
1743#[serde(untagged)]
1744pub enum GetNetworkIdError {
1745 DefaultResponse(models::ErrorSchema),
1746 UnknownValue(serde_json::Value),
1747}
1748
1749/// struct for typed errors of method [`FireblocksNetworkApi::get_network_ids`]
1750#[derive(Debug, Clone, Serialize, Deserialize)]
1751#[serde(untagged)]
1752pub enum GetNetworkIdsError {
1753 DefaultResponse(models::ErrorSchema),
1754 UnknownValue(serde_json::Value),
1755}
1756
1757/// struct for typed errors of method
1758/// [`FireblocksNetworkApi::get_routing_policy_asset_groups`]
1759#[derive(Debug, Clone, Serialize, Deserialize)]
1760#[serde(untagged)]
1761pub enum GetRoutingPolicyAssetGroupsError {
1762 DefaultResponse(models::ErrorSchema),
1763 UnknownValue(serde_json::Value),
1764}
1765
1766/// struct for typed errors of method
1767/// [`FireblocksNetworkApi::search_network_ids`]
1768#[derive(Debug, Clone, Serialize, Deserialize)]
1769#[serde(untagged)]
1770pub enum SearchNetworkIdsError {
1771 DefaultResponse(models::ErrorSchema),
1772 UnknownValue(serde_json::Value),
1773}
1774
1775/// struct for typed errors of method
1776/// [`FireblocksNetworkApi::set_network_id_discoverability`]
1777#[derive(Debug, Clone, Serialize, Deserialize)]
1778#[serde(untagged)]
1779pub enum SetNetworkIdDiscoverabilityError {
1780 DefaultResponse(models::ErrorSchema),
1781 UnknownValue(serde_json::Value),
1782}
1783
1784/// struct for typed errors of method
1785/// [`FireblocksNetworkApi::set_network_id_name`]
1786#[derive(Debug, Clone, Serialize, Deserialize)]
1787#[serde(untagged)]
1788pub enum SetNetworkIdNameError {
1789 DefaultResponse(models::ErrorSchema),
1790 UnknownValue(serde_json::Value),
1791}
1792
1793/// struct for typed errors of method
1794/// [`FireblocksNetworkApi::set_network_id_routing_policy`]
1795#[derive(Debug, Clone, Serialize, Deserialize)]
1796#[serde(untagged)]
1797pub enum SetNetworkIdRoutingPolicyError {
1798 DefaultResponse(models::ErrorSchema),
1799 UnknownValue(serde_json::Value),
1800}
1801
1802/// struct for typed errors of method
1803/// [`FireblocksNetworkApi::set_routing_policy`]
1804#[derive(Debug, Clone, Serialize, Deserialize)]
1805#[serde(untagged)]
1806pub enum SetRoutingPolicyError {
1807 DefaultResponse(models::ErrorSchema),
1808 UnknownValue(serde_json::Value),
1809}