aws_sdk_paymentcryptography/operation/get_parameters_for_import/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_parameters_for_import::_get_parameters_for_import_output::GetParametersForImportOutputBuilder;
3
4pub use crate::operation::get_parameters_for_import::_get_parameters_for_import_input::GetParametersForImportInputBuilder;
5
6impl crate::operation::get_parameters_for_import::builders::GetParametersForImportInputBuilder {
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::get_parameters_for_import::GetParametersForImportOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_parameters_for_import::GetParametersForImportError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_parameters_for_import();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetParametersForImport`.
24///
25/// <p>Gets the import token and the wrapping key certificate in PEM format (base64 encoded) to initiate a TR-34 WrappedKeyBlock or a RSA WrappedKeyCryptogram import into Amazon Web Services Payment Cryptography.</p>
26/// <p>The wrapping key certificate wraps the key under import. The import token and wrapping key certificate must be in place and operational before calling <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html">ImportKey</a>. The import token expires in 30 days. You can use the same import token to import multiple keys into your service account.</p>
27/// <p><b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p>
28/// <p><b>Related operations:</b></p>
29/// <ul>
30/// <li>
31/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetParametersForExport.html">GetParametersForExport</a></p></li>
32/// <li>
33/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html">ImportKey</a></p></li>
34/// </ul>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct GetParametersForImportFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::get_parameters_for_import::builders::GetParametersForImportInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::get_parameters_for_import::GetParametersForImportOutput,
44        crate::operation::get_parameters_for_import::GetParametersForImportError,
45    > for GetParametersForImportFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::get_parameters_for_import::GetParametersForImportOutput,
53            crate::operation::get_parameters_for_import::GetParametersForImportError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl GetParametersForImportFluentBuilder {
60    /// Creates a new `GetParametersForImportFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the GetParametersForImport as a reference.
69    pub fn as_input(&self) -> &crate::operation::get_parameters_for_import::builders::GetParametersForImportInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::get_parameters_for_import::GetParametersForImportOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::get_parameters_for_import::GetParametersForImportError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::get_parameters_for_import::GetParametersForImport::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::get_parameters_for_import::GetParametersForImport::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::get_parameters_for_import::GetParametersForImportOutput,
106        crate::operation::get_parameters_for_import::GetParametersForImportError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>The method to use for key material import. Import token is only required for TR-34 WrappedKeyBlock (<code>TR34_KEY_BLOCK</code>) and RSA WrappedKeyCryptogram (<code>KEY_CRYPTOGRAM</code>).</p>
121    /// <p>Import token is not required for TR-31, root public key cerificate or trusted public key certificate.</p>
122    pub fn key_material_type(mut self, input: crate::types::KeyMaterialType) -> Self {
123        self.inner = self.inner.key_material_type(input);
124        self
125    }
126    /// <p>The method to use for key material import. Import token is only required for TR-34 WrappedKeyBlock (<code>TR34_KEY_BLOCK</code>) and RSA WrappedKeyCryptogram (<code>KEY_CRYPTOGRAM</code>).</p>
127    /// <p>Import token is not required for TR-31, root public key cerificate or trusted public key certificate.</p>
128    pub fn set_key_material_type(mut self, input: ::std::option::Option<crate::types::KeyMaterialType>) -> Self {
129        self.inner = self.inner.set_key_material_type(input);
130        self
131    }
132    /// <p>The method to use for key material import. Import token is only required for TR-34 WrappedKeyBlock (<code>TR34_KEY_BLOCK</code>) and RSA WrappedKeyCryptogram (<code>KEY_CRYPTOGRAM</code>).</p>
133    /// <p>Import token is not required for TR-31, root public key cerificate or trusted public key certificate.</p>
134    pub fn get_key_material_type(&self) -> &::std::option::Option<crate::types::KeyMaterialType> {
135        self.inner.get_key_material_type()
136    }
137    /// <p>The wrapping key algorithm to generate a wrapping key certificate. This certificate wraps the key under import.</p>
138    /// <p>At this time, <code>RSA_2048</code> is the allowed algorithm for TR-34 WrappedKeyBlock import. Additionally, <code>RSA_2048</code>, <code>RSA_3072</code>, <code>RSA_4096</code> are the allowed algorithms for RSA WrappedKeyCryptogram import.</p>
139    pub fn wrapping_key_algorithm(mut self, input: crate::types::KeyAlgorithm) -> Self {
140        self.inner = self.inner.wrapping_key_algorithm(input);
141        self
142    }
143    /// <p>The wrapping key algorithm to generate a wrapping key certificate. This certificate wraps the key under import.</p>
144    /// <p>At this time, <code>RSA_2048</code> is the allowed algorithm for TR-34 WrappedKeyBlock import. Additionally, <code>RSA_2048</code>, <code>RSA_3072</code>, <code>RSA_4096</code> are the allowed algorithms for RSA WrappedKeyCryptogram import.</p>
145    pub fn set_wrapping_key_algorithm(mut self, input: ::std::option::Option<crate::types::KeyAlgorithm>) -> Self {
146        self.inner = self.inner.set_wrapping_key_algorithm(input);
147        self
148    }
149    /// <p>The wrapping key algorithm to generate a wrapping key certificate. This certificate wraps the key under import.</p>
150    /// <p>At this time, <code>RSA_2048</code> is the allowed algorithm for TR-34 WrappedKeyBlock import. Additionally, <code>RSA_2048</code>, <code>RSA_3072</code>, <code>RSA_4096</code> are the allowed algorithms for RSA WrappedKeyCryptogram import.</p>
151    pub fn get_wrapping_key_algorithm(&self) -> &::std::option::Option<crate::types::KeyAlgorithm> {
152        self.inner.get_wrapping_key_algorithm()
153    }
154}