aws_sdk_sts/operation/decode_authorization_message/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::decode_authorization_message::_decode_authorization_message_output::DecodeAuthorizationMessageOutputBuilder;
3
4pub use crate::operation::decode_authorization_message::_decode_authorization_message_input::DecodeAuthorizationMessageInputBuilder;
5
6impl crate::operation::decode_authorization_message::builders::DecodeAuthorizationMessageInputBuilder {
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::decode_authorization_message::DecodeAuthorizationMessageOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::decode_authorization_message::DecodeAuthorizationMessageError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.decode_authorization_message();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DecodeAuthorizationMessage`.
24///
25/// <p>Decodes additional information about the authorization status of a request from an encoded message returned in response to an Amazon Web Services request.</p>
26/// <p>For example, if a user is not authorized to perform an operation that he or she has requested, the request returns a <code>Client.UnauthorizedOperation</code> response (an HTTP 403 response). Some Amazon Web Services operations additionally return an encoded message that can provide details about this authorization failure.</p><note>
27/// <p>Only certain Amazon Web Services operations return an encoded authorization message. The documentation for an individual operation indicates whether that operation returns an encoded message in addition to returning an HTTP code.</p>
28/// </note>
29/// <p>The message is encoded because the details of the authorization status can contain privileged information that the user who requested the operation should not see. To decode an authorization status message, a user must be granted permissions through an IAM <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html">policy</a> to request the <code>DecodeAuthorizationMessage</code> (<code>sts:DecodeAuthorizationMessage</code>) action.</p>
30/// <p>The decoded message includes the following type of information:</p>
31/// <ul>
32/// <li>
33/// <p>Whether the request was denied due to an explicit deny or due to the absence of an explicit allow. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow">Determining Whether a Request is Allowed or Denied</a> in the <i>IAM User Guide</i>.</p></li>
34/// <li>
35/// <p>The principal who made the request.</p></li>
36/// <li>
37/// <p>The requested action.</p></li>
38/// <li>
39/// <p>The requested resource.</p></li>
40/// <li>
41/// <p>The values of condition keys in the context of the user's request.</p></li>
42/// </ul>
43#[derive(::std::clone::Clone, ::std::fmt::Debug)]
44pub struct DecodeAuthorizationMessageFluentBuilder {
45    handle: ::std::sync::Arc<crate::client::Handle>,
46    inner: crate::operation::decode_authorization_message::builders::DecodeAuthorizationMessageInputBuilder,
47    config_override: ::std::option::Option<crate::config::Builder>,
48}
49impl
50    crate::client::customize::internal::CustomizableSend<
51        crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput,
52        crate::operation::decode_authorization_message::DecodeAuthorizationMessageError,
53    > for DecodeAuthorizationMessageFluentBuilder
54{
55    fn send(
56        self,
57        config_override: crate::config::Builder,
58    ) -> crate::client::customize::internal::BoxFuture<
59        crate::client::customize::internal::SendResult<
60            crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput,
61            crate::operation::decode_authorization_message::DecodeAuthorizationMessageError,
62        >,
63    > {
64        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
65    }
66}
67impl DecodeAuthorizationMessageFluentBuilder {
68    /// Creates a new `DecodeAuthorizationMessageFluentBuilder`.
69    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
70        Self {
71            handle,
72            inner: ::std::default::Default::default(),
73            config_override: ::std::option::Option::None,
74        }
75    }
76    /// Access the DecodeAuthorizationMessage as a reference.
77    pub fn as_input(&self) -> &crate::operation::decode_authorization_message::builders::DecodeAuthorizationMessageInputBuilder {
78        &self.inner
79    }
80    /// Sends the request and returns the response.
81    ///
82    /// If an error occurs, an `SdkError` will be returned with additional details that
83    /// can be matched against.
84    ///
85    /// By default, any retryable failures will be retried twice. Retry behavior
86    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
87    /// set when configuring the client.
88    pub async fn send(
89        self,
90    ) -> ::std::result::Result<
91        crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput,
92        ::aws_smithy_runtime_api::client::result::SdkError<
93            crate::operation::decode_authorization_message::DecodeAuthorizationMessageError,
94            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
95        >,
96    > {
97        let input = self
98            .inner
99            .build()
100            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
101        let runtime_plugins = crate::operation::decode_authorization_message::DecodeAuthorizationMessage::operation_runtime_plugins(
102            self.handle.runtime_plugins.clone(),
103            &self.handle.conf,
104            self.config_override,
105        );
106        crate::operation::decode_authorization_message::DecodeAuthorizationMessage::orchestrate(&runtime_plugins, input).await
107    }
108
109    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
110    pub fn customize(
111        self,
112    ) -> crate::client::customize::CustomizableOperation<
113        crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput,
114        crate::operation::decode_authorization_message::DecodeAuthorizationMessageError,
115        Self,
116    > {
117        crate::client::customize::CustomizableOperation::new(self)
118    }
119    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
120        self.set_config_override(::std::option::Option::Some(config_override.into()));
121        self
122    }
123
124    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
125        self.config_override = config_override;
126        self
127    }
128    /// <p>The encoded message that was returned with the response.</p>
129    pub fn encoded_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.encoded_message(input.into());
131        self
132    }
133    /// <p>The encoded message that was returned with the response.</p>
134    pub fn set_encoded_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_encoded_message(input);
136        self
137    }
138    /// <p>The encoded message that was returned with the response.</p>
139    pub fn get_encoded_message(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_encoded_message()
141    }
142}