aws-sdk-paymentcryptographydata 1.109.0

AWS SDK for Payment Cryptography Data Plane
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::generate_auth_request_cryptogram::_generate_auth_request_cryptogram_input::GenerateAuthRequestCryptogramInputBuilder;

pub use crate::operation::generate_auth_request_cryptogram::_generate_auth_request_cryptogram_output::GenerateAuthRequestCryptogramOutputBuilder;

impl crate::operation::generate_auth_request_cryptogram::builders::GenerateAuthRequestCryptogramInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::generate_auth_request_cryptogram::GenerateAuthRequestCryptogramOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::generate_auth_request_cryptogram::GenerateAuthRequestCryptogramError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.generate_auth_request_cryptogram();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `GenerateAuthRequestCryptogram`.
///
/// <p>Generates an Authorization Request Cryptogram (ARQC) for an EMV chip payment card authorization. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/data-operations.generateauthrequestcryptogram.html">Generate auth request cryptogram</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
/// <p>ARQC generation uses an Issuer Master Key (IMK) for application cryptograms (TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS) to derive a session key, which is then used to generate the cryptogram from the provided transaction data (when applicable). To use this operation, you must first create or import an IMK-AC key by calling <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html">CreateKey</a> or <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html">ImportKey</a>. The <code>KeyModesOfUse</code> should be set to <code>DeriveKey</code> for the IMK-AC encryption key.</p><important>
/// <p>This operation is intended for development and testing scenarios only. It is not recommended to use this operation as a substitute for card-based cryptogram generation in production payment flows.</p>
/// </important>
/// <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>
/// <p><b>Cross-account use</b>: This operation supports cross-account use when the key has a resource-based policy that grants access. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/security_iam_resource-based-policies.html">Resource-based policies</a>.</p>
/// <p><b>Related operations:</b></p>
/// <ul>
/// <li>
/// <p><code>VerifyAuthRequestCryptogram</code></p></li>
/// </ul>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GenerateAuthRequestCryptogramFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::generate_auth_request_cryptogram::builders::GenerateAuthRequestCryptogramInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::generate_auth_request_cryptogram::GenerateAuthRequestCryptogramOutput,
        crate::operation::generate_auth_request_cryptogram::GenerateAuthRequestCryptogramError,
    > for GenerateAuthRequestCryptogramFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::generate_auth_request_cryptogram::GenerateAuthRequestCryptogramOutput,
            crate::operation::generate_auth_request_cryptogram::GenerateAuthRequestCryptogramError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl GenerateAuthRequestCryptogramFluentBuilder {
    /// Creates a new `GenerateAuthRequestCryptogramFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the GenerateAuthRequestCryptogram as a reference.
    pub fn as_input(&self) -> &crate::operation::generate_auth_request_cryptogram::builders::GenerateAuthRequestCryptogramInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::generate_auth_request_cryptogram::GenerateAuthRequestCryptogramOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::generate_auth_request_cryptogram::GenerateAuthRequestCryptogramError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::generate_auth_request_cryptogram::GenerateAuthRequestCryptogram::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::generate_auth_request_cryptogram::GenerateAuthRequestCryptogram::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::generate_auth_request_cryptogram::GenerateAuthRequestCryptogramOutput,
        crate::operation::generate_auth_request_cryptogram::GenerateAuthRequestCryptogramError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The <code>keyARN</code> of the IMK-AC (TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS) that Amazon Web Services Payment Cryptography uses to generate the ARQC.</p>
    pub fn key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.key_identifier(input.into());
        self
    }
    /// <p>The <code>keyARN</code> of the IMK-AC (TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS) that Amazon Web Services Payment Cryptography uses to generate the ARQC.</p>
    pub fn set_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_key_identifier(input);
        self
    }
    /// <p>The <code>keyARN</code> of the IMK-AC (TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS) that Amazon Web Services Payment Cryptography uses to generate the ARQC.</p>
    pub fn get_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_key_identifier()
    }
    /// <p>The transaction data that Amazon Web Services Payment Cryptography uses for ARQC generation. The same transaction data is used for ARQC verification by the issuer using <code>VerifyAuthRequestCryptogram</code>.</p>
    pub fn transaction_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.transaction_data(input.into());
        self
    }
    /// <p>The transaction data that Amazon Web Services Payment Cryptography uses for ARQC generation. The same transaction data is used for ARQC verification by the issuer using <code>VerifyAuthRequestCryptogram</code>.</p>
    pub fn set_transaction_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_transaction_data(input);
        self
    }
    /// <p>The transaction data that Amazon Web Services Payment Cryptography uses for ARQC generation. The same transaction data is used for ARQC verification by the issuer using <code>VerifyAuthRequestCryptogram</code>.</p>
    pub fn get_transaction_data(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_transaction_data()
    }
    /// <p>The method to use when deriving the major encryption key for ARQC generation within Amazon Web Services Payment Cryptography.</p>
    pub fn major_key_derivation_mode(mut self, input: crate::types::MajorKeyDerivationMode) -> Self {
        self.inner = self.inner.major_key_derivation_mode(input);
        self
    }
    /// <p>The method to use when deriving the major encryption key for ARQC generation within Amazon Web Services Payment Cryptography.</p>
    pub fn set_major_key_derivation_mode(mut self, input: ::std::option::Option<crate::types::MajorKeyDerivationMode>) -> Self {
        self.inner = self.inner.set_major_key_derivation_mode(input);
        self
    }
    /// <p>The method to use when deriving the major encryption key for ARQC generation within Amazon Web Services Payment Cryptography.</p>
    pub fn get_major_key_derivation_mode(&self) -> &::std::option::Option<crate::types::MajorKeyDerivationMode> {
        self.inner.get_major_key_derivation_mode()
    }
    /// <p>The attributes and values to use for deriving a session key for ARQC generation within Amazon Web Services Payment Cryptography.</p>
    pub fn session_key_derivation_attributes(mut self, input: crate::types::SessionKeyDerivation) -> Self {
        self.inner = self.inner.session_key_derivation_attributes(input);
        self
    }
    /// <p>The attributes and values to use for deriving a session key for ARQC generation within Amazon Web Services Payment Cryptography.</p>
    pub fn set_session_key_derivation_attributes(mut self, input: ::std::option::Option<crate::types::SessionKeyDerivation>) -> Self {
        self.inner = self.inner.set_session_key_derivation_attributes(input);
        self
    }
    /// <p>The attributes and values to use for deriving a session key for ARQC generation within Amazon Web Services Payment Cryptography.</p>
    pub fn get_session_key_derivation_attributes(&self) -> &::std::option::Option<crate::types::SessionKeyDerivation> {
        self.inner.get_session_key_derivation_attributes()
    }
}