1use {
10 super::{Error, configuration},
11 crate::{
12 apis::{ContentType, ResponseContent},
13 models,
14 },
15 async_trait::async_trait,
16 reqwest,
17 serde::{Deserialize, Serialize, de::Error as _},
18 std::sync::Arc,
19};
20
21#[async_trait]
22pub trait ComplianceApi: Send + Sync {
23 async fn get_aml_post_screening_policy(
28 &self,
29 ) -> Result<models::ScreeningPolicyResponse, Error<GetAmlPostScreeningPolicyError>>;
30
31 async fn get_aml_screening_configuration(
37 &self,
38 ) -> Result<models::ScreeningConfigurationsRequest, Error<GetAmlScreeningConfigurationError>>;
39
40 async fn get_aml_screening_policy(
45 &self,
46 ) -> Result<
47 models::ScreeningProviderRulesConfigurationResponse,
48 Error<GetAmlScreeningPolicyError>,
49 >;
50
51 async fn get_post_screening_policy(
56 &self,
57 ) -> Result<models::ScreeningPolicyResponse, Error<GetPostScreeningPolicyError>>;
58
59 async fn get_screening_configuration(
65 &self,
66 ) -> Result<models::ScreeningConfigurationsRequest, Error<GetScreeningConfigurationError>>;
67
68 async fn get_screening_full_details(
73 &self,
74 params: GetScreeningFullDetailsParams,
75 ) -> Result<models::ComplianceResultFullPayload, Error<GetScreeningFullDetailsError>>;
76
77 async fn get_screening_policy(
82 &self,
83 ) -> Result<models::ScreeningProviderRulesConfigurationResponse, Error<GetScreeningPolicyError>>;
84
85 async fn get_vasp_for_vault(
90 &self,
91 params: GetVaspForVaultParams,
92 ) -> Result<models::TravelRuleVaspForVault, Error<GetVaspForVaultError>>;
93
94 async fn get_vaspby_did(
100 &self,
101 params: GetVaspbyDidParams,
102 ) -> Result<models::TravelRuleVasp, Error<GetVaspbyDidError>>;
103
104 async fn get_vasps(
110 &self,
111 params: GetVaspsParams,
112 ) -> Result<models::TravelRuleGetAllVaspsResponse, Error<GetVaspsError>>;
113
114 async fn retry_rejected_transaction_bypass_screening_checks(
122 &self,
123 params: RetryRejectedTransactionBypassScreeningChecksParams,
124 ) -> Result<
125 models::CreateTransactionResponse,
126 Error<RetryRejectedTransactionBypassScreeningChecksError>,
127 >;
128
129 async fn set_aml_verdict(
134 &self,
135 params: SetAmlVerdictParams,
136 ) -> Result<models::AmlVerdictManualResponse, Error<SetAmlVerdictError>>;
137
138 async fn set_vasp_for_vault(
143 &self,
144 params: SetVaspForVaultParams,
145 ) -> Result<models::TravelRuleVaspForVault, Error<SetVaspForVaultError>>;
146
147 async fn update_aml_screening_configuration(
153 &self,
154 params: UpdateAmlScreeningConfigurationParams,
155 ) -> Result<models::ScreeningConfigurationsRequest, Error<UpdateAmlScreeningConfigurationError>>;
156
157 async fn update_screening_configuration(
161 &self,
162 params: UpdateScreeningConfigurationParams,
163 ) -> Result<models::ScreeningUpdateConfigurations, Error<UpdateScreeningConfigurationError>>;
164
165 async fn update_travel_rule_config(
171 &self,
172 params: UpdateTravelRuleConfigParams,
173 ) -> Result<models::ScreeningConfigurationsRequest, Error<UpdateTravelRuleConfigError>>;
174
175 async fn update_vasp(
181 &self,
182 params: UpdateVaspParams,
183 ) -> Result<models::TravelRuleUpdateVaspDetails, Error<UpdateVaspError>>;
184
185 async fn validate_full_travel_rule_transaction(
189 &self,
190 params: ValidateFullTravelRuleTransactionParams,
191 ) -> Result<
192 models::TravelRuleValidateTransactionResponse,
193 Error<ValidateFullTravelRuleTransactionError>,
194 >;
195
196 async fn validate_travel_rule_transaction(
200 &self,
201 params: ValidateTravelRuleTransactionParams,
202 ) -> Result<
203 models::TravelRuleValidateTransactionResponse,
204 Error<ValidateTravelRuleTransactionError>,
205 >;
206}
207
208pub struct ComplianceApiClient {
209 configuration: Arc<configuration::Configuration>,
210}
211
212impl ComplianceApiClient {
213 pub fn new(configuration: Arc<configuration::Configuration>) -> Self {
214 Self { configuration }
215 }
216}
217
218#[derive(Clone, Debug)]
221#[cfg_attr(feature = "bon", derive(::bon::Builder))]
222pub struct GetScreeningFullDetailsParams {
223 pub tx_id: String,
225}
226
227#[derive(Clone, Debug)]
230#[cfg_attr(feature = "bon", derive(::bon::Builder))]
231pub struct GetVaspForVaultParams {
232 pub vault_account_id: String,
234}
235
236#[derive(Clone, Debug)]
239#[cfg_attr(feature = "bon", derive(::bon::Builder))]
240pub struct GetVaspbyDidParams {
241 pub did: String,
242 pub fields: Option<String>,
245}
246
247#[derive(Clone, Debug)]
249#[cfg_attr(feature = "bon", derive(::bon::Builder))]
250pub struct GetVaspsParams {
251 pub order: Option<String>,
253 pub per_page: Option<f64>,
255 pub page: Option<f64>,
257 pub fields: Option<String>,
260 pub q: Option<String>,
262 pub review_value: Option<String>,
267}
268
269#[derive(Clone, Debug)]
272#[cfg_attr(feature = "bon", derive(::bon::Builder))]
273pub struct RetryRejectedTransactionBypassScreeningChecksParams {
274 pub tx_id: String,
276 pub idempotency_key: Option<String>,
281}
282
283#[derive(Clone, Debug)]
286#[cfg_attr(feature = "bon", derive(::bon::Builder))]
287pub struct SetAmlVerdictParams {
288 pub aml_verdict_manual_request: models::AmlVerdictManualRequest,
289 pub idempotency_key: Option<String>,
294}
295
296#[derive(Clone, Debug)]
299#[cfg_attr(feature = "bon", derive(::bon::Builder))]
300pub struct SetVaspForVaultParams {
301 pub vault_account_id: String,
303 pub travel_rule_vasp_for_vault: models::TravelRuleVaspForVault,
304 pub idempotency_key: Option<String>,
309}
310
311#[derive(Clone, Debug)]
314#[cfg_attr(feature = "bon", derive(::bon::Builder))]
315pub struct UpdateAmlScreeningConfigurationParams {
316 pub idempotency_key: Option<String>,
321}
322
323#[derive(Clone, Debug)]
326#[cfg_attr(feature = "bon", derive(::bon::Builder))]
327pub struct UpdateScreeningConfigurationParams {
328 pub screening_update_configurations: models::ScreeningUpdateConfigurations,
329 pub idempotency_key: Option<String>,
334}
335
336#[derive(Clone, Debug)]
339#[cfg_attr(feature = "bon", derive(::bon::Builder))]
340pub struct UpdateTravelRuleConfigParams {
341 pub idempotency_key: Option<String>,
346}
347
348#[derive(Clone, Debug)]
350#[cfg_attr(feature = "bon", derive(::bon::Builder))]
351pub struct UpdateVaspParams {
352 pub travel_rule_update_vasp_details: models::TravelRuleUpdateVaspDetails,
353 pub idempotency_key: Option<String>,
358}
359
360#[derive(Clone, Debug)]
363#[cfg_attr(feature = "bon", derive(::bon::Builder))]
364pub struct ValidateFullTravelRuleTransactionParams {
365 pub travel_rule_validate_full_transaction_request:
366 models::TravelRuleValidateFullTransactionRequest,
367 pub notation: Option<String>,
375 pub idempotency_key: Option<String>,
380}
381
382#[derive(Clone, Debug)]
385#[cfg_attr(feature = "bon", derive(::bon::Builder))]
386pub struct ValidateTravelRuleTransactionParams {
387 pub travel_rule_validate_transaction_request: models::TravelRuleValidateTransactionRequest,
388 pub notation: Option<String>,
396 pub idempotency_key: Option<String>,
401}
402
403#[async_trait]
404impl ComplianceApi for ComplianceApiClient {
405 async fn get_aml_post_screening_policy(
408 &self,
409 ) -> Result<models::ScreeningPolicyResponse, Error<GetAmlPostScreeningPolicyError>> {
410 let local_var_configuration = &self.configuration;
411
412 let local_var_client = &local_var_configuration.client;
413
414 let local_var_uri_str = format!(
415 "{}/screening/aml/post_screening_policy",
416 local_var_configuration.base_path
417 );
418 let mut local_var_req_builder =
419 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
420
421 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
422 local_var_req_builder = local_var_req_builder
423 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
424 }
425
426 let local_var_req = local_var_req_builder.build()?;
427 let local_var_resp = local_var_client.execute(local_var_req).await?;
428
429 let local_var_status = local_var_resp.status();
430 let local_var_content_type = local_var_resp
431 .headers()
432 .get("content-type")
433 .and_then(|v| v.to_str().ok())
434 .unwrap_or("application/octet-stream");
435 let local_var_content_type = super::ContentType::from(local_var_content_type);
436 let local_var_content = local_var_resp.text().await?;
437
438 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
439 match local_var_content_type {
440 ContentType::Json => {
441 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
442 }
443 ContentType::Text => {
444 return Err(Error::from(serde_json::Error::custom(
445 "Received `text/plain` content type response that cannot be converted to \
446 `models::ScreeningPolicyResponse`",
447 )));
448 }
449 ContentType::Unsupported(local_var_unknown_type) => {
450 return Err(Error::from(serde_json::Error::custom(format!(
451 "Received `{local_var_unknown_type}` content type response that cannot be \
452 converted to `models::ScreeningPolicyResponse`"
453 ))));
454 }
455 }
456 } else {
457 let local_var_entity: Option<GetAmlPostScreeningPolicyError> =
458 serde_json::from_str(&local_var_content).ok();
459 let local_var_error = ResponseContent {
460 status: local_var_status,
461 content: local_var_content,
462 entity: local_var_entity,
463 };
464 Err(Error::ResponseError(local_var_error))
465 }
466 }
467
468 async fn get_aml_screening_configuration(
472 &self,
473 ) -> Result<models::ScreeningConfigurationsRequest, Error<GetAmlScreeningConfigurationError>>
474 {
475 let local_var_configuration = &self.configuration;
476
477 let local_var_client = &local_var_configuration.client;
478
479 let local_var_uri_str = format!(
480 "{}/screening/aml/policy_configuration",
481 local_var_configuration.base_path
482 );
483 let mut local_var_req_builder =
484 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
485
486 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
487 local_var_req_builder = local_var_req_builder
488 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
489 }
490
491 let local_var_req = local_var_req_builder.build()?;
492 let local_var_resp = local_var_client.execute(local_var_req).await?;
493
494 let local_var_status = local_var_resp.status();
495 let local_var_content_type = local_var_resp
496 .headers()
497 .get("content-type")
498 .and_then(|v| v.to_str().ok())
499 .unwrap_or("application/octet-stream");
500 let local_var_content_type = super::ContentType::from(local_var_content_type);
501 let local_var_content = local_var_resp.text().await?;
502
503 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
504 match local_var_content_type {
505 ContentType::Json => {
506 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
507 }
508 ContentType::Text => {
509 return Err(Error::from(serde_json::Error::custom(
510 "Received `text/plain` content type response that cannot be converted to \
511 `models::ScreeningConfigurationsRequest`",
512 )));
513 }
514 ContentType::Unsupported(local_var_unknown_type) => {
515 return Err(Error::from(serde_json::Error::custom(format!(
516 "Received `{local_var_unknown_type}` content type response that cannot be \
517 converted to `models::ScreeningConfigurationsRequest`"
518 ))));
519 }
520 }
521 } else {
522 let local_var_entity: Option<GetAmlScreeningConfigurationError> =
523 serde_json::from_str(&local_var_content).ok();
524 let local_var_error = ResponseContent {
525 status: local_var_status,
526 content: local_var_content,
527 entity: local_var_entity,
528 };
529 Err(Error::ResponseError(local_var_error))
530 }
531 }
532
533 async fn get_aml_screening_policy(
536 &self,
537 ) -> Result<
538 models::ScreeningProviderRulesConfigurationResponse,
539 Error<GetAmlScreeningPolicyError>,
540 > {
541 let local_var_configuration = &self.configuration;
542
543 let local_var_client = &local_var_configuration.client;
544
545 let local_var_uri_str = format!(
546 "{}/screening/aml/screening_policy",
547 local_var_configuration.base_path
548 );
549 let mut local_var_req_builder =
550 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
551
552 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
553 local_var_req_builder = local_var_req_builder
554 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
555 }
556
557 let local_var_req = local_var_req_builder.build()?;
558 let local_var_resp = local_var_client.execute(local_var_req).await?;
559
560 let local_var_status = local_var_resp.status();
561 let local_var_content_type = local_var_resp
562 .headers()
563 .get("content-type")
564 .and_then(|v| v.to_str().ok())
565 .unwrap_or("application/octet-stream");
566 let local_var_content_type = super::ContentType::from(local_var_content_type);
567 let local_var_content = local_var_resp.text().await?;
568
569 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
570 match local_var_content_type {
571 ContentType::Json => {
572 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
573 }
574 ContentType::Text => {
575 return Err(Error::from(serde_json::Error::custom(
576 "Received `text/plain` content type response that cannot be converted to \
577 `models::ScreeningProviderRulesConfigurationResponse`",
578 )));
579 }
580 ContentType::Unsupported(local_var_unknown_type) => {
581 return Err(Error::from(serde_json::Error::custom(format!(
582 "Received `{local_var_unknown_type}` content type response that cannot be \
583 converted to `models::ScreeningProviderRulesConfigurationResponse`"
584 ))));
585 }
586 }
587 } else {
588 let local_var_entity: Option<GetAmlScreeningPolicyError> =
589 serde_json::from_str(&local_var_content).ok();
590 let local_var_error = ResponseContent {
591 status: local_var_status,
592 content: local_var_content,
593 entity: local_var_entity,
594 };
595 Err(Error::ResponseError(local_var_error))
596 }
597 }
598
599 async fn get_post_screening_policy(
602 &self,
603 ) -> Result<models::ScreeningPolicyResponse, Error<GetPostScreeningPolicyError>> {
604 let local_var_configuration = &self.configuration;
605
606 let local_var_client = &local_var_configuration.client;
607
608 let local_var_uri_str = format!(
609 "{}/screening/travel_rule/post_screening_policy",
610 local_var_configuration.base_path
611 );
612 let mut local_var_req_builder =
613 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
614
615 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
616 local_var_req_builder = local_var_req_builder
617 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
618 }
619
620 let local_var_req = local_var_req_builder.build()?;
621 let local_var_resp = local_var_client.execute(local_var_req).await?;
622
623 let local_var_status = local_var_resp.status();
624 let local_var_content_type = local_var_resp
625 .headers()
626 .get("content-type")
627 .and_then(|v| v.to_str().ok())
628 .unwrap_or("application/octet-stream");
629 let local_var_content_type = super::ContentType::from(local_var_content_type);
630 let local_var_content = local_var_resp.text().await?;
631
632 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
633 match local_var_content_type {
634 ContentType::Json => {
635 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
636 }
637 ContentType::Text => {
638 return Err(Error::from(serde_json::Error::custom(
639 "Received `text/plain` content type response that cannot be converted to \
640 `models::ScreeningPolicyResponse`",
641 )));
642 }
643 ContentType::Unsupported(local_var_unknown_type) => {
644 return Err(Error::from(serde_json::Error::custom(format!(
645 "Received `{local_var_unknown_type}` content type response that cannot be \
646 converted to `models::ScreeningPolicyResponse`"
647 ))));
648 }
649 }
650 } else {
651 let local_var_entity: Option<GetPostScreeningPolicyError> =
652 serde_json::from_str(&local_var_content).ok();
653 let local_var_error = ResponseContent {
654 status: local_var_status,
655 content: local_var_content,
656 entity: local_var_entity,
657 };
658 Err(Error::ResponseError(local_var_error))
659 }
660 }
661
662 async fn get_screening_configuration(
666 &self,
667 ) -> Result<models::ScreeningConfigurationsRequest, Error<GetScreeningConfigurationError>> {
668 let local_var_configuration = &self.configuration;
669
670 let local_var_client = &local_var_configuration.client;
671
672 let local_var_uri_str = format!(
673 "{}/screening/travel_rule/policy_configuration",
674 local_var_configuration.base_path
675 );
676 let mut local_var_req_builder =
677 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
678
679 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
680 local_var_req_builder = local_var_req_builder
681 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
682 }
683
684 let local_var_req = local_var_req_builder.build()?;
685 let local_var_resp = local_var_client.execute(local_var_req).await?;
686
687 let local_var_status = local_var_resp.status();
688 let local_var_content_type = local_var_resp
689 .headers()
690 .get("content-type")
691 .and_then(|v| v.to_str().ok())
692 .unwrap_or("application/octet-stream");
693 let local_var_content_type = super::ContentType::from(local_var_content_type);
694 let local_var_content = local_var_resp.text().await?;
695
696 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
697 match local_var_content_type {
698 ContentType::Json => {
699 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
700 }
701 ContentType::Text => {
702 return Err(Error::from(serde_json::Error::custom(
703 "Received `text/plain` content type response that cannot be converted to \
704 `models::ScreeningConfigurationsRequest`",
705 )));
706 }
707 ContentType::Unsupported(local_var_unknown_type) => {
708 return Err(Error::from(serde_json::Error::custom(format!(
709 "Received `{local_var_unknown_type}` content type response that cannot be \
710 converted to `models::ScreeningConfigurationsRequest`"
711 ))));
712 }
713 }
714 } else {
715 let local_var_entity: Option<GetScreeningConfigurationError> =
716 serde_json::from_str(&local_var_content).ok();
717 let local_var_error = ResponseContent {
718 status: local_var_status,
719 content: local_var_content,
720 entity: local_var_entity,
721 };
722 Err(Error::ResponseError(local_var_error))
723 }
724 }
725
726 async fn get_screening_full_details(
729 &self,
730 params: GetScreeningFullDetailsParams,
731 ) -> Result<models::ComplianceResultFullPayload, Error<GetScreeningFullDetailsError>> {
732 let GetScreeningFullDetailsParams { tx_id } = params;
733
734 let local_var_configuration = &self.configuration;
735
736 let local_var_client = &local_var_configuration.client;
737
738 let local_var_uri_str = format!(
739 "{}/screening/transaction/{txId}",
740 local_var_configuration.base_path,
741 txId = crate::apis::urlencode(tx_id)
742 );
743 let mut local_var_req_builder =
744 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
745
746 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
747 local_var_req_builder = local_var_req_builder
748 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
749 }
750
751 let local_var_req = local_var_req_builder.build()?;
752 let local_var_resp = local_var_client.execute(local_var_req).await?;
753
754 let local_var_status = local_var_resp.status();
755 let local_var_content_type = local_var_resp
756 .headers()
757 .get("content-type")
758 .and_then(|v| v.to_str().ok())
759 .unwrap_or("application/octet-stream");
760 let local_var_content_type = super::ContentType::from(local_var_content_type);
761 let local_var_content = local_var_resp.text().await?;
762
763 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
764 match local_var_content_type {
765 ContentType::Json => {
766 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
767 }
768 ContentType::Text => {
769 return Err(Error::from(serde_json::Error::custom(
770 "Received `text/plain` content type response that cannot be converted to \
771 `models::ComplianceResultFullPayload`",
772 )));
773 }
774 ContentType::Unsupported(local_var_unknown_type) => {
775 return Err(Error::from(serde_json::Error::custom(format!(
776 "Received `{local_var_unknown_type}` content type response that cannot be \
777 converted to `models::ComplianceResultFullPayload`"
778 ))));
779 }
780 }
781 } else {
782 let local_var_entity: Option<GetScreeningFullDetailsError> =
783 serde_json::from_str(&local_var_content).ok();
784 let local_var_error = ResponseContent {
785 status: local_var_status,
786 content: local_var_content,
787 entity: local_var_entity,
788 };
789 Err(Error::ResponseError(local_var_error))
790 }
791 }
792
793 async fn get_screening_policy(
796 &self,
797 ) -> Result<models::ScreeningProviderRulesConfigurationResponse, Error<GetScreeningPolicyError>>
798 {
799 let local_var_configuration = &self.configuration;
800
801 let local_var_client = &local_var_configuration.client;
802
803 let local_var_uri_str = format!(
804 "{}/screening/travel_rule/screening_policy",
805 local_var_configuration.base_path
806 );
807 let mut local_var_req_builder =
808 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
809
810 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
811 local_var_req_builder = local_var_req_builder
812 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
813 }
814
815 let local_var_req = local_var_req_builder.build()?;
816 let local_var_resp = local_var_client.execute(local_var_req).await?;
817
818 let local_var_status = local_var_resp.status();
819 let local_var_content_type = local_var_resp
820 .headers()
821 .get("content-type")
822 .and_then(|v| v.to_str().ok())
823 .unwrap_or("application/octet-stream");
824 let local_var_content_type = super::ContentType::from(local_var_content_type);
825 let local_var_content = local_var_resp.text().await?;
826
827 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
828 match local_var_content_type {
829 ContentType::Json => {
830 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
831 }
832 ContentType::Text => {
833 return Err(Error::from(serde_json::Error::custom(
834 "Received `text/plain` content type response that cannot be converted to \
835 `models::ScreeningProviderRulesConfigurationResponse`",
836 )));
837 }
838 ContentType::Unsupported(local_var_unknown_type) => {
839 return Err(Error::from(serde_json::Error::custom(format!(
840 "Received `{local_var_unknown_type}` content type response that cannot be \
841 converted to `models::ScreeningProviderRulesConfigurationResponse`"
842 ))));
843 }
844 }
845 } else {
846 let local_var_entity: Option<GetScreeningPolicyError> =
847 serde_json::from_str(&local_var_content).ok();
848 let local_var_error = ResponseContent {
849 status: local_var_status,
850 content: local_var_content,
851 entity: local_var_entity,
852 };
853 Err(Error::ResponseError(local_var_error))
854 }
855 }
856
857 async fn get_vasp_for_vault(
860 &self,
861 params: GetVaspForVaultParams,
862 ) -> Result<models::TravelRuleVaspForVault, Error<GetVaspForVaultError>> {
863 let GetVaspForVaultParams { vault_account_id } = params;
864
865 let local_var_configuration = &self.configuration;
866
867 let local_var_client = &local_var_configuration.client;
868
869 let local_var_uri_str = format!(
870 "{}/screening/travel_rule/vault/{vaultAccountId}/vasp",
871 local_var_configuration.base_path,
872 vaultAccountId = crate::apis::urlencode(vault_account_id)
873 );
874 let mut local_var_req_builder =
875 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
876
877 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
878 local_var_req_builder = local_var_req_builder
879 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
880 }
881
882 let local_var_req = local_var_req_builder.build()?;
883 let local_var_resp = local_var_client.execute(local_var_req).await?;
884
885 let local_var_status = local_var_resp.status();
886 let local_var_content_type = local_var_resp
887 .headers()
888 .get("content-type")
889 .and_then(|v| v.to_str().ok())
890 .unwrap_or("application/octet-stream");
891 let local_var_content_type = super::ContentType::from(local_var_content_type);
892 let local_var_content = local_var_resp.text().await?;
893
894 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
895 match local_var_content_type {
896 ContentType::Json => {
897 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
898 }
899 ContentType::Text => {
900 return Err(Error::from(serde_json::Error::custom(
901 "Received `text/plain` content type response that cannot be converted to \
902 `models::TravelRuleVaspForVault`",
903 )));
904 }
905 ContentType::Unsupported(local_var_unknown_type) => {
906 return Err(Error::from(serde_json::Error::custom(format!(
907 "Received `{local_var_unknown_type}` content type response that cannot be \
908 converted to `models::TravelRuleVaspForVault`"
909 ))));
910 }
911 }
912 } else {
913 let local_var_entity: Option<GetVaspForVaultError> =
914 serde_json::from_str(&local_var_content).ok();
915 let local_var_error = ResponseContent {
916 status: local_var_status,
917 content: local_var_content,
918 entity: local_var_entity,
919 };
920 Err(Error::ResponseError(local_var_error))
921 }
922 }
923
924 async fn get_vaspby_did(
928 &self,
929 params: GetVaspbyDidParams,
930 ) -> Result<models::TravelRuleVasp, Error<GetVaspbyDidError>> {
931 let GetVaspbyDidParams { did, fields } = params;
932
933 let local_var_configuration = &self.configuration;
934
935 let local_var_client = &local_var_configuration.client;
936
937 let local_var_uri_str = format!(
938 "{}/screening/travel_rule/vasp/{did}",
939 local_var_configuration.base_path,
940 did = crate::apis::urlencode(did)
941 );
942 let mut local_var_req_builder =
943 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
944
945 if let Some(ref param_value) = fields {
946 local_var_req_builder =
947 local_var_req_builder.query(&[("fields", ¶m_value.to_string())]);
948 }
949 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
950 local_var_req_builder = local_var_req_builder
951 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
952 }
953
954 let local_var_req = local_var_req_builder.build()?;
955 let local_var_resp = local_var_client.execute(local_var_req).await?;
956
957 let local_var_status = local_var_resp.status();
958 let local_var_content_type = local_var_resp
959 .headers()
960 .get("content-type")
961 .and_then(|v| v.to_str().ok())
962 .unwrap_or("application/octet-stream");
963 let local_var_content_type = super::ContentType::from(local_var_content_type);
964 let local_var_content = local_var_resp.text().await?;
965
966 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
967 match local_var_content_type {
968 ContentType::Json => {
969 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
970 }
971 ContentType::Text => {
972 return Err(Error::from(serde_json::Error::custom(
973 "Received `text/plain` content type response that cannot be converted to \
974 `models::TravelRuleVasp`",
975 )));
976 }
977 ContentType::Unsupported(local_var_unknown_type) => {
978 return Err(Error::from(serde_json::Error::custom(format!(
979 "Received `{local_var_unknown_type}` content type response that cannot be \
980 converted to `models::TravelRuleVasp`"
981 ))));
982 }
983 }
984 } else {
985 let local_var_entity: Option<GetVaspbyDidError> =
986 serde_json::from_str(&local_var_content).ok();
987 let local_var_error = ResponseContent {
988 status: local_var_status,
989 content: local_var_content,
990 entity: local_var_entity,
991 };
992 Err(Error::ResponseError(local_var_error))
993 }
994 }
995
996 async fn get_vasps(
1000 &self,
1001 params: GetVaspsParams,
1002 ) -> Result<models::TravelRuleGetAllVaspsResponse, Error<GetVaspsError>> {
1003 let GetVaspsParams {
1004 order,
1005 per_page,
1006 page,
1007 fields,
1008 q,
1009 review_value,
1010 } = params;
1011
1012 let local_var_configuration = &self.configuration;
1013
1014 let local_var_client = &local_var_configuration.client;
1015
1016 let local_var_uri_str = format!(
1017 "{}/screening/travel_rule/vasp",
1018 local_var_configuration.base_path
1019 );
1020 let mut local_var_req_builder =
1021 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1022
1023 if let Some(ref param_value) = order {
1024 local_var_req_builder =
1025 local_var_req_builder.query(&[("order", ¶m_value.to_string())]);
1026 }
1027 if let Some(ref param_value) = per_page {
1028 local_var_req_builder =
1029 local_var_req_builder.query(&[("per_page", ¶m_value.to_string())]);
1030 }
1031 if let Some(ref param_value) = page {
1032 local_var_req_builder =
1033 local_var_req_builder.query(&[("page", ¶m_value.to_string())]);
1034 }
1035 if let Some(ref param_value) = fields {
1036 local_var_req_builder =
1037 local_var_req_builder.query(&[("fields", ¶m_value.to_string())]);
1038 }
1039 if let Some(ref param_value) = q {
1040 local_var_req_builder = local_var_req_builder.query(&[("q", ¶m_value.to_string())]);
1041 }
1042 if let Some(ref param_value) = review_value {
1043 local_var_req_builder =
1044 local_var_req_builder.query(&[("reviewValue", ¶m_value.to_string())]);
1045 }
1046 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1047 local_var_req_builder = local_var_req_builder
1048 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1049 }
1050
1051 let local_var_req = local_var_req_builder.build()?;
1052 let local_var_resp = local_var_client.execute(local_var_req).await?;
1053
1054 let local_var_status = local_var_resp.status();
1055 let local_var_content_type = local_var_resp
1056 .headers()
1057 .get("content-type")
1058 .and_then(|v| v.to_str().ok())
1059 .unwrap_or("application/octet-stream");
1060 let local_var_content_type = super::ContentType::from(local_var_content_type);
1061 let local_var_content = local_var_resp.text().await?;
1062
1063 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1064 match local_var_content_type {
1065 ContentType::Json => {
1066 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1067 }
1068 ContentType::Text => {
1069 return Err(Error::from(serde_json::Error::custom(
1070 "Received `text/plain` content type response that cannot be converted to \
1071 `models::TravelRuleGetAllVaspsResponse`",
1072 )));
1073 }
1074 ContentType::Unsupported(local_var_unknown_type) => {
1075 return Err(Error::from(serde_json::Error::custom(format!(
1076 "Received `{local_var_unknown_type}` content type response that cannot be \
1077 converted to `models::TravelRuleGetAllVaspsResponse`"
1078 ))));
1079 }
1080 }
1081 } else {
1082 let local_var_entity: Option<GetVaspsError> =
1083 serde_json::from_str(&local_var_content).ok();
1084 let local_var_error = ResponseContent {
1085 status: local_var_status,
1086 content: local_var_content,
1087 entity: local_var_entity,
1088 };
1089 Err(Error::ResponseError(local_var_error))
1090 }
1091 }
1092
1093 async fn retry_rejected_transaction_bypass_screening_checks(
1099 &self,
1100 params: RetryRejectedTransactionBypassScreeningChecksParams,
1101 ) -> Result<
1102 models::CreateTransactionResponse,
1103 Error<RetryRejectedTransactionBypassScreeningChecksError>,
1104 > {
1105 let RetryRejectedTransactionBypassScreeningChecksParams {
1106 tx_id,
1107 idempotency_key,
1108 } = params;
1109
1110 let local_var_configuration = &self.configuration;
1111
1112 let local_var_client = &local_var_configuration.client;
1113
1114 let local_var_uri_str = format!(
1115 "{}/screening/transaction/{txId}/bypass_screening_policy",
1116 local_var_configuration.base_path,
1117 txId = crate::apis::urlencode(tx_id)
1118 );
1119 let mut local_var_req_builder =
1120 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1121
1122 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1123 local_var_req_builder = local_var_req_builder
1124 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1125 }
1126 if let Some(local_var_param_value) = idempotency_key {
1127 local_var_req_builder =
1128 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1129 }
1130
1131 let local_var_req = local_var_req_builder.build()?;
1132 let local_var_resp = local_var_client.execute(local_var_req).await?;
1133
1134 let local_var_status = local_var_resp.status();
1135 let local_var_content_type = local_var_resp
1136 .headers()
1137 .get("content-type")
1138 .and_then(|v| v.to_str().ok())
1139 .unwrap_or("application/octet-stream");
1140 let local_var_content_type = super::ContentType::from(local_var_content_type);
1141 let local_var_content = local_var_resp.text().await?;
1142
1143 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1144 match local_var_content_type {
1145 ContentType::Json => {
1146 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1147 }
1148 ContentType::Text => {
1149 return Err(Error::from(serde_json::Error::custom(
1150 "Received `text/plain` content type response that cannot be converted to \
1151 `models::CreateTransactionResponse`",
1152 )));
1153 }
1154 ContentType::Unsupported(local_var_unknown_type) => {
1155 return Err(Error::from(serde_json::Error::custom(format!(
1156 "Received `{local_var_unknown_type}` content type response that cannot be \
1157 converted to `models::CreateTransactionResponse`"
1158 ))));
1159 }
1160 }
1161 } else {
1162 let local_var_entity: Option<RetryRejectedTransactionBypassScreeningChecksError> =
1163 serde_json::from_str(&local_var_content).ok();
1164 let local_var_error = ResponseContent {
1165 status: local_var_status,
1166 content: local_var_content,
1167 entity: local_var_entity,
1168 };
1169 Err(Error::ResponseError(local_var_error))
1170 }
1171 }
1172
1173 async fn set_aml_verdict(
1176 &self,
1177 params: SetAmlVerdictParams,
1178 ) -> Result<models::AmlVerdictManualResponse, Error<SetAmlVerdictError>> {
1179 let SetAmlVerdictParams {
1180 aml_verdict_manual_request,
1181 idempotency_key,
1182 } = params;
1183
1184 let local_var_configuration = &self.configuration;
1185
1186 let local_var_client = &local_var_configuration.client;
1187
1188 let local_var_uri_str = format!(
1189 "{}/screening/aml/verdict/manual",
1190 local_var_configuration.base_path
1191 );
1192 let mut local_var_req_builder =
1193 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1194
1195 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1196 local_var_req_builder = local_var_req_builder
1197 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1198 }
1199 if let Some(local_var_param_value) = idempotency_key {
1200 local_var_req_builder =
1201 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1202 }
1203 local_var_req_builder = local_var_req_builder.json(&aml_verdict_manual_request);
1204
1205 let local_var_req = local_var_req_builder.build()?;
1206 let local_var_resp = local_var_client.execute(local_var_req).await?;
1207
1208 let local_var_status = local_var_resp.status();
1209 let local_var_content_type = local_var_resp
1210 .headers()
1211 .get("content-type")
1212 .and_then(|v| v.to_str().ok())
1213 .unwrap_or("application/octet-stream");
1214 let local_var_content_type = super::ContentType::from(local_var_content_type);
1215 let local_var_content = local_var_resp.text().await?;
1216
1217 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1218 match local_var_content_type {
1219 ContentType::Json => {
1220 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1221 }
1222 ContentType::Text => {
1223 return Err(Error::from(serde_json::Error::custom(
1224 "Received `text/plain` content type response that cannot be converted to \
1225 `models::AmlVerdictManualResponse`",
1226 )));
1227 }
1228 ContentType::Unsupported(local_var_unknown_type) => {
1229 return Err(Error::from(serde_json::Error::custom(format!(
1230 "Received `{local_var_unknown_type}` content type response that cannot be \
1231 converted to `models::AmlVerdictManualResponse`"
1232 ))));
1233 }
1234 }
1235 } else {
1236 let local_var_entity: Option<SetAmlVerdictError> =
1237 serde_json::from_str(&local_var_content).ok();
1238 let local_var_error = ResponseContent {
1239 status: local_var_status,
1240 content: local_var_content,
1241 entity: local_var_entity,
1242 };
1243 Err(Error::ResponseError(local_var_error))
1244 }
1245 }
1246
1247 async fn set_vasp_for_vault(
1250 &self,
1251 params: SetVaspForVaultParams,
1252 ) -> Result<models::TravelRuleVaspForVault, Error<SetVaspForVaultError>> {
1253 let SetVaspForVaultParams {
1254 vault_account_id,
1255 travel_rule_vasp_for_vault,
1256 idempotency_key,
1257 } = params;
1258
1259 let local_var_configuration = &self.configuration;
1260
1261 let local_var_client = &local_var_configuration.client;
1262
1263 let local_var_uri_str = format!(
1264 "{}/screening/travel_rule/vault/{vaultAccountId}/vasp",
1265 local_var_configuration.base_path,
1266 vaultAccountId = crate::apis::urlencode(vault_account_id)
1267 );
1268 let mut local_var_req_builder =
1269 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1270
1271 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1272 local_var_req_builder = local_var_req_builder
1273 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1274 }
1275 if let Some(local_var_param_value) = idempotency_key {
1276 local_var_req_builder =
1277 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1278 }
1279 local_var_req_builder = local_var_req_builder.json(&travel_rule_vasp_for_vault);
1280
1281 let local_var_req = local_var_req_builder.build()?;
1282 let local_var_resp = local_var_client.execute(local_var_req).await?;
1283
1284 let local_var_status = local_var_resp.status();
1285 let local_var_content_type = local_var_resp
1286 .headers()
1287 .get("content-type")
1288 .and_then(|v| v.to_str().ok())
1289 .unwrap_or("application/octet-stream");
1290 let local_var_content_type = super::ContentType::from(local_var_content_type);
1291 let local_var_content = local_var_resp.text().await?;
1292
1293 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1294 match local_var_content_type {
1295 ContentType::Json => {
1296 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1297 }
1298 ContentType::Text => {
1299 return Err(Error::from(serde_json::Error::custom(
1300 "Received `text/plain` content type response that cannot be converted to \
1301 `models::TravelRuleVaspForVault`",
1302 )));
1303 }
1304 ContentType::Unsupported(local_var_unknown_type) => {
1305 return Err(Error::from(serde_json::Error::custom(format!(
1306 "Received `{local_var_unknown_type}` content type response that cannot be \
1307 converted to `models::TravelRuleVaspForVault`"
1308 ))));
1309 }
1310 }
1311 } else {
1312 let local_var_entity: Option<SetVaspForVaultError> =
1313 serde_json::from_str(&local_var_content).ok();
1314 let local_var_error = ResponseContent {
1315 status: local_var_status,
1316 content: local_var_content,
1317 entity: local_var_entity,
1318 };
1319 Err(Error::ResponseError(local_var_error))
1320 }
1321 }
1322
1323 async fn update_aml_screening_configuration(
1327 &self,
1328 params: UpdateAmlScreeningConfigurationParams,
1329 ) -> Result<models::ScreeningConfigurationsRequest, Error<UpdateAmlScreeningConfigurationError>>
1330 {
1331 let UpdateAmlScreeningConfigurationParams { idempotency_key } = params;
1332
1333 let local_var_configuration = &self.configuration;
1334
1335 let local_var_client = &local_var_configuration.client;
1336
1337 let local_var_uri_str = format!(
1338 "{}/screening/aml/policy_configuration",
1339 local_var_configuration.base_path
1340 );
1341 let mut local_var_req_builder =
1342 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1343
1344 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1345 local_var_req_builder = local_var_req_builder
1346 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1347 }
1348 if let Some(local_var_param_value) = idempotency_key {
1349 local_var_req_builder =
1350 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1351 }
1352
1353 let local_var_req = local_var_req_builder.build()?;
1354 let local_var_resp = local_var_client.execute(local_var_req).await?;
1355
1356 let local_var_status = local_var_resp.status();
1357 let local_var_content_type = local_var_resp
1358 .headers()
1359 .get("content-type")
1360 .and_then(|v| v.to_str().ok())
1361 .unwrap_or("application/octet-stream");
1362 let local_var_content_type = super::ContentType::from(local_var_content_type);
1363 let local_var_content = local_var_resp.text().await?;
1364
1365 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1366 match local_var_content_type {
1367 ContentType::Json => {
1368 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1369 }
1370 ContentType::Text => {
1371 return Err(Error::from(serde_json::Error::custom(
1372 "Received `text/plain` content type response that cannot be converted to \
1373 `models::ScreeningConfigurationsRequest`",
1374 )));
1375 }
1376 ContentType::Unsupported(local_var_unknown_type) => {
1377 return Err(Error::from(serde_json::Error::custom(format!(
1378 "Received `{local_var_unknown_type}` content type response that cannot be \
1379 converted to `models::ScreeningConfigurationsRequest`"
1380 ))));
1381 }
1382 }
1383 } else {
1384 let local_var_entity: Option<UpdateAmlScreeningConfigurationError> =
1385 serde_json::from_str(&local_var_content).ok();
1386 let local_var_error = ResponseContent {
1387 status: local_var_status,
1388 content: local_var_content,
1389 entity: local_var_entity,
1390 };
1391 Err(Error::ResponseError(local_var_error))
1392 }
1393 }
1394
1395 async fn update_screening_configuration(
1397 &self,
1398 params: UpdateScreeningConfigurationParams,
1399 ) -> Result<models::ScreeningUpdateConfigurations, Error<UpdateScreeningConfigurationError>>
1400 {
1401 let UpdateScreeningConfigurationParams {
1402 screening_update_configurations,
1403 idempotency_key,
1404 } = params;
1405
1406 let local_var_configuration = &self.configuration;
1407
1408 let local_var_client = &local_var_configuration.client;
1409
1410 let local_var_uri_str = format!(
1411 "{}/screening/configurations",
1412 local_var_configuration.base_path
1413 );
1414 let mut local_var_req_builder =
1415 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1416
1417 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1418 local_var_req_builder = local_var_req_builder
1419 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1420 }
1421 if let Some(local_var_param_value) = idempotency_key {
1422 local_var_req_builder =
1423 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1424 }
1425 local_var_req_builder = local_var_req_builder.json(&screening_update_configurations);
1426
1427 let local_var_req = local_var_req_builder.build()?;
1428 let local_var_resp = local_var_client.execute(local_var_req).await?;
1429
1430 let local_var_status = local_var_resp.status();
1431 let local_var_content_type = local_var_resp
1432 .headers()
1433 .get("content-type")
1434 .and_then(|v| v.to_str().ok())
1435 .unwrap_or("application/octet-stream");
1436 let local_var_content_type = super::ContentType::from(local_var_content_type);
1437 let local_var_content = local_var_resp.text().await?;
1438
1439 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1440 match local_var_content_type {
1441 ContentType::Json => {
1442 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1443 }
1444 ContentType::Text => {
1445 return Err(Error::from(serde_json::Error::custom(
1446 "Received `text/plain` content type response that cannot be converted to \
1447 `models::ScreeningUpdateConfigurations`",
1448 )));
1449 }
1450 ContentType::Unsupported(local_var_unknown_type) => {
1451 return Err(Error::from(serde_json::Error::custom(format!(
1452 "Received `{local_var_unknown_type}` content type response that cannot be \
1453 converted to `models::ScreeningUpdateConfigurations`"
1454 ))));
1455 }
1456 }
1457 } else {
1458 let local_var_entity: Option<UpdateScreeningConfigurationError> =
1459 serde_json::from_str(&local_var_content).ok();
1460 let local_var_error = ResponseContent {
1461 status: local_var_status,
1462 content: local_var_content,
1463 entity: local_var_entity,
1464 };
1465 Err(Error::ResponseError(local_var_error))
1466 }
1467 }
1468
1469 async fn update_travel_rule_config(
1473 &self,
1474 params: UpdateTravelRuleConfigParams,
1475 ) -> Result<models::ScreeningConfigurationsRequest, Error<UpdateTravelRuleConfigError>> {
1476 let UpdateTravelRuleConfigParams { idempotency_key } = params;
1477
1478 let local_var_configuration = &self.configuration;
1479
1480 let local_var_client = &local_var_configuration.client;
1481
1482 let local_var_uri_str = format!(
1483 "{}/screening/travel_rule/policy_configuration",
1484 local_var_configuration.base_path
1485 );
1486 let mut local_var_req_builder =
1487 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1488
1489 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1490 local_var_req_builder = local_var_req_builder
1491 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1492 }
1493 if let Some(local_var_param_value) = idempotency_key {
1494 local_var_req_builder =
1495 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1496 }
1497
1498 let local_var_req = local_var_req_builder.build()?;
1499 let local_var_resp = local_var_client.execute(local_var_req).await?;
1500
1501 let local_var_status = local_var_resp.status();
1502 let local_var_content_type = local_var_resp
1503 .headers()
1504 .get("content-type")
1505 .and_then(|v| v.to_str().ok())
1506 .unwrap_or("application/octet-stream");
1507 let local_var_content_type = super::ContentType::from(local_var_content_type);
1508 let local_var_content = local_var_resp.text().await?;
1509
1510 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1511 match local_var_content_type {
1512 ContentType::Json => {
1513 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1514 }
1515 ContentType::Text => {
1516 return Err(Error::from(serde_json::Error::custom(
1517 "Received `text/plain` content type response that cannot be converted to \
1518 `models::ScreeningConfigurationsRequest`",
1519 )));
1520 }
1521 ContentType::Unsupported(local_var_unknown_type) => {
1522 return Err(Error::from(serde_json::Error::custom(format!(
1523 "Received `{local_var_unknown_type}` content type response that cannot be \
1524 converted to `models::ScreeningConfigurationsRequest`"
1525 ))));
1526 }
1527 }
1528 } else {
1529 let local_var_entity: Option<UpdateTravelRuleConfigError> =
1530 serde_json::from_str(&local_var_content).ok();
1531 let local_var_error = ResponseContent {
1532 status: local_var_status,
1533 content: local_var_content,
1534 entity: local_var_entity,
1535 };
1536 Err(Error::ResponseError(local_var_error))
1537 }
1538 }
1539
1540 async fn update_vasp(
1544 &self,
1545 params: UpdateVaspParams,
1546 ) -> Result<models::TravelRuleUpdateVaspDetails, Error<UpdateVaspError>> {
1547 let UpdateVaspParams {
1548 travel_rule_update_vasp_details,
1549 idempotency_key,
1550 } = params;
1551
1552 let local_var_configuration = &self.configuration;
1553
1554 let local_var_client = &local_var_configuration.client;
1555
1556 let local_var_uri_str = format!(
1557 "{}/screening/travel_rule/vasp/update",
1558 local_var_configuration.base_path
1559 );
1560 let mut local_var_req_builder =
1561 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1562
1563 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1564 local_var_req_builder = local_var_req_builder
1565 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1566 }
1567 if let Some(local_var_param_value) = idempotency_key {
1568 local_var_req_builder =
1569 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1570 }
1571 local_var_req_builder = local_var_req_builder.json(&travel_rule_update_vasp_details);
1572
1573 let local_var_req = local_var_req_builder.build()?;
1574 let local_var_resp = local_var_client.execute(local_var_req).await?;
1575
1576 let local_var_status = local_var_resp.status();
1577 let local_var_content_type = local_var_resp
1578 .headers()
1579 .get("content-type")
1580 .and_then(|v| v.to_str().ok())
1581 .unwrap_or("application/octet-stream");
1582 let local_var_content_type = super::ContentType::from(local_var_content_type);
1583 let local_var_content = local_var_resp.text().await?;
1584
1585 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1586 match local_var_content_type {
1587 ContentType::Json => {
1588 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1589 }
1590 ContentType::Text => {
1591 return Err(Error::from(serde_json::Error::custom(
1592 "Received `text/plain` content type response that cannot be converted to \
1593 `models::TravelRuleUpdateVaspDetails`",
1594 )));
1595 }
1596 ContentType::Unsupported(local_var_unknown_type) => {
1597 return Err(Error::from(serde_json::Error::custom(format!(
1598 "Received `{local_var_unknown_type}` content type response that cannot be \
1599 converted to `models::TravelRuleUpdateVaspDetails`"
1600 ))));
1601 }
1602 }
1603 } else {
1604 let local_var_entity: Option<UpdateVaspError> =
1605 serde_json::from_str(&local_var_content).ok();
1606 let local_var_error = ResponseContent {
1607 status: local_var_status,
1608 content: local_var_content,
1609 entity: local_var_entity,
1610 };
1611 Err(Error::ResponseError(local_var_error))
1612 }
1613 }
1614
1615 async fn validate_full_travel_rule_transaction(
1617 &self,
1618 params: ValidateFullTravelRuleTransactionParams,
1619 ) -> Result<
1620 models::TravelRuleValidateTransactionResponse,
1621 Error<ValidateFullTravelRuleTransactionError>,
1622 > {
1623 let ValidateFullTravelRuleTransactionParams {
1624 travel_rule_validate_full_transaction_request,
1625 notation,
1626 idempotency_key,
1627 } = params;
1628
1629 let local_var_configuration = &self.configuration;
1630
1631 let local_var_client = &local_var_configuration.client;
1632
1633 let local_var_uri_str = format!(
1634 "{}/screening/travel_rule/transaction/validate/full",
1635 local_var_configuration.base_path
1636 );
1637 let mut local_var_req_builder =
1638 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1639
1640 if let Some(ref param_value) = notation {
1641 local_var_req_builder =
1642 local_var_req_builder.query(&[("notation", ¶m_value.to_string())]);
1643 }
1644 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1645 local_var_req_builder = local_var_req_builder
1646 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1647 }
1648 if let Some(local_var_param_value) = idempotency_key {
1649 local_var_req_builder =
1650 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1651 }
1652 local_var_req_builder =
1653 local_var_req_builder.json(&travel_rule_validate_full_transaction_request);
1654
1655 let local_var_req = local_var_req_builder.build()?;
1656 let local_var_resp = local_var_client.execute(local_var_req).await?;
1657
1658 let local_var_status = local_var_resp.status();
1659 let local_var_content_type = local_var_resp
1660 .headers()
1661 .get("content-type")
1662 .and_then(|v| v.to_str().ok())
1663 .unwrap_or("application/octet-stream");
1664 let local_var_content_type = super::ContentType::from(local_var_content_type);
1665 let local_var_content = local_var_resp.text().await?;
1666
1667 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1668 match local_var_content_type {
1669 ContentType::Json => {
1670 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1671 }
1672 ContentType::Text => {
1673 return Err(Error::from(serde_json::Error::custom(
1674 "Received `text/plain` content type response that cannot be converted to \
1675 `models::TravelRuleValidateTransactionResponse`",
1676 )));
1677 }
1678 ContentType::Unsupported(local_var_unknown_type) => {
1679 return Err(Error::from(serde_json::Error::custom(format!(
1680 "Received `{local_var_unknown_type}` content type response that cannot be \
1681 converted to `models::TravelRuleValidateTransactionResponse`"
1682 ))));
1683 }
1684 }
1685 } else {
1686 let local_var_entity: Option<ValidateFullTravelRuleTransactionError> =
1687 serde_json::from_str(&local_var_content).ok();
1688 let local_var_error = ResponseContent {
1689 status: local_var_status,
1690 content: local_var_content,
1691 entity: local_var_entity,
1692 };
1693 Err(Error::ResponseError(local_var_error))
1694 }
1695 }
1696
1697 async fn validate_travel_rule_transaction(
1699 &self,
1700 params: ValidateTravelRuleTransactionParams,
1701 ) -> Result<
1702 models::TravelRuleValidateTransactionResponse,
1703 Error<ValidateTravelRuleTransactionError>,
1704 > {
1705 let ValidateTravelRuleTransactionParams {
1706 travel_rule_validate_transaction_request,
1707 notation,
1708 idempotency_key,
1709 } = params;
1710
1711 let local_var_configuration = &self.configuration;
1712
1713 let local_var_client = &local_var_configuration.client;
1714
1715 let local_var_uri_str = format!(
1716 "{}/screening/travel_rule/transaction/validate",
1717 local_var_configuration.base_path
1718 );
1719 let mut local_var_req_builder =
1720 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1721
1722 if let Some(ref param_value) = notation {
1723 local_var_req_builder =
1724 local_var_req_builder.query(&[("notation", ¶m_value.to_string())]);
1725 }
1726 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1727 local_var_req_builder = local_var_req_builder
1728 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1729 }
1730 if let Some(local_var_param_value) = idempotency_key {
1731 local_var_req_builder =
1732 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1733 }
1734 local_var_req_builder =
1735 local_var_req_builder.json(&travel_rule_validate_transaction_request);
1736
1737 let local_var_req = local_var_req_builder.build()?;
1738 let local_var_resp = local_var_client.execute(local_var_req).await?;
1739
1740 let local_var_status = local_var_resp.status();
1741 let local_var_content_type = local_var_resp
1742 .headers()
1743 .get("content-type")
1744 .and_then(|v| v.to_str().ok())
1745 .unwrap_or("application/octet-stream");
1746 let local_var_content_type = super::ContentType::from(local_var_content_type);
1747 let local_var_content = local_var_resp.text().await?;
1748
1749 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1750 match local_var_content_type {
1751 ContentType::Json => {
1752 crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1753 }
1754 ContentType::Text => {
1755 return Err(Error::from(serde_json::Error::custom(
1756 "Received `text/plain` content type response that cannot be converted to \
1757 `models::TravelRuleValidateTransactionResponse`",
1758 )));
1759 }
1760 ContentType::Unsupported(local_var_unknown_type) => {
1761 return Err(Error::from(serde_json::Error::custom(format!(
1762 "Received `{local_var_unknown_type}` content type response that cannot be \
1763 converted to `models::TravelRuleValidateTransactionResponse`"
1764 ))));
1765 }
1766 }
1767 } else {
1768 let local_var_entity: Option<ValidateTravelRuleTransactionError> =
1769 serde_json::from_str(&local_var_content).ok();
1770 let local_var_error = ResponseContent {
1771 status: local_var_status,
1772 content: local_var_content,
1773 entity: local_var_entity,
1774 };
1775 Err(Error::ResponseError(local_var_error))
1776 }
1777 }
1778}
1779
1780#[derive(Debug, Clone, Serialize, Deserialize)]
1783#[serde(untagged)]
1784pub enum GetAmlPostScreeningPolicyError {
1785 UnknownValue(serde_json::Value),
1786}
1787
1788#[derive(Debug, Clone, Serialize, Deserialize)]
1791#[serde(untagged)]
1792pub enum GetAmlScreeningConfigurationError {
1793 UnknownValue(serde_json::Value),
1794}
1795
1796#[derive(Debug, Clone, Serialize, Deserialize)]
1799#[serde(untagged)]
1800pub enum GetAmlScreeningPolicyError {
1801 UnknownValue(serde_json::Value),
1802}
1803
1804#[derive(Debug, Clone, Serialize, Deserialize)]
1807#[serde(untagged)]
1808pub enum GetPostScreeningPolicyError {
1809 UnknownValue(serde_json::Value),
1810}
1811
1812#[derive(Debug, Clone, Serialize, Deserialize)]
1815#[serde(untagged)]
1816pub enum GetScreeningConfigurationError {
1817 UnknownValue(serde_json::Value),
1818}
1819
1820#[derive(Debug, Clone, Serialize, Deserialize)]
1823#[serde(untagged)]
1824pub enum GetScreeningFullDetailsError {
1825 DefaultResponse(models::ErrorSchema),
1826 UnknownValue(serde_json::Value),
1827}
1828
1829#[derive(Debug, Clone, Serialize, Deserialize)]
1831#[serde(untagged)]
1832pub enum GetScreeningPolicyError {
1833 UnknownValue(serde_json::Value),
1834}
1835
1836#[derive(Debug, Clone, Serialize, Deserialize)]
1838#[serde(untagged)]
1839pub enum GetVaspForVaultError {
1840 DefaultResponse(models::ErrorSchema),
1841 UnknownValue(serde_json::Value),
1842}
1843
1844#[derive(Debug, Clone, Serialize, Deserialize)]
1846#[serde(untagged)]
1847pub enum GetVaspbyDidError {
1848 Status400(),
1849 Status500(),
1850 UnknownValue(serde_json::Value),
1851}
1852
1853#[derive(Debug, Clone, Serialize, Deserialize)]
1855#[serde(untagged)]
1856pub enum GetVaspsError {
1857 UnknownValue(serde_json::Value),
1858}
1859
1860#[derive(Debug, Clone, Serialize, Deserialize)]
1863#[serde(untagged)]
1864pub enum RetryRejectedTransactionBypassScreeningChecksError {
1865 DefaultResponse(models::ErrorSchema),
1866 UnknownValue(serde_json::Value),
1867}
1868
1869#[derive(Debug, Clone, Serialize, Deserialize)]
1871#[serde(untagged)]
1872pub enum SetAmlVerdictError {
1873 Status400(models::ErrorSchema),
1874 Status425(models::ErrorSchema),
1875 Status500(models::ErrorSchema),
1876 DefaultResponse(models::ErrorSchema),
1877 UnknownValue(serde_json::Value),
1878}
1879
1880#[derive(Debug, Clone, Serialize, Deserialize)]
1882#[serde(untagged)]
1883pub enum SetVaspForVaultError {
1884 DefaultResponse(models::ErrorSchema),
1885 UnknownValue(serde_json::Value),
1886}
1887
1888#[derive(Debug, Clone, Serialize, Deserialize)]
1891#[serde(untagged)]
1892pub enum UpdateAmlScreeningConfigurationError {
1893 UnknownValue(serde_json::Value),
1894}
1895
1896#[derive(Debug, Clone, Serialize, Deserialize)]
1899#[serde(untagged)]
1900pub enum UpdateScreeningConfigurationError {
1901 UnknownValue(serde_json::Value),
1902}
1903
1904#[derive(Debug, Clone, Serialize, Deserialize)]
1907#[serde(untagged)]
1908pub enum UpdateTravelRuleConfigError {
1909 UnknownValue(serde_json::Value),
1910}
1911
1912#[derive(Debug, Clone, Serialize, Deserialize)]
1914#[serde(untagged)]
1915pub enum UpdateVaspError {
1916 Status400(),
1917 Status500(),
1918 UnknownValue(serde_json::Value),
1919}
1920
1921#[derive(Debug, Clone, Serialize, Deserialize)]
1924#[serde(untagged)]
1925pub enum ValidateFullTravelRuleTransactionError {
1926 Status400(),
1927 Status500(),
1928 UnknownValue(serde_json::Value),
1929}
1930
1931#[derive(Debug, Clone, Serialize, Deserialize)]
1934#[serde(untagged)]
1935pub enum ValidateTravelRuleTransactionError {
1936 Status400(),
1937 Status500(),
1938 UnknownValue(serde_json::Value),
1939}