1use {
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 VaultsApi: Send + Sync {
23 async fn activate_asset_for_vault_account(
30 &self,
31 params: ActivateAssetForVaultAccountParams,
32 ) -> Result<models::CreateVaultAssetResponse, Error<ActivateAssetForVaultAccountError>>;
33
34 async fn create_legacy_address(
40 &self,
41 params: CreateLegacyAddressParams,
42 ) -> Result<models::CreateAddressResponse, Error<CreateLegacyAddressError>>;
43
44 async fn create_multiple_deposit_addresses(
54 &self,
55 params: CreateMultipleDepositAddressesParams,
56 ) -> Result<models::JobCreated, Error<CreateMultipleDepositAddressesError>>;
57
58 async fn create_vault_account(
62 &self,
63 params: CreateVaultAccountParams,
64 ) -> Result<models::VaultAccount, Error<CreateVaultAccountError>>;
65
66 async fn create_vault_account_asset(
70 &self,
71 params: CreateVaultAccountAssetParams,
72 ) -> Result<models::CreateVaultAssetResponse, Error<CreateVaultAccountAssetError>>;
73
74 async fn create_vault_account_asset_address(
81 &self,
82 params: CreateVaultAccountAssetAddressParams,
83 ) -> Result<models::CreateAddressResponse, Error<CreateVaultAccountAssetAddressError>>;
84
85 async fn get_asset_wallets(
92 &self,
93 params: GetAssetWalletsParams,
94 ) -> Result<models::PaginatedAssetWalletResponse, Error<GetAssetWalletsError>>;
95
96 async fn get_create_multiple_deposit_addresses_job_status(
105 &self,
106 params: GetCreateMultipleDepositAddressesJobStatusParams,
107 ) -> Result<
108 models::CreateMultipleDepositAddressesJobStatus,
109 Error<GetCreateMultipleDepositAddressesJobStatusError>,
110 >;
111
112 async fn get_max_spendable_amount(
119 &self,
120 params: GetMaxSpendableAmountParams,
121 ) -> Result<models::GetMaxSpendableAmountResponse, Error<GetMaxSpendableAmountError>>;
122
123 async fn get_paged_vault_accounts(
129 &self,
130 params: GetPagedVaultAccountsParams,
131 ) -> Result<models::VaultAccountsPagedResponse, Error<GetPagedVaultAccountsError>>;
132
133 async fn get_public_key_info(
138 &self,
139 params: GetPublicKeyInfoParams,
140 ) -> Result<models::PublicKeyInformation, Error<GetPublicKeyInfoError>>;
141
142 async fn get_public_key_info_for_address(
148 &self,
149 params: GetPublicKeyInfoForAddressParams,
150 ) -> Result<models::PublicKeyInformation, Error<GetPublicKeyInfoForAddressError>>;
151
152 async fn get_unspent_inputs(
158 &self,
159 params: GetUnspentInputsParams,
160 ) -> Result<Vec<models::UnspentInputsResponse>, Error<GetUnspentInputsError>>;
161
162 async fn get_vault_account(
167 &self,
168 params: GetVaultAccountParams,
169 ) -> Result<models::VaultAccount, Error<GetVaultAccountError>>;
170
171 async fn get_vault_account_asset(
177 &self,
178 params: GetVaultAccountAssetParams,
179 ) -> Result<models::VaultAsset, Error<GetVaultAccountAssetError>>;
180
181 async fn get_vault_account_asset_addresses(
195 &self,
196 params: GetVaultAccountAssetAddressesParams,
197 ) -> Result<Vec<models::VaultWalletAddress>, Error<GetVaultAccountAssetAddressesError>>;
198
199 async fn get_vault_account_asset_addresses_paginated(
205 &self,
206 params: GetVaultAccountAssetAddressesPaginatedParams,
207 ) -> Result<models::PaginatedAddressResponse, Error<GetVaultAccountAssetAddressesPaginatedError>>;
208
209 async fn get_vault_assets(
215 &self,
216 params: GetVaultAssetsParams,
217 ) -> Result<Vec<models::VaultAsset>, Error<GetVaultAssetsError>>;
218
219 async fn get_vault_balance_by_asset(
225 &self,
226 params: GetVaultBalanceByAssetParams,
227 ) -> Result<models::VaultAsset, Error<GetVaultBalanceByAssetError>>;
228
229 async fn hide_vault_account(
233 &self,
234 params: HideVaultAccountParams,
235 ) -> Result<models::VaultActionStatus, Error<HideVaultAccountError>>;
236
237 async fn set_customer_ref_id_for_address(
243 &self,
244 params: SetCustomerRefIdForAddressParams,
245 ) -> Result<models::VaultActionStatus, Error<SetCustomerRefIdForAddressError>>;
246
247 async fn set_vault_account_auto_fuel(
251 &self,
252 params: SetVaultAccountAutoFuelParams,
253 ) -> Result<models::VaultActionStatus, Error<SetVaultAccountAutoFuelError>>;
254
255 async fn set_vault_account_customer_ref_id(
259 &self,
260 params: SetVaultAccountCustomerRefIdParams,
261 ) -> Result<models::VaultActionStatus, Error<SetVaultAccountCustomerRefIdError>>;
262
263 async fn unhide_vault_account(
268 &self,
269 params: UnhideVaultAccountParams,
270 ) -> Result<models::VaultActionStatus, Error<UnhideVaultAccountError>>;
271
272 async fn update_vault_account(
277 &self,
278 params: UpdateVaultAccountParams,
279 ) -> Result<models::RenameVaultAccountResponse, Error<UpdateVaultAccountError>>;
280
281 async fn update_vault_account_asset_address(
287 &self,
288 params: UpdateVaultAccountAssetAddressParams,
289 ) -> Result<models::VaultActionStatus, Error<UpdateVaultAccountAssetAddressError>>;
290
291 async fn update_vault_account_asset_balance(
298 &self,
299 params: UpdateVaultAccountAssetBalanceParams,
300 ) -> Result<models::VaultAsset, Error<UpdateVaultAccountAssetBalanceError>>;
301}
302
303pub struct VaultsApiClient {
304 configuration: Arc<configuration::Configuration>,
305}
306
307impl VaultsApiClient {
308 pub fn new(configuration: Arc<configuration::Configuration>) -> Self {
309 Self { configuration }
310 }
311}
312
313#[derive(Clone, Debug)]
316#[cfg_attr(feature = "bon", derive(::bon::Builder))]
317pub struct ActivateAssetForVaultAccountParams {
318 pub vault_account_id: String,
320 pub asset_id: String,
322 pub idempotency_key: Option<String>,
327}
328
329#[derive(Clone, Debug)]
331#[cfg_attr(feature = "bon", derive(::bon::Builder))]
332pub struct CreateLegacyAddressParams {
333 pub vault_account_id: String,
335 pub asset_id: String,
337 pub address_id: String,
339 pub idempotency_key: Option<String>,
344}
345
346#[derive(Clone, Debug)]
349#[cfg_attr(feature = "bon", derive(::bon::Builder))]
350pub struct CreateMultipleDepositAddressesParams {
351 pub create_multiple_deposit_addresses_request: models::CreateMultipleDepositAddressesRequest,
352 pub idempotency_key: Option<String>,
357}
358
359#[derive(Clone, Debug)]
361#[cfg_attr(feature = "bon", derive(::bon::Builder))]
362pub struct CreateVaultAccountParams {
363 pub create_vault_account_request: models::CreateVaultAccountRequest,
364 pub idempotency_key: Option<String>,
369}
370
371#[derive(Clone, Debug)]
373#[cfg_attr(feature = "bon", derive(::bon::Builder))]
374pub struct CreateVaultAccountAssetParams {
375 pub vault_account_id: String,
378 pub asset_id: String,
380 pub idempotency_key: Option<String>,
385 pub create_assets_request: Option<models::CreateAssetsRequest>,
386}
387
388#[derive(Clone, Debug)]
391#[cfg_attr(feature = "bon", derive(::bon::Builder))]
392pub struct CreateVaultAccountAssetAddressParams {
393 pub vault_account_id: String,
395 pub asset_id: String,
397 pub idempotency_key: Option<String>,
402 pub create_address_request: Option<models::CreateAddressRequest>,
403}
404
405#[derive(Clone, Debug)]
407#[cfg_attr(feature = "bon", derive(::bon::Builder))]
408pub struct GetAssetWalletsParams {
409 pub total_amount_larger_than: Option<f64>,
412 pub asset_id: Option<String>,
414 pub order_by: Option<String>,
415 pub before: Option<String>,
418 pub after: Option<String>,
421 pub limit: Option<f64>,
424}
425
426#[derive(Clone, Debug)]
429#[cfg_attr(feature = "bon", derive(::bon::Builder))]
430pub struct GetCreateMultipleDepositAddressesJobStatusParams {
431 pub job_id: String,
433}
434
435#[derive(Clone, Debug)]
437#[cfg_attr(feature = "bon", derive(::bon::Builder))]
438pub struct GetMaxSpendableAmountParams {
439 pub vault_account_id: String,
441 pub asset_id: String,
443 pub manual_signging: Option<bool>,
447}
448
449#[derive(Clone, Debug)]
451#[cfg_attr(feature = "bon", derive(::bon::Builder))]
452pub struct GetPagedVaultAccountsParams {
453 pub name_prefix: Option<String>,
454 pub name_suffix: Option<String>,
455 pub min_amount_threshold: Option<f64>,
459 pub asset_id: Option<String>,
460 pub order_by: Option<String>,
461 pub before: Option<String>,
462 pub after: Option<String>,
463 pub limit: Option<f64>,
464}
465
466#[derive(Clone, Debug)]
468#[cfg_attr(feature = "bon", derive(::bon::Builder))]
469pub struct GetPublicKeyInfoParams {
470 pub derivation_path: Vec<i32>,
473 pub algorithm: String,
474 pub compressed: Option<bool>,
475}
476
477#[derive(Clone, Debug)]
480#[cfg_attr(feature = "bon", derive(::bon::Builder))]
481pub struct GetPublicKeyInfoForAddressParams {
482 pub vault_account_id: String,
483 pub asset_id: String,
484 pub change: f64,
486 pub address_index: f64,
488 pub compressed: Option<bool>,
490}
491
492#[derive(Clone, Debug)]
494#[cfg_attr(feature = "bon", derive(::bon::Builder))]
495pub struct GetUnspentInputsParams {
496 pub vault_account_id: String,
498 pub asset_id: String,
500}
501
502#[derive(Clone, Debug)]
504#[cfg_attr(feature = "bon", derive(::bon::Builder))]
505pub struct GetVaultAccountParams {
506 pub vault_account_id: String,
508}
509
510#[derive(Clone, Debug)]
512#[cfg_attr(feature = "bon", derive(::bon::Builder))]
513pub struct GetVaultAccountAssetParams {
514 pub vault_account_id: String,
516 pub asset_id: String,
518}
519
520#[derive(Clone, Debug)]
523#[cfg_attr(feature = "bon", derive(::bon::Builder))]
524pub struct GetVaultAccountAssetAddressesParams {
525 pub vault_account_id: String,
527 pub asset_id: String,
529}
530
531#[derive(Clone, Debug)]
534#[cfg_attr(feature = "bon", derive(::bon::Builder))]
535pub struct GetVaultAccountAssetAddressesPaginatedParams {
536 pub vault_account_id: String,
538 pub asset_id: String,
540 pub limit: Option<f64>,
542 pub before: Option<String>,
544 pub after: Option<String>,
546}
547
548#[derive(Clone, Debug)]
550#[cfg_attr(feature = "bon", derive(::bon::Builder))]
551pub struct GetVaultAssetsParams {
552 pub account_name_prefix: Option<String>,
553 pub account_name_suffix: Option<String>,
554}
555
556#[derive(Clone, Debug)]
558#[cfg_attr(feature = "bon", derive(::bon::Builder))]
559pub struct GetVaultBalanceByAssetParams {
560 pub asset_id: String,
561}
562
563#[derive(Clone, Debug)]
565#[cfg_attr(feature = "bon", derive(::bon::Builder))]
566pub struct HideVaultAccountParams {
567 pub vault_account_id: String,
569 pub idempotency_key: Option<String>,
574}
575
576#[derive(Clone, Debug)]
579#[cfg_attr(feature = "bon", derive(::bon::Builder))]
580pub struct SetCustomerRefIdForAddressParams {
581 pub vault_account_id: String,
583 pub asset_id: String,
585 pub address_id: String,
588 pub set_customer_ref_id_for_address_request: models::SetCustomerRefIdForAddressRequest,
589 pub idempotency_key: Option<String>,
594}
595
596#[derive(Clone, Debug)]
598#[cfg_attr(feature = "bon", derive(::bon::Builder))]
599pub struct SetVaultAccountAutoFuelParams {
600 pub vault_account_id: String,
602 pub set_auto_fuel_request: models::SetAutoFuelRequest,
603 pub idempotency_key: Option<String>,
608}
609
610#[derive(Clone, Debug)]
613#[cfg_attr(feature = "bon", derive(::bon::Builder))]
614pub struct SetVaultAccountCustomerRefIdParams {
615 pub vault_account_id: String,
617 pub set_customer_ref_id_request: models::SetCustomerRefIdRequest,
618 pub idempotency_key: Option<String>,
623}
624
625#[derive(Clone, Debug)]
627#[cfg_attr(feature = "bon", derive(::bon::Builder))]
628pub struct UnhideVaultAccountParams {
629 pub vault_account_id: String,
631 pub idempotency_key: Option<String>,
636}
637
638#[derive(Clone, Debug)]
640#[cfg_attr(feature = "bon", derive(::bon::Builder))]
641pub struct UpdateVaultAccountParams {
642 pub vault_account_id: String,
644 pub update_vault_account_request: models::UpdateVaultAccountRequest,
645 pub idempotency_key: Option<String>,
650}
651
652#[derive(Clone, Debug)]
655#[cfg_attr(feature = "bon", derive(::bon::Builder))]
656pub struct UpdateVaultAccountAssetAddressParams {
657 pub vault_account_id: String,
659 pub asset_id: String,
661 pub address_id: String,
664 pub idempotency_key: Option<String>,
669 pub update_vault_account_asset_address_request:
670 Option<models::UpdateVaultAccountAssetAddressRequest>,
671}
672
673#[derive(Clone, Debug)]
676#[cfg_attr(feature = "bon", derive(::bon::Builder))]
677pub struct UpdateVaultAccountAssetBalanceParams {
678 pub vault_account_id: String,
680 pub asset_id: String,
682 pub idempotency_key: Option<String>,
687}
688
689#[async_trait]
690impl VaultsApi for VaultsApiClient {
691 async fn activate_asset_for_vault_account(
696 &self,
697 params: ActivateAssetForVaultAccountParams,
698 ) -> Result<models::CreateVaultAssetResponse, Error<ActivateAssetForVaultAccountError>> {
699 let ActivateAssetForVaultAccountParams {
700 vault_account_id,
701 asset_id,
702 idempotency_key,
703 } = params;
704
705 let local_var_configuration = &self.configuration;
706
707 let local_var_client = &local_var_configuration.client;
708
709 let local_var_uri_str = format!(
710 "{}/vault/accounts/{vaultAccountId}/{assetId}/activate",
711 local_var_configuration.base_path,
712 vaultAccountId = crate::apis::urlencode(vault_account_id),
713 assetId = crate::apis::urlencode(asset_id)
714 );
715 let mut local_var_req_builder =
716 local_var_client.request(reqwest::Method::POST, 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 if let Some(local_var_param_value) = idempotency_key {
723 local_var_req_builder =
724 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
725 }
726
727 let local_var_req = local_var_req_builder.build()?;
728 let local_var_resp = local_var_client.execute(local_var_req).await?;
729
730 let local_var_status = local_var_resp.status();
731 let local_var_content_type = local_var_resp
732 .headers()
733 .get("content-type")
734 .and_then(|v| v.to_str().ok())
735 .unwrap_or("application/octet-stream");
736 let local_var_content_type = super::ContentType::from(local_var_content_type);
737 let local_var_content = local_var_resp.text().await?;
738
739 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
740 match local_var_content_type {
741 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
742 ContentType::Text => {
743 return Err(Error::from(serde_json::Error::custom(
744 "Received `text/plain` content type response that cannot be converted to \
745 `models::CreateVaultAssetResponse`",
746 )))
747 }
748 ContentType::Unsupported(local_var_unknown_type) => {
749 return Err(Error::from(serde_json::Error::custom(format!(
750 "Received `{local_var_unknown_type}` content type response that cannot be \
751 converted to `models::CreateVaultAssetResponse`"
752 ))))
753 }
754 }
755 } else {
756 let local_var_entity: Option<ActivateAssetForVaultAccountError> =
757 serde_json::from_str(&local_var_content).ok();
758 let local_var_error = ResponseContent {
759 status: local_var_status,
760 content: local_var_content,
761 entity: local_var_entity,
762 };
763 Err(Error::ResponseError(local_var_error))
764 }
765 }
766
767 async fn create_legacy_address(
770 &self,
771 params: CreateLegacyAddressParams,
772 ) -> Result<models::CreateAddressResponse, Error<CreateLegacyAddressError>> {
773 let CreateLegacyAddressParams {
774 vault_account_id,
775 asset_id,
776 address_id,
777 idempotency_key,
778 } = params;
779
780 let local_var_configuration = &self.configuration;
781
782 let local_var_client = &local_var_configuration.client;
783
784 let local_var_uri_str = format!(
785 "{}/vault/accounts/{vaultAccountId}/{assetId}/addresses/{addressId}/create_legacy",
786 local_var_configuration.base_path,
787 vaultAccountId = crate::apis::urlencode(vault_account_id),
788 assetId = crate::apis::urlencode(asset_id),
789 addressId = crate::apis::urlencode(address_id)
790 );
791 let mut local_var_req_builder =
792 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
793
794 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
795 local_var_req_builder = local_var_req_builder
796 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
797 }
798 if let Some(local_var_param_value) = idempotency_key {
799 local_var_req_builder =
800 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
801 }
802
803 let local_var_req = local_var_req_builder.build()?;
804 let local_var_resp = local_var_client.execute(local_var_req).await?;
805
806 let local_var_status = local_var_resp.status();
807 let local_var_content_type = local_var_resp
808 .headers()
809 .get("content-type")
810 .and_then(|v| v.to_str().ok())
811 .unwrap_or("application/octet-stream");
812 let local_var_content_type = super::ContentType::from(local_var_content_type);
813 let local_var_content = local_var_resp.text().await?;
814
815 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
816 match local_var_content_type {
817 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
818 ContentType::Text => {
819 return Err(Error::from(serde_json::Error::custom(
820 "Received `text/plain` content type response that cannot be converted to \
821 `models::CreateAddressResponse`",
822 )))
823 }
824 ContentType::Unsupported(local_var_unknown_type) => {
825 return Err(Error::from(serde_json::Error::custom(format!(
826 "Received `{local_var_unknown_type}` content type response that cannot be \
827 converted to `models::CreateAddressResponse`"
828 ))))
829 }
830 }
831 } else {
832 let local_var_entity: Option<CreateLegacyAddressError> =
833 serde_json::from_str(&local_var_content).ok();
834 let local_var_error = ResponseContent {
835 status: local_var_status,
836 content: local_var_content,
837 entity: local_var_entity,
838 };
839 Err(Error::ResponseError(local_var_error))
840 }
841 }
842
843 async fn create_multiple_deposit_addresses(
851 &self,
852 params: CreateMultipleDepositAddressesParams,
853 ) -> Result<models::JobCreated, Error<CreateMultipleDepositAddressesError>> {
854 let CreateMultipleDepositAddressesParams {
855 create_multiple_deposit_addresses_request,
856 idempotency_key,
857 } = params;
858
859 let local_var_configuration = &self.configuration;
860
861 let local_var_client = &local_var_configuration.client;
862
863 let local_var_uri_str = format!(
864 "{}/vault/accounts/addresses/bulk",
865 local_var_configuration.base_path
866 );
867 let mut local_var_req_builder =
868 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
869
870 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
871 local_var_req_builder = local_var_req_builder
872 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
873 }
874 if let Some(local_var_param_value) = idempotency_key {
875 local_var_req_builder =
876 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
877 }
878 local_var_req_builder =
879 local_var_req_builder.json(&create_multiple_deposit_addresses_request);
880
881 let local_var_req = local_var_req_builder.build()?;
882 let local_var_resp = local_var_client.execute(local_var_req).await?;
883
884 let local_var_status = local_var_resp.status();
885 let local_var_content_type = local_var_resp
886 .headers()
887 .get("content-type")
888 .and_then(|v| v.to_str().ok())
889 .unwrap_or("application/octet-stream");
890 let local_var_content_type = super::ContentType::from(local_var_content_type);
891 let local_var_content = local_var_resp.text().await?;
892
893 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
894 match local_var_content_type {
895 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
896 ContentType::Text => {
897 return Err(Error::from(serde_json::Error::custom(
898 "Received `text/plain` content type response that cannot be converted to \
899 `models::JobCreated`",
900 )))
901 }
902 ContentType::Unsupported(local_var_unknown_type) => {
903 return Err(Error::from(serde_json::Error::custom(format!(
904 "Received `{local_var_unknown_type}` content type response that cannot be \
905 converted to `models::JobCreated`"
906 ))))
907 }
908 }
909 } else {
910 let local_var_entity: Option<CreateMultipleDepositAddressesError> =
911 serde_json::from_str(&local_var_content).ok();
912 let local_var_error = ResponseContent {
913 status: local_var_status,
914 content: local_var_content,
915 entity: local_var_entity,
916 };
917 Err(Error::ResponseError(local_var_error))
918 }
919 }
920
921 async fn create_vault_account(
923 &self,
924 params: CreateVaultAccountParams,
925 ) -> Result<models::VaultAccount, Error<CreateVaultAccountError>> {
926 let CreateVaultAccountParams {
927 create_vault_account_request,
928 idempotency_key,
929 } = params;
930
931 let local_var_configuration = &self.configuration;
932
933 let local_var_client = &local_var_configuration.client;
934
935 let local_var_uri_str = format!("{}/vault/accounts", local_var_configuration.base_path);
936 let mut local_var_req_builder =
937 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
938
939 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
940 local_var_req_builder = local_var_req_builder
941 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
942 }
943 if let Some(local_var_param_value) = idempotency_key {
944 local_var_req_builder =
945 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
946 }
947 local_var_req_builder = local_var_req_builder.json(&create_vault_account_request);
948
949 let local_var_req = local_var_req_builder.build()?;
950 let local_var_resp = local_var_client.execute(local_var_req).await?;
951
952 let local_var_status = local_var_resp.status();
953 let local_var_content_type = local_var_resp
954 .headers()
955 .get("content-type")
956 .and_then(|v| v.to_str().ok())
957 .unwrap_or("application/octet-stream");
958 let local_var_content_type = super::ContentType::from(local_var_content_type);
959 let local_var_content = local_var_resp.text().await?;
960
961 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
962 match local_var_content_type {
963 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
964 ContentType::Text => {
965 return Err(Error::from(serde_json::Error::custom(
966 "Received `text/plain` content type response that cannot be converted to \
967 `models::VaultAccount`",
968 )))
969 }
970 ContentType::Unsupported(local_var_unknown_type) => {
971 return Err(Error::from(serde_json::Error::custom(format!(
972 "Received `{local_var_unknown_type}` content type response that cannot be \
973 converted to `models::VaultAccount`"
974 ))))
975 }
976 }
977 } else {
978 let local_var_entity: Option<CreateVaultAccountError> =
979 serde_json::from_str(&local_var_content).ok();
980 let local_var_error = ResponseContent {
981 status: local_var_status,
982 content: local_var_content,
983 entity: local_var_entity,
984 };
985 Err(Error::ResponseError(local_var_error))
986 }
987 }
988
989 async fn create_vault_account_asset(
991 &self,
992 params: CreateVaultAccountAssetParams,
993 ) -> Result<models::CreateVaultAssetResponse, Error<CreateVaultAccountAssetError>> {
994 let CreateVaultAccountAssetParams {
995 vault_account_id,
996 asset_id,
997 idempotency_key,
998 create_assets_request,
999 } = params;
1000
1001 let local_var_configuration = &self.configuration;
1002
1003 let local_var_client = &local_var_configuration.client;
1004
1005 let local_var_uri_str = format!(
1006 "{}/vault/accounts/{vaultAccountId}/{assetId}",
1007 local_var_configuration.base_path,
1008 vaultAccountId = crate::apis::urlencode(vault_account_id),
1009 assetId = crate::apis::urlencode(asset_id)
1010 );
1011 let mut local_var_req_builder =
1012 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1013
1014 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1015 local_var_req_builder = local_var_req_builder
1016 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1017 }
1018 if let Some(local_var_param_value) = idempotency_key {
1019 local_var_req_builder =
1020 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1021 }
1022 local_var_req_builder = local_var_req_builder.json(&create_assets_request);
1023
1024 let local_var_req = local_var_req_builder.build()?;
1025 let local_var_resp = local_var_client.execute(local_var_req).await?;
1026
1027 let local_var_status = local_var_resp.status();
1028 let local_var_content_type = local_var_resp
1029 .headers()
1030 .get("content-type")
1031 .and_then(|v| v.to_str().ok())
1032 .unwrap_or("application/octet-stream");
1033 let local_var_content_type = super::ContentType::from(local_var_content_type);
1034 let local_var_content = local_var_resp.text().await?;
1035
1036 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1037 match local_var_content_type {
1038 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1039 ContentType::Text => {
1040 return Err(Error::from(serde_json::Error::custom(
1041 "Received `text/plain` content type response that cannot be converted to \
1042 `models::CreateVaultAssetResponse`",
1043 )))
1044 }
1045 ContentType::Unsupported(local_var_unknown_type) => {
1046 return Err(Error::from(serde_json::Error::custom(format!(
1047 "Received `{local_var_unknown_type}` content type response that cannot be \
1048 converted to `models::CreateVaultAssetResponse`"
1049 ))))
1050 }
1051 }
1052 } else {
1053 let local_var_entity: Option<CreateVaultAccountAssetError> =
1054 serde_json::from_str(&local_var_content).ok();
1055 let local_var_error = ResponseContent {
1056 status: local_var_status,
1057 content: local_var_content,
1058 entity: local_var_entity,
1059 };
1060 Err(Error::ResponseError(local_var_error))
1061 }
1062 }
1063
1064 async fn create_vault_account_asset_address(
1069 &self,
1070 params: CreateVaultAccountAssetAddressParams,
1071 ) -> Result<models::CreateAddressResponse, Error<CreateVaultAccountAssetAddressError>> {
1072 let CreateVaultAccountAssetAddressParams {
1073 vault_account_id,
1074 asset_id,
1075 idempotency_key,
1076 create_address_request,
1077 } = params;
1078
1079 let local_var_configuration = &self.configuration;
1080
1081 let local_var_client = &local_var_configuration.client;
1082
1083 let local_var_uri_str = format!(
1084 "{}/vault/accounts/{vaultAccountId}/{assetId}/addresses",
1085 local_var_configuration.base_path,
1086 vaultAccountId = crate::apis::urlencode(vault_account_id),
1087 assetId = crate::apis::urlencode(asset_id)
1088 );
1089 let mut local_var_req_builder =
1090 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1091
1092 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1093 local_var_req_builder = local_var_req_builder
1094 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1095 }
1096 if let Some(local_var_param_value) = idempotency_key {
1097 local_var_req_builder =
1098 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1099 }
1100 local_var_req_builder = local_var_req_builder.json(&create_address_request);
1101
1102 let local_var_req = local_var_req_builder.build()?;
1103 let local_var_resp = local_var_client.execute(local_var_req).await?;
1104
1105 let local_var_status = local_var_resp.status();
1106 let local_var_content_type = local_var_resp
1107 .headers()
1108 .get("content-type")
1109 .and_then(|v| v.to_str().ok())
1110 .unwrap_or("application/octet-stream");
1111 let local_var_content_type = super::ContentType::from(local_var_content_type);
1112 let local_var_content = local_var_resp.text().await?;
1113
1114 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1115 match local_var_content_type {
1116 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1117 ContentType::Text => {
1118 return Err(Error::from(serde_json::Error::custom(
1119 "Received `text/plain` content type response that cannot be converted to \
1120 `models::CreateAddressResponse`",
1121 )))
1122 }
1123 ContentType::Unsupported(local_var_unknown_type) => {
1124 return Err(Error::from(serde_json::Error::custom(format!(
1125 "Received `{local_var_unknown_type}` content type response that cannot be \
1126 converted to `models::CreateAddressResponse`"
1127 ))))
1128 }
1129 }
1130 } else {
1131 let local_var_entity: Option<CreateVaultAccountAssetAddressError> =
1132 serde_json::from_str(&local_var_content).ok();
1133 let local_var_error = ResponseContent {
1134 status: local_var_status,
1135 content: local_var_content,
1136 entity: local_var_entity,
1137 };
1138 Err(Error::ResponseError(local_var_error))
1139 }
1140 }
1141
1142 async fn get_asset_wallets(
1147 &self,
1148 params: GetAssetWalletsParams,
1149 ) -> Result<models::PaginatedAssetWalletResponse, Error<GetAssetWalletsError>> {
1150 let GetAssetWalletsParams {
1151 total_amount_larger_than,
1152 asset_id,
1153 order_by,
1154 before,
1155 after,
1156 limit,
1157 } = params;
1158
1159 let local_var_configuration = &self.configuration;
1160
1161 let local_var_client = &local_var_configuration.client;
1162
1163 let local_var_uri_str =
1164 format!("{}/vault/asset_wallets", local_var_configuration.base_path);
1165 let mut local_var_req_builder =
1166 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1167
1168 if let Some(ref local_var_str) = total_amount_larger_than {
1169 local_var_req_builder = local_var_req_builder
1170 .query(&[("totalAmountLargerThan", &local_var_str.to_string())]);
1171 }
1172 if let Some(ref local_var_str) = asset_id {
1173 local_var_req_builder =
1174 local_var_req_builder.query(&[("assetId", &local_var_str.to_string())]);
1175 }
1176 if let Some(ref local_var_str) = order_by {
1177 local_var_req_builder =
1178 local_var_req_builder.query(&[("orderBy", &local_var_str.to_string())]);
1179 }
1180 if let Some(ref local_var_str) = before {
1181 local_var_req_builder =
1182 local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
1183 }
1184 if let Some(ref local_var_str) = after {
1185 local_var_req_builder =
1186 local_var_req_builder.query(&[("after", &local_var_str.to_string())]);
1187 }
1188 if let Some(ref local_var_str) = limit {
1189 local_var_req_builder =
1190 local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
1191 }
1192 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1193 local_var_req_builder = local_var_req_builder
1194 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1195 }
1196
1197 let local_var_req = local_var_req_builder.build()?;
1198 let local_var_resp = local_var_client.execute(local_var_req).await?;
1199
1200 let local_var_status = local_var_resp.status();
1201 let local_var_content_type = local_var_resp
1202 .headers()
1203 .get("content-type")
1204 .and_then(|v| v.to_str().ok())
1205 .unwrap_or("application/octet-stream");
1206 let local_var_content_type = super::ContentType::from(local_var_content_type);
1207 let local_var_content = local_var_resp.text().await?;
1208
1209 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1210 match local_var_content_type {
1211 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1212 ContentType::Text => {
1213 return Err(Error::from(serde_json::Error::custom(
1214 "Received `text/plain` content type response that cannot be converted to \
1215 `models::PaginatedAssetWalletResponse`",
1216 )))
1217 }
1218 ContentType::Unsupported(local_var_unknown_type) => {
1219 return Err(Error::from(serde_json::Error::custom(format!(
1220 "Received `{local_var_unknown_type}` content type response that cannot be \
1221 converted to `models::PaginatedAssetWalletResponse`"
1222 ))))
1223 }
1224 }
1225 } else {
1226 let local_var_entity: Option<GetAssetWalletsError> =
1227 serde_json::from_str(&local_var_content).ok();
1228 let local_var_error = ResponseContent {
1229 status: local_var_status,
1230 content: local_var_content,
1231 entity: local_var_entity,
1232 };
1233 Err(Error::ResponseError(local_var_error))
1234 }
1235 }
1236
1237 async fn get_create_multiple_deposit_addresses_job_status(
1244 &self,
1245 params: GetCreateMultipleDepositAddressesJobStatusParams,
1246 ) -> Result<
1247 models::CreateMultipleDepositAddressesJobStatus,
1248 Error<GetCreateMultipleDepositAddressesJobStatusError>,
1249 > {
1250 let GetCreateMultipleDepositAddressesJobStatusParams { job_id } = params;
1251
1252 let local_var_configuration = &self.configuration;
1253
1254 let local_var_client = &local_var_configuration.client;
1255
1256 let local_var_uri_str = format!(
1257 "{}/vault/accounts/addresses/bulk/{jobId}",
1258 local_var_configuration.base_path,
1259 jobId = crate::apis::urlencode(job_id)
1260 );
1261 let mut local_var_req_builder =
1262 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1263
1264 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1265 local_var_req_builder = local_var_req_builder
1266 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1267 }
1268
1269 let local_var_req = local_var_req_builder.build()?;
1270 let local_var_resp = local_var_client.execute(local_var_req).await?;
1271
1272 let local_var_status = local_var_resp.status();
1273 let local_var_content_type = local_var_resp
1274 .headers()
1275 .get("content-type")
1276 .and_then(|v| v.to_str().ok())
1277 .unwrap_or("application/octet-stream");
1278 let local_var_content_type = super::ContentType::from(local_var_content_type);
1279 let local_var_content = local_var_resp.text().await?;
1280
1281 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1282 match local_var_content_type {
1283 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1284 ContentType::Text => {
1285 return Err(Error::from(serde_json::Error::custom(
1286 "Received `text/plain` content type response that cannot be converted to \
1287 `models::CreateMultipleDepositAddressesJobStatus`",
1288 )))
1289 }
1290 ContentType::Unsupported(local_var_unknown_type) => {
1291 return Err(Error::from(serde_json::Error::custom(format!(
1292 "Received `{local_var_unknown_type}` content type response that cannot be \
1293 converted to `models::CreateMultipleDepositAddressesJobStatus`"
1294 ))))
1295 }
1296 }
1297 } else {
1298 let local_var_entity: Option<GetCreateMultipleDepositAddressesJobStatusError> =
1299 serde_json::from_str(&local_var_content).ok();
1300 let local_var_error = ResponseContent {
1301 status: local_var_status,
1302 content: local_var_content,
1303 entity: local_var_entity,
1304 };
1305 Err(Error::ResponseError(local_var_error))
1306 }
1307 }
1308
1309 async fn get_max_spendable_amount(
1314 &self,
1315 params: GetMaxSpendableAmountParams,
1316 ) -> Result<models::GetMaxSpendableAmountResponse, Error<GetMaxSpendableAmountError>> {
1317 let GetMaxSpendableAmountParams {
1318 vault_account_id,
1319 asset_id,
1320 manual_signging,
1321 } = params;
1322
1323 let local_var_configuration = &self.configuration;
1324
1325 let local_var_client = &local_var_configuration.client;
1326
1327 let local_var_uri_str = format!(
1328 "{}/vault/accounts/{vaultAccountId}/{assetId}/max_spendable_amount",
1329 local_var_configuration.base_path,
1330 vaultAccountId = crate::apis::urlencode(vault_account_id),
1331 assetId = crate::apis::urlencode(asset_id)
1332 );
1333 let mut local_var_req_builder =
1334 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1335
1336 if let Some(ref local_var_str) = manual_signging {
1337 local_var_req_builder =
1338 local_var_req_builder.query(&[("manualSignging", &local_var_str.to_string())]);
1339 }
1340 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1341 local_var_req_builder = local_var_req_builder
1342 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1343 }
1344
1345 let local_var_req = local_var_req_builder.build()?;
1346 let local_var_resp = local_var_client.execute(local_var_req).await?;
1347
1348 let local_var_status = local_var_resp.status();
1349 let local_var_content_type = local_var_resp
1350 .headers()
1351 .get("content-type")
1352 .and_then(|v| v.to_str().ok())
1353 .unwrap_or("application/octet-stream");
1354 let local_var_content_type = super::ContentType::from(local_var_content_type);
1355 let local_var_content = local_var_resp.text().await?;
1356
1357 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1358 match local_var_content_type {
1359 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1360 ContentType::Text => {
1361 return Err(Error::from(serde_json::Error::custom(
1362 "Received `text/plain` content type response that cannot be converted to \
1363 `models::GetMaxSpendableAmountResponse`",
1364 )))
1365 }
1366 ContentType::Unsupported(local_var_unknown_type) => {
1367 return Err(Error::from(serde_json::Error::custom(format!(
1368 "Received `{local_var_unknown_type}` content type response that cannot be \
1369 converted to `models::GetMaxSpendableAmountResponse`"
1370 ))))
1371 }
1372 }
1373 } else {
1374 let local_var_entity: Option<GetMaxSpendableAmountError> =
1375 serde_json::from_str(&local_var_content).ok();
1376 let local_var_error = ResponseContent {
1377 status: local_var_status,
1378 content: local_var_content,
1379 entity: local_var_entity,
1380 };
1381 Err(Error::ResponseError(local_var_error))
1382 }
1383 }
1384
1385 async fn get_paged_vault_accounts(
1389 &self,
1390 params: GetPagedVaultAccountsParams,
1391 ) -> Result<models::VaultAccountsPagedResponse, Error<GetPagedVaultAccountsError>> {
1392 let GetPagedVaultAccountsParams {
1393 name_prefix,
1394 name_suffix,
1395 min_amount_threshold,
1396 asset_id,
1397 order_by,
1398 before,
1399 after,
1400 limit,
1401 } = params;
1402
1403 let local_var_configuration = &self.configuration;
1404
1405 let local_var_client = &local_var_configuration.client;
1406
1407 let local_var_uri_str =
1408 format!("{}/vault/accounts_paged", local_var_configuration.base_path);
1409 let mut local_var_req_builder =
1410 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1411
1412 if let Some(ref local_var_str) = name_prefix {
1413 local_var_req_builder =
1414 local_var_req_builder.query(&[("namePrefix", &local_var_str.to_string())]);
1415 }
1416 if let Some(ref local_var_str) = name_suffix {
1417 local_var_req_builder =
1418 local_var_req_builder.query(&[("nameSuffix", &local_var_str.to_string())]);
1419 }
1420 if let Some(ref local_var_str) = min_amount_threshold {
1421 local_var_req_builder =
1422 local_var_req_builder.query(&[("minAmountThreshold", &local_var_str.to_string())]);
1423 }
1424 if let Some(ref local_var_str) = asset_id {
1425 local_var_req_builder =
1426 local_var_req_builder.query(&[("assetId", &local_var_str.to_string())]);
1427 }
1428 if let Some(ref local_var_str) = order_by {
1429 local_var_req_builder =
1430 local_var_req_builder.query(&[("orderBy", &local_var_str.to_string())]);
1431 }
1432 if let Some(ref local_var_str) = before {
1433 local_var_req_builder =
1434 local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
1435 }
1436 if let Some(ref local_var_str) = after {
1437 local_var_req_builder =
1438 local_var_req_builder.query(&[("after", &local_var_str.to_string())]);
1439 }
1440 if let Some(ref local_var_str) = limit {
1441 local_var_req_builder =
1442 local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
1443 }
1444 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1445 local_var_req_builder = local_var_req_builder
1446 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1447 }
1448
1449 let local_var_req = local_var_req_builder.build()?;
1450 let local_var_resp = local_var_client.execute(local_var_req).await?;
1451
1452 let local_var_status = local_var_resp.status();
1453 let local_var_content_type = local_var_resp
1454 .headers()
1455 .get("content-type")
1456 .and_then(|v| v.to_str().ok())
1457 .unwrap_or("application/octet-stream");
1458 let local_var_content_type = super::ContentType::from(local_var_content_type);
1459 let local_var_content = local_var_resp.text().await?;
1460
1461 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1462 match local_var_content_type {
1463 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1464 ContentType::Text => {
1465 return Err(Error::from(serde_json::Error::custom(
1466 "Received `text/plain` content type response that cannot be converted to \
1467 `models::VaultAccountsPagedResponse`",
1468 )))
1469 }
1470 ContentType::Unsupported(local_var_unknown_type) => {
1471 return Err(Error::from(serde_json::Error::custom(format!(
1472 "Received `{local_var_unknown_type}` content type response that cannot be \
1473 converted to `models::VaultAccountsPagedResponse`"
1474 ))))
1475 }
1476 }
1477 } else {
1478 let local_var_entity: Option<GetPagedVaultAccountsError> =
1479 serde_json::from_str(&local_var_content).ok();
1480 let local_var_error = ResponseContent {
1481 status: local_var_status,
1482 content: local_var_content,
1483 entity: local_var_entity,
1484 };
1485 Err(Error::ResponseError(local_var_error))
1486 }
1487 }
1488
1489 async fn get_public_key_info(
1492 &self,
1493 params: GetPublicKeyInfoParams,
1494 ) -> Result<models::PublicKeyInformation, Error<GetPublicKeyInfoError>> {
1495 let GetPublicKeyInfoParams {
1496 derivation_path,
1497 algorithm,
1498 compressed,
1499 } = params;
1500
1501 let local_var_configuration = &self.configuration;
1502
1503 let local_var_client = &local_var_configuration.client;
1504
1505 let local_var_uri_str = format!(
1506 "{}/vault/public_key_info",
1507 local_var_configuration.base_path
1508 );
1509 let mut local_var_req_builder =
1510 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1511
1512 local_var_req_builder = match "multi" {
1513 "multi" => local_var_req_builder.query(
1514 &derivation_path
1515 .into_iter()
1516 .map(|p| ("derivationPath".to_owned(), p.to_string()))
1517 .collect::<Vec<(std::string::String, std::string::String)>>(),
1518 ),
1519 _ => local_var_req_builder.query(&[(
1520 "derivationPath",
1521 &derivation_path
1522 .into_iter()
1523 .map(|p| p.to_string())
1524 .collect::<Vec<String>>()
1525 .join(",")
1526 .to_string(),
1527 )]),
1528 };
1529 local_var_req_builder =
1530 local_var_req_builder.query(&[("algorithm", &algorithm.to_string())]);
1531 if let Some(ref local_var_str) = compressed {
1532 local_var_req_builder =
1533 local_var_req_builder.query(&[("compressed", &local_var_str.to_string())]);
1534 }
1535 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1536 local_var_req_builder = local_var_req_builder
1537 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1538 }
1539
1540 let local_var_req = local_var_req_builder.build()?;
1541 let local_var_resp = local_var_client.execute(local_var_req).await?;
1542
1543 let local_var_status = local_var_resp.status();
1544 let local_var_content_type = local_var_resp
1545 .headers()
1546 .get("content-type")
1547 .and_then(|v| v.to_str().ok())
1548 .unwrap_or("application/octet-stream");
1549 let local_var_content_type = super::ContentType::from(local_var_content_type);
1550 let local_var_content = local_var_resp.text().await?;
1551
1552 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1553 match local_var_content_type {
1554 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1555 ContentType::Text => {
1556 return Err(Error::from(serde_json::Error::custom(
1557 "Received `text/plain` content type response that cannot be converted to \
1558 `models::PublicKeyInformation`",
1559 )))
1560 }
1561 ContentType::Unsupported(local_var_unknown_type) => {
1562 return Err(Error::from(serde_json::Error::custom(format!(
1563 "Received `{local_var_unknown_type}` content type response that cannot be \
1564 converted to `models::PublicKeyInformation`"
1565 ))))
1566 }
1567 }
1568 } else {
1569 let local_var_entity: Option<GetPublicKeyInfoError> =
1570 serde_json::from_str(&local_var_content).ok();
1571 let local_var_error = ResponseContent {
1572 status: local_var_status,
1573 content: local_var_content,
1574 entity: local_var_entity,
1575 };
1576 Err(Error::ResponseError(local_var_error))
1577 }
1578 }
1579
1580 async fn get_public_key_info_for_address(
1583 &self,
1584 params: GetPublicKeyInfoForAddressParams,
1585 ) -> Result<models::PublicKeyInformation, Error<GetPublicKeyInfoForAddressError>> {
1586 let GetPublicKeyInfoForAddressParams {
1587 vault_account_id,
1588 asset_id,
1589 change,
1590 address_index,
1591 compressed,
1592 } = params;
1593
1594 let local_var_configuration = &self.configuration;
1595
1596 let local_var_client = &local_var_configuration.client;
1597
1598 let local_var_uri_str = format!(
1599 "{}/vault/accounts/{vaultAccountId}/{assetId}/{change}/{addressIndex}/public_key_info",
1600 local_var_configuration.base_path,
1601 vaultAccountId = crate::apis::urlencode(vault_account_id),
1602 assetId = crate::apis::urlencode(asset_id),
1603 change = change,
1604 addressIndex = address_index
1605 );
1606 let mut local_var_req_builder =
1607 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1608
1609 if let Some(ref local_var_str) = compressed {
1610 local_var_req_builder =
1611 local_var_req_builder.query(&[("compressed", &local_var_str.to_string())]);
1612 }
1613 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1614 local_var_req_builder = local_var_req_builder
1615 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1616 }
1617
1618 let local_var_req = local_var_req_builder.build()?;
1619 let local_var_resp = local_var_client.execute(local_var_req).await?;
1620
1621 let local_var_status = local_var_resp.status();
1622 let local_var_content_type = local_var_resp
1623 .headers()
1624 .get("content-type")
1625 .and_then(|v| v.to_str().ok())
1626 .unwrap_or("application/octet-stream");
1627 let local_var_content_type = super::ContentType::from(local_var_content_type);
1628 let local_var_content = local_var_resp.text().await?;
1629
1630 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1631 match local_var_content_type {
1632 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1633 ContentType::Text => {
1634 return Err(Error::from(serde_json::Error::custom(
1635 "Received `text/plain` content type response that cannot be converted to \
1636 `models::PublicKeyInformation`",
1637 )))
1638 }
1639 ContentType::Unsupported(local_var_unknown_type) => {
1640 return Err(Error::from(serde_json::Error::custom(format!(
1641 "Received `{local_var_unknown_type}` content type response that cannot be \
1642 converted to `models::PublicKeyInformation`"
1643 ))))
1644 }
1645 }
1646 } else {
1647 let local_var_entity: Option<GetPublicKeyInfoForAddressError> =
1648 serde_json::from_str(&local_var_content).ok();
1649 let local_var_error = ResponseContent {
1650 status: local_var_status,
1651 content: local_var_content,
1652 entity: local_var_entity,
1653 };
1654 Err(Error::ResponseError(local_var_error))
1655 }
1656 }
1657
1658 async fn get_unspent_inputs(
1662 &self,
1663 params: GetUnspentInputsParams,
1664 ) -> Result<Vec<models::UnspentInputsResponse>, Error<GetUnspentInputsError>> {
1665 let GetUnspentInputsParams {
1666 vault_account_id,
1667 asset_id,
1668 } = params;
1669
1670 let local_var_configuration = &self.configuration;
1671
1672 let local_var_client = &local_var_configuration.client;
1673
1674 let local_var_uri_str = format!(
1675 "{}/vault/accounts/{vaultAccountId}/{assetId}/unspent_inputs",
1676 local_var_configuration.base_path,
1677 vaultAccountId = crate::apis::urlencode(vault_account_id),
1678 assetId = crate::apis::urlencode(asset_id)
1679 );
1680 let mut local_var_req_builder =
1681 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1682
1683 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1684 local_var_req_builder = local_var_req_builder
1685 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1686 }
1687
1688 let local_var_req = local_var_req_builder.build()?;
1689 let local_var_resp = local_var_client.execute(local_var_req).await?;
1690
1691 let local_var_status = local_var_resp.status();
1692 let local_var_content_type = local_var_resp
1693 .headers()
1694 .get("content-type")
1695 .and_then(|v| v.to_str().ok())
1696 .unwrap_or("application/octet-stream");
1697 let local_var_content_type = super::ContentType::from(local_var_content_type);
1698 let local_var_content = local_var_resp.text().await?;
1699
1700 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1701 match local_var_content_type {
1702 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1703 ContentType::Text => {
1704 return Err(Error::from(serde_json::Error::custom(
1705 "Received `text/plain` content type response that cannot be converted to \
1706 `Vec<models::UnspentInputsResponse>`",
1707 )))
1708 }
1709 ContentType::Unsupported(local_var_unknown_type) => {
1710 return Err(Error::from(serde_json::Error::custom(format!(
1711 "Received `{local_var_unknown_type}` content type response that cannot be \
1712 converted to `Vec<models::UnspentInputsResponse>`"
1713 ))))
1714 }
1715 }
1716 } else {
1717 let local_var_entity: Option<GetUnspentInputsError> =
1718 serde_json::from_str(&local_var_content).ok();
1719 let local_var_error = ResponseContent {
1720 status: local_var_status,
1721 content: local_var_content,
1722 entity: local_var_entity,
1723 };
1724 Err(Error::ResponseError(local_var_error))
1725 }
1726 }
1727
1728 async fn get_vault_account(
1731 &self,
1732 params: GetVaultAccountParams,
1733 ) -> Result<models::VaultAccount, Error<GetVaultAccountError>> {
1734 let GetVaultAccountParams { vault_account_id } = params;
1735
1736 let local_var_configuration = &self.configuration;
1737
1738 let local_var_client = &local_var_configuration.client;
1739
1740 let local_var_uri_str = format!(
1741 "{}/vault/accounts/{vaultAccountId}",
1742 local_var_configuration.base_path,
1743 vaultAccountId = crate::apis::urlencode(vault_account_id)
1744 );
1745 let mut local_var_req_builder =
1746 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1747
1748 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1749 local_var_req_builder = local_var_req_builder
1750 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1751 }
1752
1753 let local_var_req = local_var_req_builder.build()?;
1754 let local_var_resp = local_var_client.execute(local_var_req).await?;
1755
1756 let local_var_status = local_var_resp.status();
1757 let local_var_content_type = local_var_resp
1758 .headers()
1759 .get("content-type")
1760 .and_then(|v| v.to_str().ok())
1761 .unwrap_or("application/octet-stream");
1762 let local_var_content_type = super::ContentType::from(local_var_content_type);
1763 let local_var_content = local_var_resp.text().await?;
1764
1765 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1766 match local_var_content_type {
1767 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1768 ContentType::Text => {
1769 return Err(Error::from(serde_json::Error::custom(
1770 "Received `text/plain` content type response that cannot be converted to \
1771 `models::VaultAccount`",
1772 )))
1773 }
1774 ContentType::Unsupported(local_var_unknown_type) => {
1775 return Err(Error::from(serde_json::Error::custom(format!(
1776 "Received `{local_var_unknown_type}` content type response that cannot be \
1777 converted to `models::VaultAccount`"
1778 ))))
1779 }
1780 }
1781 } else {
1782 let local_var_entity: Option<GetVaultAccountError> =
1783 serde_json::from_str(&local_var_content).ok();
1784 let local_var_error = ResponseContent {
1785 status: local_var_status,
1786 content: local_var_content,
1787 entity: local_var_entity,
1788 };
1789 Err(Error::ResponseError(local_var_error))
1790 }
1791 }
1792
1793 async fn get_vault_account_asset(
1797 &self,
1798 params: GetVaultAccountAssetParams,
1799 ) -> Result<models::VaultAsset, Error<GetVaultAccountAssetError>> {
1800 let GetVaultAccountAssetParams {
1801 vault_account_id,
1802 asset_id,
1803 } = params;
1804
1805 let local_var_configuration = &self.configuration;
1806
1807 let local_var_client = &local_var_configuration.client;
1808
1809 let local_var_uri_str = format!(
1810 "{}/vault/accounts/{vaultAccountId}/{assetId}",
1811 local_var_configuration.base_path,
1812 vaultAccountId = crate::apis::urlencode(vault_account_id),
1813 assetId = crate::apis::urlencode(asset_id)
1814 );
1815 let mut local_var_req_builder =
1816 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1817
1818 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1819 local_var_req_builder = local_var_req_builder
1820 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1821 }
1822
1823 let local_var_req = local_var_req_builder.build()?;
1824 let local_var_resp = local_var_client.execute(local_var_req).await?;
1825
1826 let local_var_status = local_var_resp.status();
1827 let local_var_content_type = local_var_resp
1828 .headers()
1829 .get("content-type")
1830 .and_then(|v| v.to_str().ok())
1831 .unwrap_or("application/octet-stream");
1832 let local_var_content_type = super::ContentType::from(local_var_content_type);
1833 let local_var_content = local_var_resp.text().await?;
1834
1835 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1836 match local_var_content_type {
1837 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1838 ContentType::Text => {
1839 return Err(Error::from(serde_json::Error::custom(
1840 "Received `text/plain` content type response that cannot be converted to \
1841 `models::VaultAsset`",
1842 )))
1843 }
1844 ContentType::Unsupported(local_var_unknown_type) => {
1845 return Err(Error::from(serde_json::Error::custom(format!(
1846 "Received `{local_var_unknown_type}` content type response that cannot be \
1847 converted to `models::VaultAsset`"
1848 ))))
1849 }
1850 }
1851 } else {
1852 let local_var_entity: Option<GetVaultAccountAssetError> =
1853 serde_json::from_str(&local_var_content).ok();
1854 let local_var_error = ResponseContent {
1855 status: local_var_status,
1856 content: local_var_content,
1857 entity: local_var_entity,
1858 };
1859 Err(Error::ResponseError(local_var_error))
1860 }
1861 }
1862
1863 async fn get_vault_account_asset_addresses(
1875 &self,
1876 params: GetVaultAccountAssetAddressesParams,
1877 ) -> Result<Vec<models::VaultWalletAddress>, Error<GetVaultAccountAssetAddressesError>> {
1878 let GetVaultAccountAssetAddressesParams {
1879 vault_account_id,
1880 asset_id,
1881 } = params;
1882
1883 let local_var_configuration = &self.configuration;
1884
1885 let local_var_client = &local_var_configuration.client;
1886
1887 let local_var_uri_str = format!(
1888 "{}/vault/accounts/{vaultAccountId}/{assetId}/addresses",
1889 local_var_configuration.base_path,
1890 vaultAccountId = crate::apis::urlencode(vault_account_id),
1891 assetId = crate::apis::urlencode(asset_id)
1892 );
1893 let mut local_var_req_builder =
1894 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1895
1896 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1897 local_var_req_builder = local_var_req_builder
1898 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1899 }
1900
1901 let local_var_req = local_var_req_builder.build()?;
1902 let local_var_resp = local_var_client.execute(local_var_req).await?;
1903
1904 let local_var_status = local_var_resp.status();
1905 let local_var_content_type = local_var_resp
1906 .headers()
1907 .get("content-type")
1908 .and_then(|v| v.to_str().ok())
1909 .unwrap_or("application/octet-stream");
1910 let local_var_content_type = super::ContentType::from(local_var_content_type);
1911 let local_var_content = local_var_resp.text().await?;
1912
1913 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1914 match local_var_content_type {
1915 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1916 ContentType::Text => {
1917 return Err(Error::from(serde_json::Error::custom(
1918 "Received `text/plain` content type response that cannot be converted to \
1919 `Vec<models::VaultWalletAddress>`",
1920 )))
1921 }
1922 ContentType::Unsupported(local_var_unknown_type) => {
1923 return Err(Error::from(serde_json::Error::custom(format!(
1924 "Received `{local_var_unknown_type}` content type response that cannot be \
1925 converted to `Vec<models::VaultWalletAddress>`"
1926 ))))
1927 }
1928 }
1929 } else {
1930 let local_var_entity: Option<GetVaultAccountAssetAddressesError> =
1931 serde_json::from_str(&local_var_content).ok();
1932 let local_var_error = ResponseContent {
1933 status: local_var_status,
1934 content: local_var_content,
1935 entity: local_var_entity,
1936 };
1937 Err(Error::ResponseError(local_var_error))
1938 }
1939 }
1940
1941 async fn get_vault_account_asset_addresses_paginated(
1945 &self,
1946 params: GetVaultAccountAssetAddressesPaginatedParams,
1947 ) -> Result<models::PaginatedAddressResponse, Error<GetVaultAccountAssetAddressesPaginatedError>>
1948 {
1949 let GetVaultAccountAssetAddressesPaginatedParams {
1950 vault_account_id,
1951 asset_id,
1952 limit,
1953 before,
1954 after,
1955 } = params;
1956
1957 let local_var_configuration = &self.configuration;
1958
1959 let local_var_client = &local_var_configuration.client;
1960
1961 let local_var_uri_str = format!(
1962 "{}/vault/accounts/{vaultAccountId}/{assetId}/addresses_paginated",
1963 local_var_configuration.base_path,
1964 vaultAccountId = crate::apis::urlencode(vault_account_id),
1965 assetId = crate::apis::urlencode(asset_id)
1966 );
1967 let mut local_var_req_builder =
1968 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1969
1970 if let Some(ref local_var_str) = limit {
1971 local_var_req_builder =
1972 local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
1973 }
1974 if let Some(ref local_var_str) = before {
1975 local_var_req_builder =
1976 local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
1977 }
1978 if let Some(ref local_var_str) = after {
1979 local_var_req_builder =
1980 local_var_req_builder.query(&[("after", &local_var_str.to_string())]);
1981 }
1982 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1983 local_var_req_builder = local_var_req_builder
1984 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1985 }
1986
1987 let local_var_req = local_var_req_builder.build()?;
1988 let local_var_resp = local_var_client.execute(local_var_req).await?;
1989
1990 let local_var_status = local_var_resp.status();
1991 let local_var_content_type = local_var_resp
1992 .headers()
1993 .get("content-type")
1994 .and_then(|v| v.to_str().ok())
1995 .unwrap_or("application/octet-stream");
1996 let local_var_content_type = super::ContentType::from(local_var_content_type);
1997 let local_var_content = local_var_resp.text().await?;
1998
1999 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2000 match local_var_content_type {
2001 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2002 ContentType::Text => {
2003 return Err(Error::from(serde_json::Error::custom(
2004 "Received `text/plain` content type response that cannot be converted to \
2005 `models::PaginatedAddressResponse`",
2006 )))
2007 }
2008 ContentType::Unsupported(local_var_unknown_type) => {
2009 return Err(Error::from(serde_json::Error::custom(format!(
2010 "Received `{local_var_unknown_type}` content type response that cannot be \
2011 converted to `models::PaginatedAddressResponse`"
2012 ))))
2013 }
2014 }
2015 } else {
2016 let local_var_entity: Option<GetVaultAccountAssetAddressesPaginatedError> =
2017 serde_json::from_str(&local_var_content).ok();
2018 let local_var_error = ResponseContent {
2019 status: local_var_status,
2020 content: local_var_content,
2021 entity: local_var_entity,
2022 };
2023 Err(Error::ResponseError(local_var_error))
2024 }
2025 }
2026
2027 async fn get_vault_assets(
2031 &self,
2032 params: GetVaultAssetsParams,
2033 ) -> Result<Vec<models::VaultAsset>, Error<GetVaultAssetsError>> {
2034 let GetVaultAssetsParams {
2035 account_name_prefix,
2036 account_name_suffix,
2037 } = params;
2038
2039 let local_var_configuration = &self.configuration;
2040
2041 let local_var_client = &local_var_configuration.client;
2042
2043 let local_var_uri_str = format!("{}/vault/assets", local_var_configuration.base_path);
2044 let mut local_var_req_builder =
2045 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2046
2047 if let Some(ref local_var_str) = account_name_prefix {
2048 local_var_req_builder =
2049 local_var_req_builder.query(&[("accountNamePrefix", &local_var_str.to_string())]);
2050 }
2051 if let Some(ref local_var_str) = account_name_suffix {
2052 local_var_req_builder =
2053 local_var_req_builder.query(&[("accountNameSuffix", &local_var_str.to_string())]);
2054 }
2055 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2056 local_var_req_builder = local_var_req_builder
2057 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2058 }
2059
2060 let local_var_req = local_var_req_builder.build()?;
2061 let local_var_resp = local_var_client.execute(local_var_req).await?;
2062
2063 let local_var_status = local_var_resp.status();
2064 let local_var_content_type = local_var_resp
2065 .headers()
2066 .get("content-type")
2067 .and_then(|v| v.to_str().ok())
2068 .unwrap_or("application/octet-stream");
2069 let local_var_content_type = super::ContentType::from(local_var_content_type);
2070 let local_var_content = local_var_resp.text().await?;
2071
2072 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2073 match local_var_content_type {
2074 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2075 ContentType::Text => {
2076 return Err(Error::from(serde_json::Error::custom(
2077 "Received `text/plain` content type response that cannot be converted to \
2078 `Vec<models::VaultAsset>`",
2079 )))
2080 }
2081 ContentType::Unsupported(local_var_unknown_type) => {
2082 return Err(Error::from(serde_json::Error::custom(format!(
2083 "Received `{local_var_unknown_type}` content type response that cannot be \
2084 converted to `Vec<models::VaultAsset>`"
2085 ))))
2086 }
2087 }
2088 } else {
2089 let local_var_entity: Option<GetVaultAssetsError> =
2090 serde_json::from_str(&local_var_content).ok();
2091 let local_var_error = ResponseContent {
2092 status: local_var_status,
2093 content: local_var_content,
2094 entity: local_var_entity,
2095 };
2096 Err(Error::ResponseError(local_var_error))
2097 }
2098 }
2099
2100 async fn get_vault_balance_by_asset(
2104 &self,
2105 params: GetVaultBalanceByAssetParams,
2106 ) -> Result<models::VaultAsset, Error<GetVaultBalanceByAssetError>> {
2107 let GetVaultBalanceByAssetParams { asset_id } = params;
2108
2109 let local_var_configuration = &self.configuration;
2110
2111 let local_var_client = &local_var_configuration.client;
2112
2113 let local_var_uri_str = format!(
2114 "{}/vault/assets/{assetId}",
2115 local_var_configuration.base_path,
2116 assetId = crate::apis::urlencode(asset_id)
2117 );
2118 let mut local_var_req_builder =
2119 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2120
2121 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2122 local_var_req_builder = local_var_req_builder
2123 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2124 }
2125
2126 let local_var_req = local_var_req_builder.build()?;
2127 let local_var_resp = local_var_client.execute(local_var_req).await?;
2128
2129 let local_var_status = local_var_resp.status();
2130 let local_var_content_type = local_var_resp
2131 .headers()
2132 .get("content-type")
2133 .and_then(|v| v.to_str().ok())
2134 .unwrap_or("application/octet-stream");
2135 let local_var_content_type = super::ContentType::from(local_var_content_type);
2136 let local_var_content = local_var_resp.text().await?;
2137
2138 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2139 match local_var_content_type {
2140 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2141 ContentType::Text => {
2142 return Err(Error::from(serde_json::Error::custom(
2143 "Received `text/plain` content type response that cannot be converted to \
2144 `models::VaultAsset`",
2145 )))
2146 }
2147 ContentType::Unsupported(local_var_unknown_type) => {
2148 return Err(Error::from(serde_json::Error::custom(format!(
2149 "Received `{local_var_unknown_type}` content type response that cannot be \
2150 converted to `models::VaultAsset`"
2151 ))))
2152 }
2153 }
2154 } else {
2155 let local_var_entity: Option<GetVaultBalanceByAssetError> =
2156 serde_json::from_str(&local_var_content).ok();
2157 let local_var_error = ResponseContent {
2158 status: local_var_status,
2159 content: local_var_content,
2160 entity: local_var_entity,
2161 };
2162 Err(Error::ResponseError(local_var_error))
2163 }
2164 }
2165
2166 async fn hide_vault_account(
2168 &self,
2169 params: HideVaultAccountParams,
2170 ) -> Result<models::VaultActionStatus, Error<HideVaultAccountError>> {
2171 let HideVaultAccountParams {
2172 vault_account_id,
2173 idempotency_key,
2174 } = params;
2175
2176 let local_var_configuration = &self.configuration;
2177
2178 let local_var_client = &local_var_configuration.client;
2179
2180 let local_var_uri_str = format!(
2181 "{}/vault/accounts/{vaultAccountId}/hide",
2182 local_var_configuration.base_path,
2183 vaultAccountId = crate::apis::urlencode(vault_account_id)
2184 );
2185 let mut local_var_req_builder =
2186 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2187
2188 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2189 local_var_req_builder = local_var_req_builder
2190 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2191 }
2192 if let Some(local_var_param_value) = idempotency_key {
2193 local_var_req_builder =
2194 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
2195 }
2196
2197 let local_var_req = local_var_req_builder.build()?;
2198 let local_var_resp = local_var_client.execute(local_var_req).await?;
2199
2200 let local_var_status = local_var_resp.status();
2201 let local_var_content_type = local_var_resp
2202 .headers()
2203 .get("content-type")
2204 .and_then(|v| v.to_str().ok())
2205 .unwrap_or("application/octet-stream");
2206 let local_var_content_type = super::ContentType::from(local_var_content_type);
2207 let local_var_content = local_var_resp.text().await?;
2208
2209 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2210 match local_var_content_type {
2211 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2212 ContentType::Text => {
2213 return Err(Error::from(serde_json::Error::custom(
2214 "Received `text/plain` content type response that cannot be converted to \
2215 `models::VaultActionStatus`",
2216 )))
2217 }
2218 ContentType::Unsupported(local_var_unknown_type) => {
2219 return Err(Error::from(serde_json::Error::custom(format!(
2220 "Received `{local_var_unknown_type}` content type response that cannot be \
2221 converted to `models::VaultActionStatus`"
2222 ))))
2223 }
2224 }
2225 } else {
2226 let local_var_entity: Option<HideVaultAccountError> =
2227 serde_json::from_str(&local_var_content).ok();
2228 let local_var_error = ResponseContent {
2229 status: local_var_status,
2230 content: local_var_content,
2231 entity: local_var_entity,
2232 };
2233 Err(Error::ResponseError(local_var_error))
2234 }
2235 }
2236
2237 async fn set_customer_ref_id_for_address(
2240 &self,
2241 params: SetCustomerRefIdForAddressParams,
2242 ) -> Result<models::VaultActionStatus, Error<SetCustomerRefIdForAddressError>> {
2243 let SetCustomerRefIdForAddressParams {
2244 vault_account_id,
2245 asset_id,
2246 address_id,
2247 set_customer_ref_id_for_address_request,
2248 idempotency_key,
2249 } = params;
2250
2251 let local_var_configuration = &self.configuration;
2252
2253 let local_var_client = &local_var_configuration.client;
2254
2255 let local_var_uri_str = format!(
2256 "{}/vault/accounts/{vaultAccountId}/{assetId}/addresses/{addressId}/\
2257 set_customer_ref_id",
2258 local_var_configuration.base_path,
2259 vaultAccountId = crate::apis::urlencode(vault_account_id),
2260 assetId = crate::apis::urlencode(asset_id),
2261 addressId = crate::apis::urlencode(address_id)
2262 );
2263 let mut local_var_req_builder =
2264 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2265
2266 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2267 local_var_req_builder = local_var_req_builder
2268 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2269 }
2270 if let Some(local_var_param_value) = idempotency_key {
2271 local_var_req_builder =
2272 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
2273 }
2274 local_var_req_builder =
2275 local_var_req_builder.json(&set_customer_ref_id_for_address_request);
2276
2277 let local_var_req = local_var_req_builder.build()?;
2278 let local_var_resp = local_var_client.execute(local_var_req).await?;
2279
2280 let local_var_status = local_var_resp.status();
2281 let local_var_content_type = local_var_resp
2282 .headers()
2283 .get("content-type")
2284 .and_then(|v| v.to_str().ok())
2285 .unwrap_or("application/octet-stream");
2286 let local_var_content_type = super::ContentType::from(local_var_content_type);
2287 let local_var_content = local_var_resp.text().await?;
2288
2289 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2290 match local_var_content_type {
2291 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2292 ContentType::Text => {
2293 return Err(Error::from(serde_json::Error::custom(
2294 "Received `text/plain` content type response that cannot be converted to \
2295 `models::VaultActionStatus`",
2296 )))
2297 }
2298 ContentType::Unsupported(local_var_unknown_type) => {
2299 return Err(Error::from(serde_json::Error::custom(format!(
2300 "Received `{local_var_unknown_type}` content type response that cannot be \
2301 converted to `models::VaultActionStatus`"
2302 ))))
2303 }
2304 }
2305 } else {
2306 let local_var_entity: Option<SetCustomerRefIdForAddressError> =
2307 serde_json::from_str(&local_var_content).ok();
2308 let local_var_error = ResponseContent {
2309 status: local_var_status,
2310 content: local_var_content,
2311 entity: local_var_entity,
2312 };
2313 Err(Error::ResponseError(local_var_error))
2314 }
2315 }
2316
2317 async fn set_vault_account_auto_fuel(
2319 &self,
2320 params: SetVaultAccountAutoFuelParams,
2321 ) -> Result<models::VaultActionStatus, Error<SetVaultAccountAutoFuelError>> {
2322 let SetVaultAccountAutoFuelParams {
2323 vault_account_id,
2324 set_auto_fuel_request,
2325 idempotency_key,
2326 } = params;
2327
2328 let local_var_configuration = &self.configuration;
2329
2330 let local_var_client = &local_var_configuration.client;
2331
2332 let local_var_uri_str = format!(
2333 "{}/vault/accounts/{vaultAccountId}/set_auto_fuel",
2334 local_var_configuration.base_path,
2335 vaultAccountId = crate::apis::urlencode(vault_account_id)
2336 );
2337 let mut local_var_req_builder =
2338 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2339
2340 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2341 local_var_req_builder = local_var_req_builder
2342 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2343 }
2344 if let Some(local_var_param_value) = idempotency_key {
2345 local_var_req_builder =
2346 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
2347 }
2348 local_var_req_builder = local_var_req_builder.json(&set_auto_fuel_request);
2349
2350 let local_var_req = local_var_req_builder.build()?;
2351 let local_var_resp = local_var_client.execute(local_var_req).await?;
2352
2353 let local_var_status = local_var_resp.status();
2354 let local_var_content_type = local_var_resp
2355 .headers()
2356 .get("content-type")
2357 .and_then(|v| v.to_str().ok())
2358 .unwrap_or("application/octet-stream");
2359 let local_var_content_type = super::ContentType::from(local_var_content_type);
2360 let local_var_content = local_var_resp.text().await?;
2361
2362 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2363 match local_var_content_type {
2364 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2365 ContentType::Text => {
2366 return Err(Error::from(serde_json::Error::custom(
2367 "Received `text/plain` content type response that cannot be converted to \
2368 `models::VaultActionStatus`",
2369 )))
2370 }
2371 ContentType::Unsupported(local_var_unknown_type) => {
2372 return Err(Error::from(serde_json::Error::custom(format!(
2373 "Received `{local_var_unknown_type}` content type response that cannot be \
2374 converted to `models::VaultActionStatus`"
2375 ))))
2376 }
2377 }
2378 } else {
2379 let local_var_entity: Option<SetVaultAccountAutoFuelError> =
2380 serde_json::from_str(&local_var_content).ok();
2381 let local_var_error = ResponseContent {
2382 status: local_var_status,
2383 content: local_var_content,
2384 entity: local_var_entity,
2385 };
2386 Err(Error::ResponseError(local_var_error))
2387 }
2388 }
2389
2390 async fn set_vault_account_customer_ref_id(
2392 &self,
2393 params: SetVaultAccountCustomerRefIdParams,
2394 ) -> Result<models::VaultActionStatus, Error<SetVaultAccountCustomerRefIdError>> {
2395 let SetVaultAccountCustomerRefIdParams {
2396 vault_account_id,
2397 set_customer_ref_id_request,
2398 idempotency_key,
2399 } = params;
2400
2401 let local_var_configuration = &self.configuration;
2402
2403 let local_var_client = &local_var_configuration.client;
2404
2405 let local_var_uri_str = format!(
2406 "{}/vault/accounts/{vaultAccountId}/set_customer_ref_id",
2407 local_var_configuration.base_path,
2408 vaultAccountId = crate::apis::urlencode(vault_account_id)
2409 );
2410 let mut local_var_req_builder =
2411 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2412
2413 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2414 local_var_req_builder = local_var_req_builder
2415 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2416 }
2417 if let Some(local_var_param_value) = idempotency_key {
2418 local_var_req_builder =
2419 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
2420 }
2421 local_var_req_builder = local_var_req_builder.json(&set_customer_ref_id_request);
2422
2423 let local_var_req = local_var_req_builder.build()?;
2424 let local_var_resp = local_var_client.execute(local_var_req).await?;
2425
2426 let local_var_status = local_var_resp.status();
2427 let local_var_content_type = local_var_resp
2428 .headers()
2429 .get("content-type")
2430 .and_then(|v| v.to_str().ok())
2431 .unwrap_or("application/octet-stream");
2432 let local_var_content_type = super::ContentType::from(local_var_content_type);
2433 let local_var_content = local_var_resp.text().await?;
2434
2435 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2436 match local_var_content_type {
2437 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2438 ContentType::Text => {
2439 return Err(Error::from(serde_json::Error::custom(
2440 "Received `text/plain` content type response that cannot be converted to \
2441 `models::VaultActionStatus`",
2442 )))
2443 }
2444 ContentType::Unsupported(local_var_unknown_type) => {
2445 return Err(Error::from(serde_json::Error::custom(format!(
2446 "Received `{local_var_unknown_type}` content type response that cannot be \
2447 converted to `models::VaultActionStatus`"
2448 ))))
2449 }
2450 }
2451 } else {
2452 let local_var_entity: Option<SetVaultAccountCustomerRefIdError> =
2453 serde_json::from_str(&local_var_content).ok();
2454 let local_var_error = ResponseContent {
2455 status: local_var_status,
2456 content: local_var_content,
2457 entity: local_var_entity,
2458 };
2459 Err(Error::ResponseError(local_var_error))
2460 }
2461 }
2462
2463 async fn unhide_vault_account(
2466 &self,
2467 params: UnhideVaultAccountParams,
2468 ) -> Result<models::VaultActionStatus, Error<UnhideVaultAccountError>> {
2469 let UnhideVaultAccountParams {
2470 vault_account_id,
2471 idempotency_key,
2472 } = params;
2473
2474 let local_var_configuration = &self.configuration;
2475
2476 let local_var_client = &local_var_configuration.client;
2477
2478 let local_var_uri_str = format!(
2479 "{}/vault/accounts/{vaultAccountId}/unhide",
2480 local_var_configuration.base_path,
2481 vaultAccountId = crate::apis::urlencode(vault_account_id)
2482 );
2483 let mut local_var_req_builder =
2484 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2485
2486 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2487 local_var_req_builder = local_var_req_builder
2488 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2489 }
2490 if let Some(local_var_param_value) = idempotency_key {
2491 local_var_req_builder =
2492 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
2493 }
2494
2495 let local_var_req = local_var_req_builder.build()?;
2496 let local_var_resp = local_var_client.execute(local_var_req).await?;
2497
2498 let local_var_status = local_var_resp.status();
2499 let local_var_content_type = local_var_resp
2500 .headers()
2501 .get("content-type")
2502 .and_then(|v| v.to_str().ok())
2503 .unwrap_or("application/octet-stream");
2504 let local_var_content_type = super::ContentType::from(local_var_content_type);
2505 let local_var_content = local_var_resp.text().await?;
2506
2507 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2508 match local_var_content_type {
2509 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2510 ContentType::Text => {
2511 return Err(Error::from(serde_json::Error::custom(
2512 "Received `text/plain` content type response that cannot be converted to \
2513 `models::VaultActionStatus`",
2514 )))
2515 }
2516 ContentType::Unsupported(local_var_unknown_type) => {
2517 return Err(Error::from(serde_json::Error::custom(format!(
2518 "Received `{local_var_unknown_type}` content type response that cannot be \
2519 converted to `models::VaultActionStatus`"
2520 ))))
2521 }
2522 }
2523 } else {
2524 let local_var_entity: Option<UnhideVaultAccountError> =
2525 serde_json::from_str(&local_var_content).ok();
2526 let local_var_error = ResponseContent {
2527 status: local_var_status,
2528 content: local_var_content,
2529 entity: local_var_entity,
2530 };
2531 Err(Error::ResponseError(local_var_error))
2532 }
2533 }
2534
2535 async fn update_vault_account(
2538 &self,
2539 params: UpdateVaultAccountParams,
2540 ) -> Result<models::RenameVaultAccountResponse, Error<UpdateVaultAccountError>> {
2541 let UpdateVaultAccountParams {
2542 vault_account_id,
2543 update_vault_account_request,
2544 idempotency_key,
2545 } = params;
2546
2547 let local_var_configuration = &self.configuration;
2548
2549 let local_var_client = &local_var_configuration.client;
2550
2551 let local_var_uri_str = format!(
2552 "{}/vault/accounts/{vaultAccountId}",
2553 local_var_configuration.base_path,
2554 vaultAccountId = crate::apis::urlencode(vault_account_id)
2555 );
2556 let mut local_var_req_builder =
2557 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2558
2559 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2560 local_var_req_builder = local_var_req_builder
2561 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2562 }
2563 if let Some(local_var_param_value) = idempotency_key {
2564 local_var_req_builder =
2565 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
2566 }
2567 local_var_req_builder = local_var_req_builder.json(&update_vault_account_request);
2568
2569 let local_var_req = local_var_req_builder.build()?;
2570 let local_var_resp = local_var_client.execute(local_var_req).await?;
2571
2572 let local_var_status = local_var_resp.status();
2573 let local_var_content_type = local_var_resp
2574 .headers()
2575 .get("content-type")
2576 .and_then(|v| v.to_str().ok())
2577 .unwrap_or("application/octet-stream");
2578 let local_var_content_type = super::ContentType::from(local_var_content_type);
2579 let local_var_content = local_var_resp.text().await?;
2580
2581 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2582 match local_var_content_type {
2583 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2584 ContentType::Text => {
2585 return Err(Error::from(serde_json::Error::custom(
2586 "Received `text/plain` content type response that cannot be converted to \
2587 `models::RenameVaultAccountResponse`",
2588 )))
2589 }
2590 ContentType::Unsupported(local_var_unknown_type) => {
2591 return Err(Error::from(serde_json::Error::custom(format!(
2592 "Received `{local_var_unknown_type}` content type response that cannot be \
2593 converted to `models::RenameVaultAccountResponse`"
2594 ))))
2595 }
2596 }
2597 } else {
2598 let local_var_entity: Option<UpdateVaultAccountError> =
2599 serde_json::from_str(&local_var_content).ok();
2600 let local_var_error = ResponseContent {
2601 status: local_var_status,
2602 content: local_var_content,
2603 entity: local_var_entity,
2604 };
2605 Err(Error::ResponseError(local_var_error))
2606 }
2607 }
2608
2609 async fn update_vault_account_asset_address(
2613 &self,
2614 params: UpdateVaultAccountAssetAddressParams,
2615 ) -> Result<models::VaultActionStatus, Error<UpdateVaultAccountAssetAddressError>> {
2616 let UpdateVaultAccountAssetAddressParams {
2617 vault_account_id,
2618 asset_id,
2619 address_id,
2620 idempotency_key,
2621 update_vault_account_asset_address_request,
2622 } = params;
2623
2624 let local_var_configuration = &self.configuration;
2625
2626 let local_var_client = &local_var_configuration.client;
2627
2628 let local_var_uri_str = format!(
2629 "{}/vault/accounts/{vaultAccountId}/{assetId}/addresses/{addressId}",
2630 local_var_configuration.base_path,
2631 vaultAccountId = crate::apis::urlencode(vault_account_id),
2632 assetId = crate::apis::urlencode(asset_id),
2633 addressId = crate::apis::urlencode(address_id)
2634 );
2635 let mut local_var_req_builder =
2636 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2637
2638 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2639 local_var_req_builder = local_var_req_builder
2640 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2641 }
2642 if let Some(local_var_param_value) = idempotency_key {
2643 local_var_req_builder =
2644 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
2645 }
2646 local_var_req_builder =
2647 local_var_req_builder.json(&update_vault_account_asset_address_request);
2648
2649 let local_var_req = local_var_req_builder.build()?;
2650 let local_var_resp = local_var_client.execute(local_var_req).await?;
2651
2652 let local_var_status = local_var_resp.status();
2653 let local_var_content_type = local_var_resp
2654 .headers()
2655 .get("content-type")
2656 .and_then(|v| v.to_str().ok())
2657 .unwrap_or("application/octet-stream");
2658 let local_var_content_type = super::ContentType::from(local_var_content_type);
2659 let local_var_content = local_var_resp.text().await?;
2660
2661 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2662 match local_var_content_type {
2663 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2664 ContentType::Text => {
2665 return Err(Error::from(serde_json::Error::custom(
2666 "Received `text/plain` content type response that cannot be converted to \
2667 `models::VaultActionStatus`",
2668 )))
2669 }
2670 ContentType::Unsupported(local_var_unknown_type) => {
2671 return Err(Error::from(serde_json::Error::custom(format!(
2672 "Received `{local_var_unknown_type}` content type response that cannot be \
2673 converted to `models::VaultActionStatus`"
2674 ))))
2675 }
2676 }
2677 } else {
2678 let local_var_entity: Option<UpdateVaultAccountAssetAddressError> =
2679 serde_json::from_str(&local_var_content).ok();
2680 let local_var_error = ResponseContent {
2681 status: local_var_status,
2682 content: local_var_content,
2683 entity: local_var_entity,
2684 };
2685 Err(Error::ResponseError(local_var_error))
2686 }
2687 }
2688
2689 async fn update_vault_account_asset_balance(
2694 &self,
2695 params: UpdateVaultAccountAssetBalanceParams,
2696 ) -> Result<models::VaultAsset, Error<UpdateVaultAccountAssetBalanceError>> {
2697 let UpdateVaultAccountAssetBalanceParams {
2698 vault_account_id,
2699 asset_id,
2700 idempotency_key,
2701 } = params;
2702
2703 let local_var_configuration = &self.configuration;
2704
2705 let local_var_client = &local_var_configuration.client;
2706
2707 let local_var_uri_str = format!(
2708 "{}/vault/accounts/{vaultAccountId}/{assetId}/balance",
2709 local_var_configuration.base_path,
2710 vaultAccountId = crate::apis::urlencode(vault_account_id),
2711 assetId = crate::apis::urlencode(asset_id)
2712 );
2713 let mut local_var_req_builder =
2714 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2715
2716 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2717 local_var_req_builder = local_var_req_builder
2718 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2719 }
2720 if let Some(local_var_param_value) = idempotency_key {
2721 local_var_req_builder =
2722 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
2723 }
2724
2725 let local_var_req = local_var_req_builder.build()?;
2726 let local_var_resp = local_var_client.execute(local_var_req).await?;
2727
2728 let local_var_status = local_var_resp.status();
2729 let local_var_content_type = local_var_resp
2730 .headers()
2731 .get("content-type")
2732 .and_then(|v| v.to_str().ok())
2733 .unwrap_or("application/octet-stream");
2734 let local_var_content_type = super::ContentType::from(local_var_content_type);
2735 let local_var_content = local_var_resp.text().await?;
2736
2737 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2738 match local_var_content_type {
2739 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2740 ContentType::Text => {
2741 return Err(Error::from(serde_json::Error::custom(
2742 "Received `text/plain` content type response that cannot be converted to \
2743 `models::VaultAsset`",
2744 )))
2745 }
2746 ContentType::Unsupported(local_var_unknown_type) => {
2747 return Err(Error::from(serde_json::Error::custom(format!(
2748 "Received `{local_var_unknown_type}` content type response that cannot be \
2749 converted to `models::VaultAsset`"
2750 ))))
2751 }
2752 }
2753 } else {
2754 let local_var_entity: Option<UpdateVaultAccountAssetBalanceError> =
2755 serde_json::from_str(&local_var_content).ok();
2756 let local_var_error = ResponseContent {
2757 status: local_var_status,
2758 content: local_var_content,
2759 entity: local_var_entity,
2760 };
2761 Err(Error::ResponseError(local_var_error))
2762 }
2763 }
2764}
2765
2766#[derive(Debug, Clone, Serialize, Deserialize)]
2768#[serde(untagged)]
2769pub enum ActivateAssetForVaultAccountError {
2770 DefaultResponse(models::ErrorSchema),
2771 UnknownValue(serde_json::Value),
2772}
2773
2774#[derive(Debug, Clone, Serialize, Deserialize)]
2776#[serde(untagged)]
2777pub enum CreateLegacyAddressError {
2778 DefaultResponse(models::ErrorSchema),
2779 UnknownValue(serde_json::Value),
2780}
2781
2782#[derive(Debug, Clone, Serialize, Deserialize)]
2784#[serde(untagged)]
2785pub enum CreateMultipleDepositAddressesError {
2786 DefaultResponse(models::ErrorSchema),
2787 UnknownValue(serde_json::Value),
2788}
2789
2790#[derive(Debug, Clone, Serialize, Deserialize)]
2792#[serde(untagged)]
2793pub enum CreateVaultAccountError {
2794 DefaultResponse(models::ErrorSchema),
2795 UnknownValue(serde_json::Value),
2796}
2797
2798#[derive(Debug, Clone, Serialize, Deserialize)]
2800#[serde(untagged)]
2801pub enum CreateVaultAccountAssetError {
2802 DefaultResponse(models::ErrorSchema),
2803 UnknownValue(serde_json::Value),
2804}
2805
2806#[derive(Debug, Clone, Serialize, Deserialize)]
2808#[serde(untagged)]
2809pub enum CreateVaultAccountAssetAddressError {
2810 DefaultResponse(models::ErrorSchema),
2811 UnknownValue(serde_json::Value),
2812}
2813
2814#[derive(Debug, Clone, Serialize, Deserialize)]
2816#[serde(untagged)]
2817pub enum GetAssetWalletsError {
2818 UnknownValue(serde_json::Value),
2819}
2820
2821#[derive(Debug, Clone, Serialize, Deserialize)]
2824#[serde(untagged)]
2825pub enum GetCreateMultipleDepositAddressesJobStatusError {
2826 DefaultResponse(models::ErrorSchema),
2827 UnknownValue(serde_json::Value),
2828}
2829
2830#[derive(Debug, Clone, Serialize, Deserialize)]
2832#[serde(untagged)]
2833pub enum GetMaxSpendableAmountError {
2834 DefaultResponse(models::ErrorSchema),
2835 UnknownValue(serde_json::Value),
2836}
2837
2838#[derive(Debug, Clone, Serialize, Deserialize)]
2840#[serde(untagged)]
2841pub enum GetPagedVaultAccountsError {
2842 UnknownValue(serde_json::Value),
2843}
2844
2845#[derive(Debug, Clone, Serialize, Deserialize)]
2847#[serde(untagged)]
2848pub enum GetPublicKeyInfoError {
2849 DefaultResponse(models::ErrorSchema),
2850 UnknownValue(serde_json::Value),
2851}
2852
2853#[derive(Debug, Clone, Serialize, Deserialize)]
2855#[serde(untagged)]
2856pub enum GetPublicKeyInfoForAddressError {
2857 DefaultResponse(models::ErrorSchema),
2858 UnknownValue(serde_json::Value),
2859}
2860
2861#[derive(Debug, Clone, Serialize, Deserialize)]
2863#[serde(untagged)]
2864pub enum GetUnspentInputsError {
2865 DefaultResponse(models::ErrorSchema),
2866 UnknownValue(serde_json::Value),
2867}
2868
2869#[derive(Debug, Clone, Serialize, Deserialize)]
2871#[serde(untagged)]
2872pub enum GetVaultAccountError {
2873 DefaultResponse(models::ErrorSchema),
2874 UnknownValue(serde_json::Value),
2875}
2876
2877#[derive(Debug, Clone, Serialize, Deserialize)]
2879#[serde(untagged)]
2880pub enum GetVaultAccountAssetError {
2881 DefaultResponse(models::ErrorSchema),
2882 UnknownValue(serde_json::Value),
2883}
2884
2885#[derive(Debug, Clone, Serialize, Deserialize)]
2887#[serde(untagged)]
2888pub enum GetVaultAccountAssetAddressesError {
2889 DefaultResponse(models::ErrorSchema),
2890 UnknownValue(serde_json::Value),
2891}
2892
2893#[derive(Debug, Clone, Serialize, Deserialize)]
2896#[serde(untagged)]
2897pub enum GetVaultAccountAssetAddressesPaginatedError {
2898 DefaultResponse(models::ErrorSchema),
2899 UnknownValue(serde_json::Value),
2900}
2901
2902#[derive(Debug, Clone, Serialize, Deserialize)]
2904#[serde(untagged)]
2905pub enum GetVaultAssetsError {
2906 DefaultResponse(models::ErrorSchema),
2907 UnknownValue(serde_json::Value),
2908}
2909
2910#[derive(Debug, Clone, Serialize, Deserialize)]
2912#[serde(untagged)]
2913pub enum GetVaultBalanceByAssetError {
2914 DefaultResponse(models::ErrorSchema),
2915 UnknownValue(serde_json::Value),
2916}
2917
2918#[derive(Debug, Clone, Serialize, Deserialize)]
2920#[serde(untagged)]
2921pub enum HideVaultAccountError {
2922 DefaultResponse(models::ErrorSchema),
2923 UnknownValue(serde_json::Value),
2924}
2925
2926#[derive(Debug, Clone, Serialize, Deserialize)]
2928#[serde(untagged)]
2929pub enum SetCustomerRefIdForAddressError {
2930 DefaultResponse(models::ErrorSchema),
2931 UnknownValue(serde_json::Value),
2932}
2933
2934#[derive(Debug, Clone, Serialize, Deserialize)]
2936#[serde(untagged)]
2937pub enum SetVaultAccountAutoFuelError {
2938 DefaultResponse(models::ErrorSchema),
2939 UnknownValue(serde_json::Value),
2940}
2941
2942#[derive(Debug, Clone, Serialize, Deserialize)]
2944#[serde(untagged)]
2945pub enum SetVaultAccountCustomerRefIdError {
2946 DefaultResponse(models::ErrorSchema),
2947 UnknownValue(serde_json::Value),
2948}
2949
2950#[derive(Debug, Clone, Serialize, Deserialize)]
2952#[serde(untagged)]
2953pub enum UnhideVaultAccountError {
2954 DefaultResponse(models::ErrorSchema),
2955 UnknownValue(serde_json::Value),
2956}
2957
2958#[derive(Debug, Clone, Serialize, Deserialize)]
2960#[serde(untagged)]
2961pub enum UpdateVaultAccountError {
2962 DefaultResponse(models::ErrorSchema),
2963 UnknownValue(serde_json::Value),
2964}
2965
2966#[derive(Debug, Clone, Serialize, Deserialize)]
2968#[serde(untagged)]
2969pub enum UpdateVaultAccountAssetAddressError {
2970 DefaultResponse(models::ErrorSchema),
2971 UnknownValue(serde_json::Value),
2972}
2973
2974#[derive(Debug, Clone, Serialize, Deserialize)]
2976#[serde(untagged)]
2977pub enum UpdateVaultAccountAssetBalanceError {
2978 DefaultResponse(models::ErrorSchema),
2979 UnknownValue(serde_json::Value),
2980}