aws_sdk_paymentcryptography/operation/get_key/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_key::_get_key_output::GetKeyOutputBuilder;
3
4pub use crate::operation::get_key::_get_key_input::GetKeyInputBuilder;
5
6impl crate::operation::get_key::builders::GetKeyInputBuilder {
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_key::GetKeyOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_key::GetKeyError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_key();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetKey`.
24///
25/// <p>Gets the key metadata for an Amazon Web Services Payment Cryptography key, including the immutable and mutable attributes specified when the key was created. Returns key metadata including attributes, state, and timestamps, but does not return the actual cryptographic key material.</p>
26/// <p><b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p>
27/// <p><b>Related operations:</b></p>
28/// <ul>
29/// <li>
30/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html">CreateKey</a></p></li>
31/// <li>
32/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_DeleteKey.html">DeleteKey</a></p></li>
33/// <li>
34/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ListKeys.html">ListKeys</a></p></li>
35/// </ul>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct GetKeyFluentBuilder {
38    handle: ::std::sync::Arc<crate::client::Handle>,
39    inner: crate::operation::get_key::builders::GetKeyInputBuilder,
40    config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl crate::client::customize::internal::CustomizableSend<crate::operation::get_key::GetKeyOutput, crate::operation::get_key::GetKeyError>
43    for GetKeyFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<crate::operation::get_key::GetKeyOutput, crate::operation::get_key::GetKeyError>,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl GetKeyFluentBuilder {
55    /// Creates a new `GetKeyFluentBuilder`.
56    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57        Self {
58            handle,
59            inner: ::std::default::Default::default(),
60            config_override: ::std::option::Option::None,
61        }
62    }
63    /// Access the GetKey as a reference.
64    pub fn as_input(&self) -> &crate::operation::get_key::builders::GetKeyInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::get_key::GetKeyOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::get_key::GetKeyError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins = crate::operation::get_key::GetKey::operation_runtime_plugins(
89            self.handle.runtime_plugins.clone(),
90            &self.handle.conf,
91            self.config_override,
92        );
93        crate::operation::get_key::GetKey::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<crate::operation::get_key::GetKeyOutput, crate::operation::get_key::GetKeyError, Self> {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The <code>KeyARN</code> of the Amazon Web Services Payment Cryptography key.</p>
112    pub fn key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.key_identifier(input.into());
114        self
115    }
116    /// <p>The <code>KeyARN</code> of the Amazon Web Services Payment Cryptography key.</p>
117    pub fn set_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_key_identifier(input);
119        self
120    }
121    /// <p>The <code>KeyARN</code> of the Amazon Web Services Payment Cryptography key.</p>
122    pub fn get_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_key_identifier()
124    }
125}