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 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_vasp_for_vault(
134 &self,
135 params: SetVaspForVaultParams,
136 ) -> Result<models::TravelRuleVaspForVault, Error<SetVaspForVaultError>>;
137
138 async fn update_aml_screening_configuration(
144 &self,
145 params: UpdateAmlScreeningConfigurationParams,
146 ) -> Result<models::ScreeningConfigurationsRequest, Error<UpdateAmlScreeningConfigurationError>>;
147
148 async fn update_screening_configuration(
152 &self,
153 params: UpdateScreeningConfigurationParams,
154 ) -> Result<models::ScreeningUpdateConfigurations, Error<UpdateScreeningConfigurationError>>;
155
156 async fn update_travel_rule_config(
162 &self,
163 params: UpdateTravelRuleConfigParams,
164 ) -> Result<models::ScreeningConfigurationsRequest, Error<UpdateTravelRuleConfigError>>;
165
166 async fn update_vasp(
172 &self,
173 params: UpdateVaspParams,
174 ) -> Result<models::TravelRuleUpdateVaspDetails, Error<UpdateVaspError>>;
175
176 async fn validate_full_travel_rule_transaction(
180 &self,
181 params: ValidateFullTravelRuleTransactionParams,
182 ) -> Result<
183 models::TravelRuleValidateTransactionResponse,
184 Error<ValidateFullTravelRuleTransactionError>,
185 >;
186
187 async fn validate_travel_rule_transaction(
191 &self,
192 params: ValidateTravelRuleTransactionParams,
193 ) -> Result<
194 models::TravelRuleValidateTransactionResponse,
195 Error<ValidateTravelRuleTransactionError>,
196 >;
197}
198
199pub struct ComplianceApiClient {
200 configuration: Arc<configuration::Configuration>,
201}
202
203impl ComplianceApiClient {
204 pub fn new(configuration: Arc<configuration::Configuration>) -> Self {
205 Self { configuration }
206 }
207}
208
209#[derive(Clone, Debug)]
211#[cfg_attr(feature = "bon", derive(::bon::Builder))]
212pub struct GetScreeningFullDetailsParams {
213 pub tx_id: String,
215}
216
217#[derive(Clone, Debug)]
219#[cfg_attr(feature = "bon", derive(::bon::Builder))]
220pub struct GetVaspForVaultParams {
221 pub vault_account_id: String,
223}
224
225#[derive(Clone, Debug)]
227#[cfg_attr(feature = "bon", derive(::bon::Builder))]
228pub struct GetVaspbyDidParams {
229 pub did: String,
230 pub fields: Option<String>,
233}
234
235#[derive(Clone, Debug)]
237#[cfg_attr(feature = "bon", derive(::bon::Builder))]
238pub struct GetVaspsParams {
239 pub order: Option<String>,
241 pub per_page: Option<f64>,
243 pub page: Option<f64>,
245 pub fields: Option<String>,
248 pub q: Option<String>,
250 pub review_value: Option<String>,
255}
256
257#[derive(Clone, Debug)]
260#[cfg_attr(feature = "bon", derive(::bon::Builder))]
261pub struct RetryRejectedTransactionBypassScreeningChecksParams {
262 pub tx_id: String,
264 pub idempotency_key: Option<String>,
269}
270
271#[derive(Clone, Debug)]
273#[cfg_attr(feature = "bon", derive(::bon::Builder))]
274pub struct SetVaspForVaultParams {
275 pub vault_account_id: String,
277 pub travel_rule_vasp_for_vault: models::TravelRuleVaspForVault,
278 pub idempotency_key: Option<String>,
283}
284
285#[derive(Clone, Debug)]
288#[cfg_attr(feature = "bon", derive(::bon::Builder))]
289pub struct UpdateAmlScreeningConfigurationParams {
290 pub idempotency_key: Option<String>,
295}
296
297#[derive(Clone, Debug)]
300#[cfg_attr(feature = "bon", derive(::bon::Builder))]
301pub struct UpdateScreeningConfigurationParams {
302 pub screening_update_configurations: models::ScreeningUpdateConfigurations,
303 pub idempotency_key: Option<String>,
308}
309
310#[derive(Clone, Debug)]
312#[cfg_attr(feature = "bon", derive(::bon::Builder))]
313pub struct UpdateTravelRuleConfigParams {
314 pub idempotency_key: Option<String>,
319}
320
321#[derive(Clone, Debug)]
323#[cfg_attr(feature = "bon", derive(::bon::Builder))]
324pub struct UpdateVaspParams {
325 pub travel_rule_update_vasp_details: models::TravelRuleUpdateVaspDetails,
326 pub idempotency_key: Option<String>,
331}
332
333#[derive(Clone, Debug)]
336#[cfg_attr(feature = "bon", derive(::bon::Builder))]
337pub struct ValidateFullTravelRuleTransactionParams {
338 pub travel_rule_validate_full_transaction_request:
339 models::TravelRuleValidateFullTransactionRequest,
340 pub notation: Option<String>,
348 pub idempotency_key: Option<String>,
353}
354
355#[derive(Clone, Debug)]
358#[cfg_attr(feature = "bon", derive(::bon::Builder))]
359pub struct ValidateTravelRuleTransactionParams {
360 pub travel_rule_validate_transaction_request: models::TravelRuleValidateTransactionRequest,
361 pub notation: Option<String>,
369 pub idempotency_key: Option<String>,
374}
375
376#[async_trait]
377impl ComplianceApi for ComplianceApiClient {
378 async fn get_aml_post_screening_policy(
381 &self,
382 ) -> Result<models::ScreeningPolicyResponse, Error<GetAmlPostScreeningPolicyError>> {
383 let local_var_configuration = &self.configuration;
384
385 let local_var_client = &local_var_configuration.client;
386
387 let local_var_uri_str = format!(
388 "{}/screening/aml/post_screening_policy",
389 local_var_configuration.base_path
390 );
391 let mut local_var_req_builder =
392 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
393
394 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
395 local_var_req_builder = local_var_req_builder
396 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
397 }
398
399 let local_var_req = local_var_req_builder.build()?;
400 let local_var_resp = local_var_client.execute(local_var_req).await?;
401
402 let local_var_status = local_var_resp.status();
403 let local_var_content_type = local_var_resp
404 .headers()
405 .get("content-type")
406 .and_then(|v| v.to_str().ok())
407 .unwrap_or("application/octet-stream");
408 let local_var_content_type = super::ContentType::from(local_var_content_type);
409 let local_var_content = local_var_resp.text().await?;
410
411 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
412 match local_var_content_type {
413 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
414 ContentType::Text => {
415 return Err(Error::from(serde_json::Error::custom(
416 "Received `text/plain` content type response that cannot be converted to \
417 `models::ScreeningPolicyResponse`",
418 )))
419 }
420 ContentType::Unsupported(local_var_unknown_type) => {
421 return Err(Error::from(serde_json::Error::custom(format!(
422 "Received `{local_var_unknown_type}` content type response that cannot be \
423 converted to `models::ScreeningPolicyResponse`"
424 ))))
425 }
426 }
427 } else {
428 let local_var_entity: Option<GetAmlPostScreeningPolicyError> =
429 serde_json::from_str(&local_var_content).ok();
430 let local_var_error = ResponseContent {
431 status: local_var_status,
432 content: local_var_content,
433 entity: local_var_entity,
434 };
435 Err(Error::ResponseError(local_var_error))
436 }
437 }
438
439 async fn get_aml_screening_configuration(
443 &self,
444 ) -> Result<models::ScreeningConfigurationsRequest, Error<GetAmlScreeningConfigurationError>>
445 {
446 let local_var_configuration = &self.configuration;
447
448 let local_var_client = &local_var_configuration.client;
449
450 let local_var_uri_str = format!(
451 "{}/screening/aml/policy_configuration",
452 local_var_configuration.base_path
453 );
454 let mut local_var_req_builder =
455 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
456
457 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
458 local_var_req_builder = local_var_req_builder
459 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
460 }
461
462 let local_var_req = local_var_req_builder.build()?;
463 let local_var_resp = local_var_client.execute(local_var_req).await?;
464
465 let local_var_status = local_var_resp.status();
466 let local_var_content_type = local_var_resp
467 .headers()
468 .get("content-type")
469 .and_then(|v| v.to_str().ok())
470 .unwrap_or("application/octet-stream");
471 let local_var_content_type = super::ContentType::from(local_var_content_type);
472 let local_var_content = local_var_resp.text().await?;
473
474 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
475 match local_var_content_type {
476 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
477 ContentType::Text => {
478 return Err(Error::from(serde_json::Error::custom(
479 "Received `text/plain` content type response that cannot be converted to \
480 `models::ScreeningConfigurationsRequest`",
481 )))
482 }
483 ContentType::Unsupported(local_var_unknown_type) => {
484 return Err(Error::from(serde_json::Error::custom(format!(
485 "Received `{local_var_unknown_type}` content type response that cannot be \
486 converted to `models::ScreeningConfigurationsRequest`"
487 ))))
488 }
489 }
490 } else {
491 let local_var_entity: Option<GetAmlScreeningConfigurationError> =
492 serde_json::from_str(&local_var_content).ok();
493 let local_var_error = ResponseContent {
494 status: local_var_status,
495 content: local_var_content,
496 entity: local_var_entity,
497 };
498 Err(Error::ResponseError(local_var_error))
499 }
500 }
501
502 async fn get_aml_screening_policy(
505 &self,
506 ) -> Result<
507 models::ScreeningProviderRulesConfigurationResponse,
508 Error<GetAmlScreeningPolicyError>,
509 > {
510 let local_var_configuration = &self.configuration;
511
512 let local_var_client = &local_var_configuration.client;
513
514 let local_var_uri_str = format!(
515 "{}/screening/aml/screening_policy",
516 local_var_configuration.base_path
517 );
518 let mut local_var_req_builder =
519 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
520
521 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
522 local_var_req_builder = local_var_req_builder
523 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
524 }
525
526 let local_var_req = local_var_req_builder.build()?;
527 let local_var_resp = local_var_client.execute(local_var_req).await?;
528
529 let local_var_status = local_var_resp.status();
530 let local_var_content_type = local_var_resp
531 .headers()
532 .get("content-type")
533 .and_then(|v| v.to_str().ok())
534 .unwrap_or("application/octet-stream");
535 let local_var_content_type = super::ContentType::from(local_var_content_type);
536 let local_var_content = local_var_resp.text().await?;
537
538 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
539 match local_var_content_type {
540 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
541 ContentType::Text => {
542 return Err(Error::from(serde_json::Error::custom(
543 "Received `text/plain` content type response that cannot be converted to \
544 `models::ScreeningProviderRulesConfigurationResponse`",
545 )))
546 }
547 ContentType::Unsupported(local_var_unknown_type) => {
548 return Err(Error::from(serde_json::Error::custom(format!(
549 "Received `{local_var_unknown_type}` content type response that cannot be \
550 converted to `models::ScreeningProviderRulesConfigurationResponse`"
551 ))))
552 }
553 }
554 } else {
555 let local_var_entity: Option<GetAmlScreeningPolicyError> =
556 serde_json::from_str(&local_var_content).ok();
557 let local_var_error = ResponseContent {
558 status: local_var_status,
559 content: local_var_content,
560 entity: local_var_entity,
561 };
562 Err(Error::ResponseError(local_var_error))
563 }
564 }
565
566 async fn get_post_screening_policy(
569 &self,
570 ) -> Result<models::ScreeningPolicyResponse, Error<GetPostScreeningPolicyError>> {
571 let local_var_configuration = &self.configuration;
572
573 let local_var_client = &local_var_configuration.client;
574
575 let local_var_uri_str = format!(
576 "{}/screening/travel_rule/post_screening_policy",
577 local_var_configuration.base_path
578 );
579 let mut local_var_req_builder =
580 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
581
582 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
583 local_var_req_builder = local_var_req_builder
584 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
585 }
586
587 let local_var_req = local_var_req_builder.build()?;
588 let local_var_resp = local_var_client.execute(local_var_req).await?;
589
590 let local_var_status = local_var_resp.status();
591 let local_var_content_type = local_var_resp
592 .headers()
593 .get("content-type")
594 .and_then(|v| v.to_str().ok())
595 .unwrap_or("application/octet-stream");
596 let local_var_content_type = super::ContentType::from(local_var_content_type);
597 let local_var_content = local_var_resp.text().await?;
598
599 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
600 match local_var_content_type {
601 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
602 ContentType::Text => {
603 return Err(Error::from(serde_json::Error::custom(
604 "Received `text/plain` content type response that cannot be converted to \
605 `models::ScreeningPolicyResponse`",
606 )))
607 }
608 ContentType::Unsupported(local_var_unknown_type) => {
609 return Err(Error::from(serde_json::Error::custom(format!(
610 "Received `{local_var_unknown_type}` content type response that cannot be \
611 converted to `models::ScreeningPolicyResponse`"
612 ))))
613 }
614 }
615 } else {
616 let local_var_entity: Option<GetPostScreeningPolicyError> =
617 serde_json::from_str(&local_var_content).ok();
618 let local_var_error = ResponseContent {
619 status: local_var_status,
620 content: local_var_content,
621 entity: local_var_entity,
622 };
623 Err(Error::ResponseError(local_var_error))
624 }
625 }
626
627 async fn get_screening_configuration(
631 &self,
632 ) -> Result<models::ScreeningConfigurationsRequest, Error<GetScreeningConfigurationError>> {
633 let local_var_configuration = &self.configuration;
634
635 let local_var_client = &local_var_configuration.client;
636
637 let local_var_uri_str = format!(
638 "{}/screening/travel_rule/policy_configuration",
639 local_var_configuration.base_path
640 );
641 let mut local_var_req_builder =
642 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
643
644 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
645 local_var_req_builder = local_var_req_builder
646 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
647 }
648
649 let local_var_req = local_var_req_builder.build()?;
650 let local_var_resp = local_var_client.execute(local_var_req).await?;
651
652 let local_var_status = local_var_resp.status();
653 let local_var_content_type = local_var_resp
654 .headers()
655 .get("content-type")
656 .and_then(|v| v.to_str().ok())
657 .unwrap_or("application/octet-stream");
658 let local_var_content_type = super::ContentType::from(local_var_content_type);
659 let local_var_content = local_var_resp.text().await?;
660
661 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
662 match local_var_content_type {
663 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
664 ContentType::Text => {
665 return Err(Error::from(serde_json::Error::custom(
666 "Received `text/plain` content type response that cannot be converted to \
667 `models::ScreeningConfigurationsRequest`",
668 )))
669 }
670 ContentType::Unsupported(local_var_unknown_type) => {
671 return Err(Error::from(serde_json::Error::custom(format!(
672 "Received `{local_var_unknown_type}` content type response that cannot be \
673 converted to `models::ScreeningConfigurationsRequest`"
674 ))))
675 }
676 }
677 } else {
678 let local_var_entity: Option<GetScreeningConfigurationError> =
679 serde_json::from_str(&local_var_content).ok();
680 let local_var_error = ResponseContent {
681 status: local_var_status,
682 content: local_var_content,
683 entity: local_var_entity,
684 };
685 Err(Error::ResponseError(local_var_error))
686 }
687 }
688
689 async fn get_screening_full_details(
692 &self,
693 params: GetScreeningFullDetailsParams,
694 ) -> Result<models::ComplianceResultFullPayload, Error<GetScreeningFullDetailsError>> {
695 let GetScreeningFullDetailsParams { tx_id } = params;
696
697 let local_var_configuration = &self.configuration;
698
699 let local_var_client = &local_var_configuration.client;
700
701 let local_var_uri_str = format!(
702 "{}/screening/transaction/{txId}",
703 local_var_configuration.base_path,
704 txId = crate::apis::urlencode(tx_id)
705 );
706 let mut local_var_req_builder =
707 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
708
709 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
710 local_var_req_builder = local_var_req_builder
711 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
712 }
713
714 let local_var_req = local_var_req_builder.build()?;
715 let local_var_resp = local_var_client.execute(local_var_req).await?;
716
717 let local_var_status = local_var_resp.status();
718 let local_var_content_type = local_var_resp
719 .headers()
720 .get("content-type")
721 .and_then(|v| v.to_str().ok())
722 .unwrap_or("application/octet-stream");
723 let local_var_content_type = super::ContentType::from(local_var_content_type);
724 let local_var_content = local_var_resp.text().await?;
725
726 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
727 match local_var_content_type {
728 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
729 ContentType::Text => {
730 return Err(Error::from(serde_json::Error::custom(
731 "Received `text/plain` content type response that cannot be converted to \
732 `models::ComplianceResultFullPayload`",
733 )))
734 }
735 ContentType::Unsupported(local_var_unknown_type) => {
736 return Err(Error::from(serde_json::Error::custom(format!(
737 "Received `{local_var_unknown_type}` content type response that cannot be \
738 converted to `models::ComplianceResultFullPayload`"
739 ))))
740 }
741 }
742 } else {
743 let local_var_entity: Option<GetScreeningFullDetailsError> =
744 serde_json::from_str(&local_var_content).ok();
745 let local_var_error = ResponseContent {
746 status: local_var_status,
747 content: local_var_content,
748 entity: local_var_entity,
749 };
750 Err(Error::ResponseError(local_var_error))
751 }
752 }
753
754 async fn get_screening_policy(
757 &self,
758 ) -> Result<models::ScreeningProviderRulesConfigurationResponse, Error<GetScreeningPolicyError>>
759 {
760 let local_var_configuration = &self.configuration;
761
762 let local_var_client = &local_var_configuration.client;
763
764 let local_var_uri_str = format!(
765 "{}/screening/travel_rule/screening_policy",
766 local_var_configuration.base_path
767 );
768 let mut local_var_req_builder =
769 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
770
771 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
772 local_var_req_builder = local_var_req_builder
773 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
774 }
775
776 let local_var_req = local_var_req_builder.build()?;
777 let local_var_resp = local_var_client.execute(local_var_req).await?;
778
779 let local_var_status = local_var_resp.status();
780 let local_var_content_type = local_var_resp
781 .headers()
782 .get("content-type")
783 .and_then(|v| v.to_str().ok())
784 .unwrap_or("application/octet-stream");
785 let local_var_content_type = super::ContentType::from(local_var_content_type);
786 let local_var_content = local_var_resp.text().await?;
787
788 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
789 match local_var_content_type {
790 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
791 ContentType::Text => {
792 return Err(Error::from(serde_json::Error::custom(
793 "Received `text/plain` content type response that cannot be converted to \
794 `models::ScreeningProviderRulesConfigurationResponse`",
795 )))
796 }
797 ContentType::Unsupported(local_var_unknown_type) => {
798 return Err(Error::from(serde_json::Error::custom(format!(
799 "Received `{local_var_unknown_type}` content type response that cannot be \
800 converted to `models::ScreeningProviderRulesConfigurationResponse`"
801 ))))
802 }
803 }
804 } else {
805 let local_var_entity: Option<GetScreeningPolicyError> =
806 serde_json::from_str(&local_var_content).ok();
807 let local_var_error = ResponseContent {
808 status: local_var_status,
809 content: local_var_content,
810 entity: local_var_entity,
811 };
812 Err(Error::ResponseError(local_var_error))
813 }
814 }
815
816 async fn get_vasp_for_vault(
819 &self,
820 params: GetVaspForVaultParams,
821 ) -> Result<models::TravelRuleVaspForVault, Error<GetVaspForVaultError>> {
822 let GetVaspForVaultParams { vault_account_id } = params;
823
824 let local_var_configuration = &self.configuration;
825
826 let local_var_client = &local_var_configuration.client;
827
828 let local_var_uri_str = format!(
829 "{}/screening/travel_rule/vault/{vaultAccountId}/vasp",
830 local_var_configuration.base_path,
831 vaultAccountId = crate::apis::urlencode(vault_account_id)
832 );
833 let mut local_var_req_builder =
834 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
835
836 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
837 local_var_req_builder = local_var_req_builder
838 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
839 }
840
841 let local_var_req = local_var_req_builder.build()?;
842 let local_var_resp = local_var_client.execute(local_var_req).await?;
843
844 let local_var_status = local_var_resp.status();
845 let local_var_content_type = local_var_resp
846 .headers()
847 .get("content-type")
848 .and_then(|v| v.to_str().ok())
849 .unwrap_or("application/octet-stream");
850 let local_var_content_type = super::ContentType::from(local_var_content_type);
851 let local_var_content = local_var_resp.text().await?;
852
853 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
854 match local_var_content_type {
855 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
856 ContentType::Text => {
857 return Err(Error::from(serde_json::Error::custom(
858 "Received `text/plain` content type response that cannot be converted to \
859 `models::TravelRuleVaspForVault`",
860 )))
861 }
862 ContentType::Unsupported(local_var_unknown_type) => {
863 return Err(Error::from(serde_json::Error::custom(format!(
864 "Received `{local_var_unknown_type}` content type response that cannot be \
865 converted to `models::TravelRuleVaspForVault`"
866 ))))
867 }
868 }
869 } else {
870 let local_var_entity: Option<GetVaspForVaultError> =
871 serde_json::from_str(&local_var_content).ok();
872 let local_var_error = ResponseContent {
873 status: local_var_status,
874 content: local_var_content,
875 entity: local_var_entity,
876 };
877 Err(Error::ResponseError(local_var_error))
878 }
879 }
880
881 async fn get_vaspby_did(
885 &self,
886 params: GetVaspbyDidParams,
887 ) -> Result<models::TravelRuleVasp, Error<GetVaspbyDidError>> {
888 let GetVaspbyDidParams { did, fields } = params;
889
890 let local_var_configuration = &self.configuration;
891
892 let local_var_client = &local_var_configuration.client;
893
894 let local_var_uri_str = format!(
895 "{}/screening/travel_rule/vasp/{did}",
896 local_var_configuration.base_path,
897 did = crate::apis::urlencode(did)
898 );
899 let mut local_var_req_builder =
900 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
901
902 if let Some(ref local_var_str) = fields {
903 local_var_req_builder =
904 local_var_req_builder.query(&[("fields", &local_var_str.to_string())]);
905 }
906 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
907 local_var_req_builder = local_var_req_builder
908 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
909 }
910
911 let local_var_req = local_var_req_builder.build()?;
912 let local_var_resp = local_var_client.execute(local_var_req).await?;
913
914 let local_var_status = local_var_resp.status();
915 let local_var_content_type = local_var_resp
916 .headers()
917 .get("content-type")
918 .and_then(|v| v.to_str().ok())
919 .unwrap_or("application/octet-stream");
920 let local_var_content_type = super::ContentType::from(local_var_content_type);
921 let local_var_content = local_var_resp.text().await?;
922
923 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
924 match local_var_content_type {
925 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
926 ContentType::Text => {
927 return Err(Error::from(serde_json::Error::custom(
928 "Received `text/plain` content type response that cannot be converted to \
929 `models::TravelRuleVasp`",
930 )))
931 }
932 ContentType::Unsupported(local_var_unknown_type) => {
933 return Err(Error::from(serde_json::Error::custom(format!(
934 "Received `{local_var_unknown_type}` content type response that cannot be \
935 converted to `models::TravelRuleVasp`"
936 ))))
937 }
938 }
939 } else {
940 let local_var_entity: Option<GetVaspbyDidError> =
941 serde_json::from_str(&local_var_content).ok();
942 let local_var_error = ResponseContent {
943 status: local_var_status,
944 content: local_var_content,
945 entity: local_var_entity,
946 };
947 Err(Error::ResponseError(local_var_error))
948 }
949 }
950
951 async fn get_vasps(
955 &self,
956 params: GetVaspsParams,
957 ) -> Result<models::TravelRuleGetAllVaspsResponse, Error<GetVaspsError>> {
958 let GetVaspsParams {
959 order,
960 per_page,
961 page,
962 fields,
963 q,
964 review_value,
965 } = params;
966
967 let local_var_configuration = &self.configuration;
968
969 let local_var_client = &local_var_configuration.client;
970
971 let local_var_uri_str = format!(
972 "{}/screening/travel_rule/vasp",
973 local_var_configuration.base_path
974 );
975 let mut local_var_req_builder =
976 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
977
978 if let Some(ref local_var_str) = order {
979 local_var_req_builder =
980 local_var_req_builder.query(&[("order", &local_var_str.to_string())]);
981 }
982 if let Some(ref local_var_str) = per_page {
983 local_var_req_builder =
984 local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
985 }
986 if let Some(ref local_var_str) = page {
987 local_var_req_builder =
988 local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
989 }
990 if let Some(ref local_var_str) = fields {
991 local_var_req_builder =
992 local_var_req_builder.query(&[("fields", &local_var_str.to_string())]);
993 }
994 if let Some(ref local_var_str) = q {
995 local_var_req_builder =
996 local_var_req_builder.query(&[("q", &local_var_str.to_string())]);
997 }
998 if let Some(ref local_var_str) = review_value {
999 local_var_req_builder =
1000 local_var_req_builder.query(&[("reviewValue", &local_var_str.to_string())]);
1001 }
1002 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1003 local_var_req_builder = local_var_req_builder
1004 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1005 }
1006
1007 let local_var_req = local_var_req_builder.build()?;
1008 let local_var_resp = local_var_client.execute(local_var_req).await?;
1009
1010 let local_var_status = local_var_resp.status();
1011 let local_var_content_type = local_var_resp
1012 .headers()
1013 .get("content-type")
1014 .and_then(|v| v.to_str().ok())
1015 .unwrap_or("application/octet-stream");
1016 let local_var_content_type = super::ContentType::from(local_var_content_type);
1017 let local_var_content = local_var_resp.text().await?;
1018
1019 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1020 match local_var_content_type {
1021 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1022 ContentType::Text => {
1023 return Err(Error::from(serde_json::Error::custom(
1024 "Received `text/plain` content type response that cannot be converted to \
1025 `models::TravelRuleGetAllVaspsResponse`",
1026 )))
1027 }
1028 ContentType::Unsupported(local_var_unknown_type) => {
1029 return Err(Error::from(serde_json::Error::custom(format!(
1030 "Received `{local_var_unknown_type}` content type response that cannot be \
1031 converted to `models::TravelRuleGetAllVaspsResponse`"
1032 ))))
1033 }
1034 }
1035 } else {
1036 let local_var_entity: Option<GetVaspsError> =
1037 serde_json::from_str(&local_var_content).ok();
1038 let local_var_error = ResponseContent {
1039 status: local_var_status,
1040 content: local_var_content,
1041 entity: local_var_entity,
1042 };
1043 Err(Error::ResponseError(local_var_error))
1044 }
1045 }
1046
1047 async fn retry_rejected_transaction_bypass_screening_checks(
1053 &self,
1054 params: RetryRejectedTransactionBypassScreeningChecksParams,
1055 ) -> Result<
1056 models::CreateTransactionResponse,
1057 Error<RetryRejectedTransactionBypassScreeningChecksError>,
1058 > {
1059 let RetryRejectedTransactionBypassScreeningChecksParams {
1060 tx_id,
1061 idempotency_key,
1062 } = params;
1063
1064 let local_var_configuration = &self.configuration;
1065
1066 let local_var_client = &local_var_configuration.client;
1067
1068 let local_var_uri_str = format!(
1069 "{}/screening/transaction/{txId}/bypass_screening_policy",
1070 local_var_configuration.base_path,
1071 txId = crate::apis::urlencode(tx_id)
1072 );
1073 let mut local_var_req_builder =
1074 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1075
1076 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1077 local_var_req_builder = local_var_req_builder
1078 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1079 }
1080 if let Some(local_var_param_value) = idempotency_key {
1081 local_var_req_builder =
1082 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1083 }
1084
1085 let local_var_req = local_var_req_builder.build()?;
1086 let local_var_resp = local_var_client.execute(local_var_req).await?;
1087
1088 let local_var_status = local_var_resp.status();
1089 let local_var_content_type = local_var_resp
1090 .headers()
1091 .get("content-type")
1092 .and_then(|v| v.to_str().ok())
1093 .unwrap_or("application/octet-stream");
1094 let local_var_content_type = super::ContentType::from(local_var_content_type);
1095 let local_var_content = local_var_resp.text().await?;
1096
1097 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1098 match local_var_content_type {
1099 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1100 ContentType::Text => {
1101 return Err(Error::from(serde_json::Error::custom(
1102 "Received `text/plain` content type response that cannot be converted to \
1103 `models::CreateTransactionResponse`",
1104 )))
1105 }
1106 ContentType::Unsupported(local_var_unknown_type) => {
1107 return Err(Error::from(serde_json::Error::custom(format!(
1108 "Received `{local_var_unknown_type}` content type response that cannot be \
1109 converted to `models::CreateTransactionResponse`"
1110 ))))
1111 }
1112 }
1113 } else {
1114 let local_var_entity: Option<RetryRejectedTransactionBypassScreeningChecksError> =
1115 serde_json::from_str(&local_var_content).ok();
1116 let local_var_error = ResponseContent {
1117 status: local_var_status,
1118 content: local_var_content,
1119 entity: local_var_entity,
1120 };
1121 Err(Error::ResponseError(local_var_error))
1122 }
1123 }
1124
1125 async fn set_vasp_for_vault(
1128 &self,
1129 params: SetVaspForVaultParams,
1130 ) -> Result<models::TravelRuleVaspForVault, Error<SetVaspForVaultError>> {
1131 let SetVaspForVaultParams {
1132 vault_account_id,
1133 travel_rule_vasp_for_vault,
1134 idempotency_key,
1135 } = params;
1136
1137 let local_var_configuration = &self.configuration;
1138
1139 let local_var_client = &local_var_configuration.client;
1140
1141 let local_var_uri_str = format!(
1142 "{}/screening/travel_rule/vault/{vaultAccountId}/vasp",
1143 local_var_configuration.base_path,
1144 vaultAccountId = crate::apis::urlencode(vault_account_id)
1145 );
1146 let mut local_var_req_builder =
1147 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1148
1149 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1150 local_var_req_builder = local_var_req_builder
1151 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1152 }
1153 if let Some(local_var_param_value) = idempotency_key {
1154 local_var_req_builder =
1155 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1156 }
1157 local_var_req_builder = local_var_req_builder.json(&travel_rule_vasp_for_vault);
1158
1159 let local_var_req = local_var_req_builder.build()?;
1160 let local_var_resp = local_var_client.execute(local_var_req).await?;
1161
1162 let local_var_status = local_var_resp.status();
1163 let local_var_content_type = local_var_resp
1164 .headers()
1165 .get("content-type")
1166 .and_then(|v| v.to_str().ok())
1167 .unwrap_or("application/octet-stream");
1168 let local_var_content_type = super::ContentType::from(local_var_content_type);
1169 let local_var_content = local_var_resp.text().await?;
1170
1171 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1172 match local_var_content_type {
1173 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1174 ContentType::Text => {
1175 return Err(Error::from(serde_json::Error::custom(
1176 "Received `text/plain` content type response that cannot be converted to \
1177 `models::TravelRuleVaspForVault`",
1178 )))
1179 }
1180 ContentType::Unsupported(local_var_unknown_type) => {
1181 return Err(Error::from(serde_json::Error::custom(format!(
1182 "Received `{local_var_unknown_type}` content type response that cannot be \
1183 converted to `models::TravelRuleVaspForVault`"
1184 ))))
1185 }
1186 }
1187 } else {
1188 let local_var_entity: Option<SetVaspForVaultError> =
1189 serde_json::from_str(&local_var_content).ok();
1190 let local_var_error = ResponseContent {
1191 status: local_var_status,
1192 content: local_var_content,
1193 entity: local_var_entity,
1194 };
1195 Err(Error::ResponseError(local_var_error))
1196 }
1197 }
1198
1199 async fn update_aml_screening_configuration(
1203 &self,
1204 params: UpdateAmlScreeningConfigurationParams,
1205 ) -> Result<models::ScreeningConfigurationsRequest, Error<UpdateAmlScreeningConfigurationError>>
1206 {
1207 let UpdateAmlScreeningConfigurationParams { idempotency_key } = params;
1208
1209 let local_var_configuration = &self.configuration;
1210
1211 let local_var_client = &local_var_configuration.client;
1212
1213 let local_var_uri_str = format!(
1214 "{}/screening/aml/policy_configuration",
1215 local_var_configuration.base_path
1216 );
1217 let mut local_var_req_builder =
1218 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1219
1220 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1221 local_var_req_builder = local_var_req_builder
1222 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1223 }
1224 if let Some(local_var_param_value) = idempotency_key {
1225 local_var_req_builder =
1226 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1227 }
1228
1229 let local_var_req = local_var_req_builder.build()?;
1230 let local_var_resp = local_var_client.execute(local_var_req).await?;
1231
1232 let local_var_status = local_var_resp.status();
1233 let local_var_content_type = local_var_resp
1234 .headers()
1235 .get("content-type")
1236 .and_then(|v| v.to_str().ok())
1237 .unwrap_or("application/octet-stream");
1238 let local_var_content_type = super::ContentType::from(local_var_content_type);
1239 let local_var_content = local_var_resp.text().await?;
1240
1241 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1242 match local_var_content_type {
1243 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1244 ContentType::Text => {
1245 return Err(Error::from(serde_json::Error::custom(
1246 "Received `text/plain` content type response that cannot be converted to \
1247 `models::ScreeningConfigurationsRequest`",
1248 )))
1249 }
1250 ContentType::Unsupported(local_var_unknown_type) => {
1251 return Err(Error::from(serde_json::Error::custom(format!(
1252 "Received `{local_var_unknown_type}` content type response that cannot be \
1253 converted to `models::ScreeningConfigurationsRequest`"
1254 ))))
1255 }
1256 }
1257 } else {
1258 let local_var_entity: Option<UpdateAmlScreeningConfigurationError> =
1259 serde_json::from_str(&local_var_content).ok();
1260 let local_var_error = ResponseContent {
1261 status: local_var_status,
1262 content: local_var_content,
1263 entity: local_var_entity,
1264 };
1265 Err(Error::ResponseError(local_var_error))
1266 }
1267 }
1268
1269 async fn update_screening_configuration(
1271 &self,
1272 params: UpdateScreeningConfigurationParams,
1273 ) -> Result<models::ScreeningUpdateConfigurations, Error<UpdateScreeningConfigurationError>>
1274 {
1275 let UpdateScreeningConfigurationParams {
1276 screening_update_configurations,
1277 idempotency_key,
1278 } = params;
1279
1280 let local_var_configuration = &self.configuration;
1281
1282 let local_var_client = &local_var_configuration.client;
1283
1284 let local_var_uri_str = format!(
1285 "{}/screening/configurations",
1286 local_var_configuration.base_path
1287 );
1288 let mut local_var_req_builder =
1289 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1290
1291 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1292 local_var_req_builder = local_var_req_builder
1293 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1294 }
1295 if let Some(local_var_param_value) = idempotency_key {
1296 local_var_req_builder =
1297 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1298 }
1299 local_var_req_builder = local_var_req_builder.json(&screening_update_configurations);
1300
1301 let local_var_req = local_var_req_builder.build()?;
1302 let local_var_resp = local_var_client.execute(local_var_req).await?;
1303
1304 let local_var_status = local_var_resp.status();
1305 let local_var_content_type = local_var_resp
1306 .headers()
1307 .get("content-type")
1308 .and_then(|v| v.to_str().ok())
1309 .unwrap_or("application/octet-stream");
1310 let local_var_content_type = super::ContentType::from(local_var_content_type);
1311 let local_var_content = local_var_resp.text().await?;
1312
1313 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1314 match local_var_content_type {
1315 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1316 ContentType::Text => {
1317 return Err(Error::from(serde_json::Error::custom(
1318 "Received `text/plain` content type response that cannot be converted to \
1319 `models::ScreeningUpdateConfigurations`",
1320 )))
1321 }
1322 ContentType::Unsupported(local_var_unknown_type) => {
1323 return Err(Error::from(serde_json::Error::custom(format!(
1324 "Received `{local_var_unknown_type}` content type response that cannot be \
1325 converted to `models::ScreeningUpdateConfigurations`"
1326 ))))
1327 }
1328 }
1329 } else {
1330 let local_var_entity: Option<UpdateScreeningConfigurationError> =
1331 serde_json::from_str(&local_var_content).ok();
1332 let local_var_error = ResponseContent {
1333 status: local_var_status,
1334 content: local_var_content,
1335 entity: local_var_entity,
1336 };
1337 Err(Error::ResponseError(local_var_error))
1338 }
1339 }
1340
1341 async fn update_travel_rule_config(
1345 &self,
1346 params: UpdateTravelRuleConfigParams,
1347 ) -> Result<models::ScreeningConfigurationsRequest, Error<UpdateTravelRuleConfigError>> {
1348 let UpdateTravelRuleConfigParams { idempotency_key } = params;
1349
1350 let local_var_configuration = &self.configuration;
1351
1352 let local_var_client = &local_var_configuration.client;
1353
1354 let local_var_uri_str = format!(
1355 "{}/screening/travel_rule/policy_configuration",
1356 local_var_configuration.base_path
1357 );
1358 let mut local_var_req_builder =
1359 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1360
1361 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1362 local_var_req_builder = local_var_req_builder
1363 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1364 }
1365 if let Some(local_var_param_value) = idempotency_key {
1366 local_var_req_builder =
1367 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1368 }
1369
1370 let local_var_req = local_var_req_builder.build()?;
1371 let local_var_resp = local_var_client.execute(local_var_req).await?;
1372
1373 let local_var_status = local_var_resp.status();
1374 let local_var_content_type = local_var_resp
1375 .headers()
1376 .get("content-type")
1377 .and_then(|v| v.to_str().ok())
1378 .unwrap_or("application/octet-stream");
1379 let local_var_content_type = super::ContentType::from(local_var_content_type);
1380 let local_var_content = local_var_resp.text().await?;
1381
1382 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1383 match local_var_content_type {
1384 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1385 ContentType::Text => {
1386 return Err(Error::from(serde_json::Error::custom(
1387 "Received `text/plain` content type response that cannot be converted to \
1388 `models::ScreeningConfigurationsRequest`",
1389 )))
1390 }
1391 ContentType::Unsupported(local_var_unknown_type) => {
1392 return Err(Error::from(serde_json::Error::custom(format!(
1393 "Received `{local_var_unknown_type}` content type response that cannot be \
1394 converted to `models::ScreeningConfigurationsRequest`"
1395 ))))
1396 }
1397 }
1398 } else {
1399 let local_var_entity: Option<UpdateTravelRuleConfigError> =
1400 serde_json::from_str(&local_var_content).ok();
1401 let local_var_error = ResponseContent {
1402 status: local_var_status,
1403 content: local_var_content,
1404 entity: local_var_entity,
1405 };
1406 Err(Error::ResponseError(local_var_error))
1407 }
1408 }
1409
1410 async fn update_vasp(
1414 &self,
1415 params: UpdateVaspParams,
1416 ) -> Result<models::TravelRuleUpdateVaspDetails, Error<UpdateVaspError>> {
1417 let UpdateVaspParams {
1418 travel_rule_update_vasp_details,
1419 idempotency_key,
1420 } = params;
1421
1422 let local_var_configuration = &self.configuration;
1423
1424 let local_var_client = &local_var_configuration.client;
1425
1426 let local_var_uri_str = format!(
1427 "{}/screening/travel_rule/vasp/update",
1428 local_var_configuration.base_path
1429 );
1430 let mut local_var_req_builder =
1431 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1432
1433 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1434 local_var_req_builder = local_var_req_builder
1435 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1436 }
1437 if let Some(local_var_param_value) = idempotency_key {
1438 local_var_req_builder =
1439 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1440 }
1441 local_var_req_builder = local_var_req_builder.json(&travel_rule_update_vasp_details);
1442
1443 let local_var_req = local_var_req_builder.build()?;
1444 let local_var_resp = local_var_client.execute(local_var_req).await?;
1445
1446 let local_var_status = local_var_resp.status();
1447 let local_var_content_type = local_var_resp
1448 .headers()
1449 .get("content-type")
1450 .and_then(|v| v.to_str().ok())
1451 .unwrap_or("application/octet-stream");
1452 let local_var_content_type = super::ContentType::from(local_var_content_type);
1453 let local_var_content = local_var_resp.text().await?;
1454
1455 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1456 match local_var_content_type {
1457 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1458 ContentType::Text => {
1459 return Err(Error::from(serde_json::Error::custom(
1460 "Received `text/plain` content type response that cannot be converted to \
1461 `models::TravelRuleUpdateVaspDetails`",
1462 )))
1463 }
1464 ContentType::Unsupported(local_var_unknown_type) => {
1465 return Err(Error::from(serde_json::Error::custom(format!(
1466 "Received `{local_var_unknown_type}` content type response that cannot be \
1467 converted to `models::TravelRuleUpdateVaspDetails`"
1468 ))))
1469 }
1470 }
1471 } else {
1472 let local_var_entity: Option<UpdateVaspError> =
1473 serde_json::from_str(&local_var_content).ok();
1474 let local_var_error = ResponseContent {
1475 status: local_var_status,
1476 content: local_var_content,
1477 entity: local_var_entity,
1478 };
1479 Err(Error::ResponseError(local_var_error))
1480 }
1481 }
1482
1483 async fn validate_full_travel_rule_transaction(
1485 &self,
1486 params: ValidateFullTravelRuleTransactionParams,
1487 ) -> Result<
1488 models::TravelRuleValidateTransactionResponse,
1489 Error<ValidateFullTravelRuleTransactionError>,
1490 > {
1491 let ValidateFullTravelRuleTransactionParams {
1492 travel_rule_validate_full_transaction_request,
1493 notation,
1494 idempotency_key,
1495 } = params;
1496
1497 let local_var_configuration = &self.configuration;
1498
1499 let local_var_client = &local_var_configuration.client;
1500
1501 let local_var_uri_str = format!(
1502 "{}/screening/travel_rule/transaction/validate/full",
1503 local_var_configuration.base_path
1504 );
1505 let mut local_var_req_builder =
1506 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1507
1508 if let Some(ref local_var_str) = notation {
1509 local_var_req_builder =
1510 local_var_req_builder.query(&[("notation", &local_var_str.to_string())]);
1511 }
1512 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1513 local_var_req_builder = local_var_req_builder
1514 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1515 }
1516 if let Some(local_var_param_value) = idempotency_key {
1517 local_var_req_builder =
1518 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1519 }
1520 local_var_req_builder =
1521 local_var_req_builder.json(&travel_rule_validate_full_transaction_request);
1522
1523 let local_var_req = local_var_req_builder.build()?;
1524 let local_var_resp = local_var_client.execute(local_var_req).await?;
1525
1526 let local_var_status = local_var_resp.status();
1527 let local_var_content_type = local_var_resp
1528 .headers()
1529 .get("content-type")
1530 .and_then(|v| v.to_str().ok())
1531 .unwrap_or("application/octet-stream");
1532 let local_var_content_type = super::ContentType::from(local_var_content_type);
1533 let local_var_content = local_var_resp.text().await?;
1534
1535 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1536 match local_var_content_type {
1537 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1538 ContentType::Text => {
1539 return Err(Error::from(serde_json::Error::custom(
1540 "Received `text/plain` content type response that cannot be converted to \
1541 `models::TravelRuleValidateTransactionResponse`",
1542 )))
1543 }
1544 ContentType::Unsupported(local_var_unknown_type) => {
1545 return Err(Error::from(serde_json::Error::custom(format!(
1546 "Received `{local_var_unknown_type}` content type response that cannot be \
1547 converted to `models::TravelRuleValidateTransactionResponse`"
1548 ))))
1549 }
1550 }
1551 } else {
1552 let local_var_entity: Option<ValidateFullTravelRuleTransactionError> =
1553 serde_json::from_str(&local_var_content).ok();
1554 let local_var_error = ResponseContent {
1555 status: local_var_status,
1556 content: local_var_content,
1557 entity: local_var_entity,
1558 };
1559 Err(Error::ResponseError(local_var_error))
1560 }
1561 }
1562
1563 async fn validate_travel_rule_transaction(
1565 &self,
1566 params: ValidateTravelRuleTransactionParams,
1567 ) -> Result<
1568 models::TravelRuleValidateTransactionResponse,
1569 Error<ValidateTravelRuleTransactionError>,
1570 > {
1571 let ValidateTravelRuleTransactionParams {
1572 travel_rule_validate_transaction_request,
1573 notation,
1574 idempotency_key,
1575 } = params;
1576
1577 let local_var_configuration = &self.configuration;
1578
1579 let local_var_client = &local_var_configuration.client;
1580
1581 let local_var_uri_str = format!(
1582 "{}/screening/travel_rule/transaction/validate",
1583 local_var_configuration.base_path
1584 );
1585 let mut local_var_req_builder =
1586 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1587
1588 if let Some(ref local_var_str) = notation {
1589 local_var_req_builder =
1590 local_var_req_builder.query(&[("notation", &local_var_str.to_string())]);
1591 }
1592 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1593 local_var_req_builder = local_var_req_builder
1594 .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1595 }
1596 if let Some(local_var_param_value) = idempotency_key {
1597 local_var_req_builder =
1598 local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1599 }
1600 local_var_req_builder =
1601 local_var_req_builder.json(&travel_rule_validate_transaction_request);
1602
1603 let local_var_req = local_var_req_builder.build()?;
1604 let local_var_resp = local_var_client.execute(local_var_req).await?;
1605
1606 let local_var_status = local_var_resp.status();
1607 let local_var_content_type = local_var_resp
1608 .headers()
1609 .get("content-type")
1610 .and_then(|v| v.to_str().ok())
1611 .unwrap_or("application/octet-stream");
1612 let local_var_content_type = super::ContentType::from(local_var_content_type);
1613 let local_var_content = local_var_resp.text().await?;
1614
1615 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1616 match local_var_content_type {
1617 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1618 ContentType::Text => {
1619 return Err(Error::from(serde_json::Error::custom(
1620 "Received `text/plain` content type response that cannot be converted to \
1621 `models::TravelRuleValidateTransactionResponse`",
1622 )))
1623 }
1624 ContentType::Unsupported(local_var_unknown_type) => {
1625 return Err(Error::from(serde_json::Error::custom(format!(
1626 "Received `{local_var_unknown_type}` content type response that cannot be \
1627 converted to `models::TravelRuleValidateTransactionResponse`"
1628 ))))
1629 }
1630 }
1631 } else {
1632 let local_var_entity: Option<ValidateTravelRuleTransactionError> =
1633 serde_json::from_str(&local_var_content).ok();
1634 let local_var_error = ResponseContent {
1635 status: local_var_status,
1636 content: local_var_content,
1637 entity: local_var_entity,
1638 };
1639 Err(Error::ResponseError(local_var_error))
1640 }
1641 }
1642}
1643
1644#[derive(Debug, Clone, Serialize, Deserialize)]
1646#[serde(untagged)]
1647pub enum GetAmlPostScreeningPolicyError {
1648 UnknownValue(serde_json::Value),
1649}
1650
1651#[derive(Debug, Clone, Serialize, Deserialize)]
1653#[serde(untagged)]
1654pub enum GetAmlScreeningConfigurationError {
1655 UnknownValue(serde_json::Value),
1656}
1657
1658#[derive(Debug, Clone, Serialize, Deserialize)]
1660#[serde(untagged)]
1661pub enum GetAmlScreeningPolicyError {
1662 UnknownValue(serde_json::Value),
1663}
1664
1665#[derive(Debug, Clone, Serialize, Deserialize)]
1667#[serde(untagged)]
1668pub enum GetPostScreeningPolicyError {
1669 UnknownValue(serde_json::Value),
1670}
1671
1672#[derive(Debug, Clone, Serialize, Deserialize)]
1674#[serde(untagged)]
1675pub enum GetScreeningConfigurationError {
1676 UnknownValue(serde_json::Value),
1677}
1678
1679#[derive(Debug, Clone, Serialize, Deserialize)]
1681#[serde(untagged)]
1682pub enum GetScreeningFullDetailsError {
1683 DefaultResponse(models::ErrorSchema),
1684 UnknownValue(serde_json::Value),
1685}
1686
1687#[derive(Debug, Clone, Serialize, Deserialize)]
1689#[serde(untagged)]
1690pub enum GetScreeningPolicyError {
1691 UnknownValue(serde_json::Value),
1692}
1693
1694#[derive(Debug, Clone, Serialize, Deserialize)]
1696#[serde(untagged)]
1697pub enum GetVaspForVaultError {
1698 DefaultResponse(models::ErrorSchema),
1699 UnknownValue(serde_json::Value),
1700}
1701
1702#[derive(Debug, Clone, Serialize, Deserialize)]
1704#[serde(untagged)]
1705pub enum GetVaspbyDidError {
1706 Status400(),
1707 Status500(),
1708 UnknownValue(serde_json::Value),
1709}
1710
1711#[derive(Debug, Clone, Serialize, Deserialize)]
1713#[serde(untagged)]
1714pub enum GetVaspsError {
1715 UnknownValue(serde_json::Value),
1716}
1717
1718#[derive(Debug, Clone, Serialize, Deserialize)]
1721#[serde(untagged)]
1722pub enum RetryRejectedTransactionBypassScreeningChecksError {
1723 DefaultResponse(models::ErrorSchema),
1724 UnknownValue(serde_json::Value),
1725}
1726
1727#[derive(Debug, Clone, Serialize, Deserialize)]
1729#[serde(untagged)]
1730pub enum SetVaspForVaultError {
1731 DefaultResponse(models::ErrorSchema),
1732 UnknownValue(serde_json::Value),
1733}
1734
1735#[derive(Debug, Clone, Serialize, Deserialize)]
1737#[serde(untagged)]
1738pub enum UpdateAmlScreeningConfigurationError {
1739 UnknownValue(serde_json::Value),
1740}
1741
1742#[derive(Debug, Clone, Serialize, Deserialize)]
1744#[serde(untagged)]
1745pub enum UpdateScreeningConfigurationError {
1746 UnknownValue(serde_json::Value),
1747}
1748
1749#[derive(Debug, Clone, Serialize, Deserialize)]
1751#[serde(untagged)]
1752pub enum UpdateTravelRuleConfigError {
1753 UnknownValue(serde_json::Value),
1754}
1755
1756#[derive(Debug, Clone, Serialize, Deserialize)]
1758#[serde(untagged)]
1759pub enum UpdateVaspError {
1760 Status400(),
1761 Status500(),
1762 UnknownValue(serde_json::Value),
1763}
1764
1765#[derive(Debug, Clone, Serialize, Deserialize)]
1767#[serde(untagged)]
1768pub enum ValidateFullTravelRuleTransactionError {
1769 Status400(),
1770 Status500(),
1771 UnknownValue(serde_json::Value),
1772}
1773
1774#[derive(Debug, Clone, Serialize, Deserialize)]
1776#[serde(untagged)]
1777pub enum ValidateTravelRuleTransactionError {
1778 Status400(),
1779 Status500(),
1780 UnknownValue(serde_json::Value),
1781}