aws_sdk_paymentcryptography/operation/get_parameters_for_export/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_parameters_for_export::_get_parameters_for_export_output::GetParametersForExportOutputBuilder;
3
4pub use crate::operation::get_parameters_for_export::_get_parameters_for_export_input::GetParametersForExportInputBuilder;
5
6impl crate::operation::get_parameters_for_export::builders::GetParametersForExportInputBuilder {
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_export::GetParametersForExportOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_parameters_for_export::GetParametersForExportError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_parameters_for_export();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetParametersForExport`.
24///
25/// <p>Gets the export token and the signing key certificate to initiate a TR-34 key export from Amazon Web Services Payment Cryptography.</p>
26/// <p>The signing key certificate signs the wrapped key under export within the TR-34 key payload. The export token and signing key certificate must be in place and operational before calling <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ExportKey.html">ExportKey</a>. The export token expires in 30 days. You can use the same export token to export multiple keys from 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_ExportKey.html">ExportKey</a></p></li>
32/// <li>
33/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetParametersForImport.html">GetParametersForImport</a></p></li>
34/// </ul>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct GetParametersForExportFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::get_parameters_for_export::builders::GetParametersForExportInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::get_parameters_for_export::GetParametersForExportOutput,
44        crate::operation::get_parameters_for_export::GetParametersForExportError,
45    > for GetParametersForExportFluentBuilder
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_export::GetParametersForExportOutput,
53            crate::operation::get_parameters_for_export::GetParametersForExportError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl GetParametersForExportFluentBuilder {
60    /// Creates a new `GetParametersForExportFluentBuilder`.
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 GetParametersForExport as a reference.
69    pub fn as_input(&self) -> &crate::operation::get_parameters_for_export::builders::GetParametersForExportInputBuilder {
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_export::GetParametersForExportOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::get_parameters_for_export::GetParametersForExportError,
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_export::GetParametersForExport::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::get_parameters_for_export::GetParametersForExport::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_export::GetParametersForExportOutput,
106        crate::operation::get_parameters_for_export::GetParametersForExportError,
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 key block format type (for example, TR-34 or TR-31) to use during key material export. Export token is only required for a TR-34 key export, <code>TR34_KEY_BLOCK</code>. Export token is not required for TR-31 key export.</p>
121    pub fn key_material_type(mut self, input: crate::types::KeyMaterialType) -> Self {
122        self.inner = self.inner.key_material_type(input);
123        self
124    }
125    /// <p>The key block format type (for example, TR-34 or TR-31) to use during key material export. Export token is only required for a TR-34 key export, <code>TR34_KEY_BLOCK</code>. Export token is not required for TR-31 key export.</p>
126    pub fn set_key_material_type(mut self, input: ::std::option::Option<crate::types::KeyMaterialType>) -> Self {
127        self.inner = self.inner.set_key_material_type(input);
128        self
129    }
130    /// <p>The key block format type (for example, TR-34 or TR-31) to use during key material export. Export token is only required for a TR-34 key export, <code>TR34_KEY_BLOCK</code>. Export token is not required for TR-31 key export.</p>
131    pub fn get_key_material_type(&self) -> &::std::option::Option<crate::types::KeyMaterialType> {
132        self.inner.get_key_material_type()
133    }
134    /// <p>The signing key algorithm to generate a signing key certificate. This certificate signs the wrapped key under export within the TR-34 key block. <code>RSA_2048</code> is the only signing key algorithm allowed.</p>
135    pub fn signing_key_algorithm(mut self, input: crate::types::KeyAlgorithm) -> Self {
136        self.inner = self.inner.signing_key_algorithm(input);
137        self
138    }
139    /// <p>The signing key algorithm to generate a signing key certificate. This certificate signs the wrapped key under export within the TR-34 key block. <code>RSA_2048</code> is the only signing key algorithm allowed.</p>
140    pub fn set_signing_key_algorithm(mut self, input: ::std::option::Option<crate::types::KeyAlgorithm>) -> Self {
141        self.inner = self.inner.set_signing_key_algorithm(input);
142        self
143    }
144    /// <p>The signing key algorithm to generate a signing key certificate. This certificate signs the wrapped key under export within the TR-34 key block. <code>RSA_2048</code> is the only signing key algorithm allowed.</p>
145    pub fn get_signing_key_algorithm(&self) -> &::std::option::Option<crate::types::KeyAlgorithm> {
146        self.inner.get_signing_key_algorithm()
147    }
148}