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