aws_sdk_paymentcryptography/operation/get_alias/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_alias::_get_alias_output::GetAliasOutputBuilder;
3
4pub use crate::operation::get_alias::_get_alias_input::GetAliasInputBuilder;
5
6impl crate::operation::get_alias::builders::GetAliasInputBuilder {
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_alias::GetAliasOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_alias::GetAliasError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_alias();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetAlias`.
24///
25/// <p>Gets the Amazon Web Services Payment Cryptography key associated with the alias.</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_CreateAlias.html">CreateAlias</a></p></li>
31/// <li>
32/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_DeleteAlias.html">DeleteAlias</a></p></li>
33/// <li>
34/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ListAliases.html">ListAliases</a></p></li>
35/// <li>
36/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_UpdateAlias.html">UpdateAlias</a></p></li>
37/// </ul>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct GetAliasFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::get_alias::builders::GetAliasInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl crate::client::customize::internal::CustomizableSend<crate::operation::get_alias::GetAliasOutput, crate::operation::get_alias::GetAliasError>
45    for GetAliasFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<crate::operation::get_alias::GetAliasOutput, crate::operation::get_alias::GetAliasError>,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl GetAliasFluentBuilder {
57    /// Creates a new `GetAliasFluentBuilder`.
58    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59        Self {
60            handle,
61            inner: ::std::default::Default::default(),
62            config_override: ::std::option::Option::None,
63        }
64    }
65    /// Access the GetAlias as a reference.
66    pub fn as_input(&self) -> &crate::operation::get_alias::builders::GetAliasInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::get_alias::GetAliasOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::get_alias::GetAliasError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins = crate::operation::get_alias::GetAlias::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        crate::operation::get_alias::GetAlias::orchestrate(&runtime_plugins, input).await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<crate::operation::get_alias::GetAliasOutput, crate::operation::get_alias::GetAliasError, Self>
102    {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The alias of the Amazon Web Services Payment Cryptography key.</p>
115    pub fn alias_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.alias_name(input.into());
117        self
118    }
119    /// <p>The alias of the Amazon Web Services Payment Cryptography key.</p>
120    pub fn set_alias_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_alias_name(input);
122        self
123    }
124    /// <p>The alias of the Amazon Web Services Payment Cryptography key.</p>
125    pub fn get_alias_name(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_alias_name()
127    }
128}