aws_sdk_paymentcryptographydata/operation/generate_pin_data/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::generate_pin_data::_generate_pin_data_output::GeneratePinDataOutputBuilder;
3
4pub use crate::operation::generate_pin_data::_generate_pin_data_input::GeneratePinDataInputBuilder;
5
6impl crate::operation::generate_pin_data::builders::GeneratePinDataInputBuilder {
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::generate_pin_data::GeneratePinDataOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::generate_pin_data::GeneratePinDataError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.generate_pin_data();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GeneratePinData`.
24///
25/// <p>Generates pin-related data such as PIN, PIN Verification Value (PVV), PIN Block, and PIN Offset during new card issuance or reissuance. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/generate-pin-data.html">Generate PIN data</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
26/// <p>PIN data is never transmitted in clear to or from Amazon Web Services Payment Cryptography. This operation generates PIN, PVV, or PIN Offset and then encrypts it using Pin Encryption Key (PEK) to create an <code>EncryptedPinBlock</code> for transmission from Amazon Web Services Payment Cryptography. This operation uses a separate Pin Verification Key (PVK) for VISA PVV generation.</p>
27/// <p>Using ECDH key exchange, you can receive cardholder selectable PINs into Amazon Web Services Payment Cryptography. The ECDH derived key protects the incoming PIN block. You can also use it for reveal PIN, wherein the generated PIN block is protected by the ECDH derived key before transmission from Amazon Web Services Payment Cryptography. For more information on establishing ECDH derived keys, see the <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/create-keys.html">Generating keys</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
28/// <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>
29/// <p><b>Cross-account use</b>: This operation can't be used across different Amazon Web Services accounts.</p>
30/// <p><b>Related operations:</b></p>
31/// <ul>
32/// <li>
33/// <p><code>GenerateCardValidationData</code></p></li>
34/// <li>
35/// <p><code>TranslatePinData</code></p></li>
36/// <li>
37/// <p><code>VerifyPinData</code></p></li>
38/// </ul>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct GeneratePinDataFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::generate_pin_data::builders::GeneratePinDataInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::generate_pin_data::GeneratePinDataOutput,
48        crate::operation::generate_pin_data::GeneratePinDataError,
49    > for GeneratePinDataFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::generate_pin_data::GeneratePinDataOutput,
57            crate::operation::generate_pin_data::GeneratePinDataError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl GeneratePinDataFluentBuilder {
64    /// Creates a new `GeneratePinDataFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the GeneratePinData as a reference.
73    pub fn as_input(&self) -> &crate::operation::generate_pin_data::builders::GeneratePinDataInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::generate_pin_data::GeneratePinDataOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::generate_pin_data::GeneratePinDataError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins = crate::operation::generate_pin_data::GeneratePinData::operation_runtime_plugins(
98            self.handle.runtime_plugins.clone(),
99            &self.handle.conf,
100            self.config_override,
101        );
102        crate::operation::generate_pin_data::GeneratePinData::orchestrate(&runtime_plugins, input).await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::generate_pin_data::GeneratePinDataOutput,
110        crate::operation::generate_pin_data::GeneratePinDataError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124    /// <p>The <code>keyARN</code> of the PEK that Amazon Web Services Payment Cryptography uses for pin data generation.</p>
125    pub fn generation_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.generation_key_identifier(input.into());
127        self
128    }
129    /// <p>The <code>keyARN</code> of the PEK that Amazon Web Services Payment Cryptography uses for pin data generation.</p>
130    pub fn set_generation_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_generation_key_identifier(input);
132        self
133    }
134    /// <p>The <code>keyARN</code> of the PEK that Amazon Web Services Payment Cryptography uses for pin data generation.</p>
135    pub fn get_generation_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_generation_key_identifier()
137    }
138    /// <p>The <code>keyARN</code> of the PEK that Amazon Web Services Payment Cryptography uses to encrypt the PIN Block. For ECDH, it is the <code>keyARN</code> of the asymmetric ECC key.</p>
139    pub fn encryption_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.encryption_key_identifier(input.into());
141        self
142    }
143    /// <p>The <code>keyARN</code> of the PEK that Amazon Web Services Payment Cryptography uses to encrypt the PIN Block. For ECDH, it is the <code>keyARN</code> of the asymmetric ECC key.</p>
144    pub fn set_encryption_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_encryption_key_identifier(input);
146        self
147    }
148    /// <p>The <code>keyARN</code> of the PEK that Amazon Web Services Payment Cryptography uses to encrypt the PIN Block. For ECDH, it is the <code>keyARN</code> of the asymmetric ECC key.</p>
149    pub fn get_encryption_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_encryption_key_identifier()
151    }
152    /// <p>The attributes and values to use for PIN, PVV, or PIN Offset generation.</p>
153    pub fn generation_attributes(mut self, input: crate::types::PinGenerationAttributes) -> Self {
154        self.inner = self.inner.generation_attributes(input);
155        self
156    }
157    /// <p>The attributes and values to use for PIN, PVV, or PIN Offset generation.</p>
158    pub fn set_generation_attributes(mut self, input: ::std::option::Option<crate::types::PinGenerationAttributes>) -> Self {
159        self.inner = self.inner.set_generation_attributes(input);
160        self
161    }
162    /// <p>The attributes and values to use for PIN, PVV, or PIN Offset generation.</p>
163    pub fn get_generation_attributes(&self) -> &::std::option::Option<crate::types::PinGenerationAttributes> {
164        self.inner.get_generation_attributes()
165    }
166    /// <p>The length of PIN under generation.</p>
167    pub fn pin_data_length(mut self, input: i32) -> Self {
168        self.inner = self.inner.pin_data_length(input);
169        self
170    }
171    /// <p>The length of PIN under generation.</p>
172    pub fn set_pin_data_length(mut self, input: ::std::option::Option<i32>) -> Self {
173        self.inner = self.inner.set_pin_data_length(input);
174        self
175    }
176    /// <p>The length of PIN under generation.</p>
177    pub fn get_pin_data_length(&self) -> &::std::option::Option<i32> {
178        self.inner.get_pin_data_length()
179    }
180    /// <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>
181    pub fn primary_account_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.inner = self.inner.primary_account_number(input.into());
183        self
184    }
185    /// <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>
186    pub fn set_primary_account_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.inner = self.inner.set_primary_account_number(input);
188        self
189    }
190    /// <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>
191    pub fn get_primary_account_number(&self) -> &::std::option::Option<::std::string::String> {
192        self.inner.get_primary_account_number()
193    }
194    /// <p>The PIN encoding format for pin data generation as specified in ISO 9564. Amazon Web Services Payment Cryptography supports <code>ISO_Format_0</code> and <code>ISO_Format_3</code>.</p>
195    /// <p>The <code>ISO_Format_0</code> PIN block format is equivalent to the ANSI X9.8, VISA-1, and ECI-1 PIN block formats. It is similar to a VISA-4 PIN block format. It supports a PIN from 4 to 12 digits in length.</p>
196    /// <p>The <code>ISO_Format_3</code> PIN block format is the same as <code>ISO_Format_0</code> except that the fill digits are random values from 10 to 15.</p>
197    pub fn pin_block_format(mut self, input: crate::types::PinBlockFormatForPinData) -> Self {
198        self.inner = self.inner.pin_block_format(input);
199        self
200    }
201    /// <p>The PIN encoding format for pin data generation as specified in ISO 9564. Amazon Web Services Payment Cryptography supports <code>ISO_Format_0</code> and <code>ISO_Format_3</code>.</p>
202    /// <p>The <code>ISO_Format_0</code> PIN block format is equivalent to the ANSI X9.8, VISA-1, and ECI-1 PIN block formats. It is similar to a VISA-4 PIN block format. It supports a PIN from 4 to 12 digits in length.</p>
203    /// <p>The <code>ISO_Format_3</code> PIN block format is the same as <code>ISO_Format_0</code> except that the fill digits are random values from 10 to 15.</p>
204    pub fn set_pin_block_format(mut self, input: ::std::option::Option<crate::types::PinBlockFormatForPinData>) -> Self {
205        self.inner = self.inner.set_pin_block_format(input);
206        self
207    }
208    /// <p>The PIN encoding format for pin data generation as specified in ISO 9564. Amazon Web Services Payment Cryptography supports <code>ISO_Format_0</code> and <code>ISO_Format_3</code>.</p>
209    /// <p>The <code>ISO_Format_0</code> PIN block format is equivalent to the ANSI X9.8, VISA-1, and ECI-1 PIN block formats. It is similar to a VISA-4 PIN block format. It supports a PIN from 4 to 12 digits in length.</p>
210    /// <p>The <code>ISO_Format_3</code> PIN block format is the same as <code>ISO_Format_0</code> except that the fill digits are random values from 10 to 15.</p>
211    pub fn get_pin_block_format(&self) -> &::std::option::Option<crate::types::PinBlockFormatForPinData> {
212        self.inner.get_pin_block_format()
213    }
214    /// <p>Parameter information of a WrappedKeyBlock for encryption key exchange.</p>
215    pub fn encryption_wrapped_key(mut self, input: crate::types::WrappedKey) -> Self {
216        self.inner = self.inner.encryption_wrapped_key(input);
217        self
218    }
219    /// <p>Parameter information of a WrappedKeyBlock for encryption key exchange.</p>
220    pub fn set_encryption_wrapped_key(mut self, input: ::std::option::Option<crate::types::WrappedKey>) -> Self {
221        self.inner = self.inner.set_encryption_wrapped_key(input);
222        self
223    }
224    /// <p>Parameter information of a WrappedKeyBlock for encryption key exchange.</p>
225    pub fn get_encryption_wrapped_key(&self) -> &::std::option::Option<crate::types::WrappedKey> {
226        self.inner.get_encryption_wrapped_key()
227    }
228}