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;
34pub use crate::operation::decode_authorization_message::_decode_authorization_message_input::DecodeAuthorizationMessageInputBuilder;
56impl crate::operation::decode_authorization_message::builders::DecodeAuthorizationMessageInputBuilder {
7/// Sends a request with this input using the given client.
8pub async fn send_with(
9self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14crate::operation::decode_authorization_message::DecodeAuthorizationMessageError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18let 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
50crate::client::customize::internal::CustomizableSend<
51crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput,
52crate::operation::decode_authorization_message::DecodeAuthorizationMessageError,
53 > for DecodeAuthorizationMessageFluentBuilder
54{
55fn send(
56self,
57 config_override: crate::config::Builder,
58 ) -> crate::client::customize::internal::BoxFuture<
59crate::client::customize::internal::SendResult<
60crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput,
61crate::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`.
69pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
70Self {
71 handle,
72 inner: ::std::default::Default::default(),
73 config_override: ::std::option::Option::None,
74 }
75 }
76/// Access the DecodeAuthorizationMessage as a reference.
77pub 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.
88pub async fn send(
89self,
90 ) -> ::std::result::Result<
91crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput,
92 ::aws_smithy_runtime_api::client::result::SdkError<
93crate::operation::decode_authorization_message::DecodeAuthorizationMessageError,
94 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
95 >,
96 > {
97let input = self
98.inner
99 .build()
100 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
101let runtime_plugins = crate::operation::decode_authorization_message::DecodeAuthorizationMessage::operation_runtime_plugins(
102self.handle.runtime_plugins.clone(),
103&self.handle.conf,
104self.config_override,
105 );
106crate::operation::decode_authorization_message::DecodeAuthorizationMessage::orchestrate(&runtime_plugins, input).await
107}
108109/// Consumes this builder, creating a customizable operation that can be modified before being sent.
110pub fn customize(
111self,
112 ) -> crate::client::customize::CustomizableOperation<
113crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput,
114crate::operation::decode_authorization_message::DecodeAuthorizationMessageError,
115Self,
116 > {
117crate::client::customize::CustomizableOperation::new(self)
118 }
119pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
120self.set_config_override(::std::option::Option::Some(config_override.into()));
121self
122}
123124pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
125self.config_override = config_override;
126self
127}
128/// <p>The encoded message that was returned with the response.</p>
129pub fn encoded_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130self.inner = self.inner.encoded_message(input.into());
131self
132}
133/// <p>The encoded message that was returned with the response.</p>
134pub fn set_encoded_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135self.inner = self.inner.set_encoded_message(input);
136self
137}
138/// <p>The encoded message that was returned with the response.</p>
139pub fn get_encoded_message(&self) -> &::std::option::Option<::std::string::String> {
140self.inner.get_encoded_message()
141 }
142}