aws_sdk_paymentcryptographydata/operation/verify_card_validation_data/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::verify_card_validation_data::_verify_card_validation_data_output::VerifyCardValidationDataOutputBuilder;
3
4pub use crate::operation::verify_card_validation_data::_verify_card_validation_data_input::VerifyCardValidationDataInputBuilder;
5
6impl crate::operation::verify_card_validation_data::builders::VerifyCardValidationDataInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::verify_card_validation_data::VerifyCardValidationDataOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::verify_card_validation_data::VerifyCardValidationDataError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.verify_card_validation_data();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `VerifyCardValidationData`.
24///
25/// <p>Verifies card-related validation data using algorithms such as Card Verification Values (CVV/CVV2), Dynamic Card Verification Values (dCVV/dCVV2) and Card Security Codes (CSC). For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/verify-card-data.html">Verify card data</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
26/// <p>This operation validates the CVV or CSC codes that is printed on a payment credit or debit card during card payment transaction. The input values are typically provided as part of an inbound transaction to an issuer or supporting platform partner. Amazon Web Services Payment Cryptography uses CVV or CSC, PAN (Primary Account Number) and expiration date of the card to check its validity during transaction processing. In this operation, the CVK (Card Verification Key) encryption key for use with card data verification is same as the one in used for <code>GenerateCardValidationData</code>.</p>
27/// <p>For information about valid keys for this operation, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html">Understanding key attributes</a> and <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html">Key types for specific data operations</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
28/// <p><b>Cross-account use</b>: This operation can't be used across different Amazon Web Services accounts.</p>
29/// <p><b>Related operations:</b></p>
30/// <ul>
31/// <li>
32/// <p><code>GenerateCardValidationData</code></p></li>
33/// <li>
34/// <p><code>VerifyAuthRequestCryptogram</code></p></li>
35/// <li>
36/// <p><code>VerifyPinData</code></p></li>
37/// </ul>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct VerifyCardValidationDataFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::verify_card_validation_data::builders::VerifyCardValidationDataInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45    crate::client::customize::internal::CustomizableSend<
46        crate::operation::verify_card_validation_data::VerifyCardValidationDataOutput,
47        crate::operation::verify_card_validation_data::VerifyCardValidationDataError,
48    > for VerifyCardValidationDataFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<
55            crate::operation::verify_card_validation_data::VerifyCardValidationDataOutput,
56            crate::operation::verify_card_validation_data::VerifyCardValidationDataError,
57        >,
58    > {
59        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60    }
61}
62impl VerifyCardValidationDataFluentBuilder {
63    /// Creates a new `VerifyCardValidationDataFluentBuilder`.
64    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65        Self {
66            handle,
67            inner: ::std::default::Default::default(),
68            config_override: ::std::option::Option::None,
69        }
70    }
71    /// Access the VerifyCardValidationData as a reference.
72    pub fn as_input(&self) -> &crate::operation::verify_card_validation_data::builders::VerifyCardValidationDataInputBuilder {
73        &self.inner
74    }
75    /// Sends the request and returns the response.
76    ///
77    /// If an error occurs, an `SdkError` will be returned with additional details that
78    /// can be matched against.
79    ///
80    /// By default, any retryable failures will be retried twice. Retry behavior
81    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82    /// set when configuring the client.
83    pub async fn send(
84        self,
85    ) -> ::std::result::Result<
86        crate::operation::verify_card_validation_data::VerifyCardValidationDataOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::verify_card_validation_data::VerifyCardValidationDataError,
89            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90        >,
91    > {
92        let input = self
93            .inner
94            .build()
95            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96        let runtime_plugins = crate::operation::verify_card_validation_data::VerifyCardValidationData::operation_runtime_plugins(
97            self.handle.runtime_plugins.clone(),
98            &self.handle.conf,
99            self.config_override,
100        );
101        crate::operation::verify_card_validation_data::VerifyCardValidationData::orchestrate(&runtime_plugins, input).await
102    }
103
104    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
105    pub fn customize(
106        self,
107    ) -> crate::client::customize::CustomizableOperation<
108        crate::operation::verify_card_validation_data::VerifyCardValidationDataOutput,
109        crate::operation::verify_card_validation_data::VerifyCardValidationDataError,
110        Self,
111    > {
112        crate::client::customize::CustomizableOperation::new(self)
113    }
114    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
115        self.set_config_override(::std::option::Option::Some(config_override.into()));
116        self
117    }
118
119    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
120        self.config_override = config_override;
121        self
122    }
123    /// <p>The <code>keyARN</code> of the CVK encryption key that Amazon Web Services Payment Cryptography uses to verify card data.</p>
124    pub fn key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.inner = self.inner.key_identifier(input.into());
126        self
127    }
128    /// <p>The <code>keyARN</code> of the CVK encryption key that Amazon Web Services Payment Cryptography uses to verify card data.</p>
129    pub fn set_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_key_identifier(input);
131        self
132    }
133    /// <p>The <code>keyARN</code> of the CVK encryption key that Amazon Web Services Payment Cryptography uses to verify card data.</p>
134    pub fn get_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_key_identifier()
136    }
137    /// <p>The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.</p>
138    pub fn primary_account_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.primary_account_number(input.into());
140        self
141    }
142    /// <p>The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.</p>
143    pub fn set_primary_account_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.inner = self.inner.set_primary_account_number(input);
145        self
146    }
147    /// <p>The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.</p>
148    pub fn get_primary_account_number(&self) -> &::std::option::Option<::std::string::String> {
149        self.inner.get_primary_account_number()
150    }
151    /// <p>The algorithm to use for verification of card data within Amazon Web Services Payment Cryptography.</p>
152    pub fn verification_attributes(mut self, input: crate::types::CardVerificationAttributes) -> Self {
153        self.inner = self.inner.verification_attributes(input);
154        self
155    }
156    /// <p>The algorithm to use for verification of card data within Amazon Web Services Payment Cryptography.</p>
157    pub fn set_verification_attributes(mut self, input: ::std::option::Option<crate::types::CardVerificationAttributes>) -> Self {
158        self.inner = self.inner.set_verification_attributes(input);
159        self
160    }
161    /// <p>The algorithm to use for verification of card data within Amazon Web Services Payment Cryptography.</p>
162    pub fn get_verification_attributes(&self) -> &::std::option::Option<crate::types::CardVerificationAttributes> {
163        self.inner.get_verification_attributes()
164    }
165    /// <p>The CVV or CSC value for use for card data verification within Amazon Web Services Payment Cryptography.</p>
166    pub fn validation_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.inner = self.inner.validation_data(input.into());
168        self
169    }
170    /// <p>The CVV or CSC value for use for card data verification within Amazon Web Services Payment Cryptography.</p>
171    pub fn set_validation_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_validation_data(input);
173        self
174    }
175    /// <p>The CVV or CSC value for use for card data verification within Amazon Web Services Payment Cryptography.</p>
176    pub fn get_validation_data(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_validation_data()
178    }
179}