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(self, client: &crate::Client) -> ::std::result::Result<
9 crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput,
10 ::aws_smithy_runtime_api::client::result::SdkError<
11 crate::operation::decode_authorization_message::DecodeAuthorizationMessageError,
12 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13 >
14 > {
15 let mut fluent_builder = client.decode_authorization_message();
16 fluent_builder.inner = self;
17 fluent_builder.send().await
18 }
19 }
20/// Fluent builder constructing a request to `DecodeAuthorizationMessage`.
21///
22/// <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>
23/// <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>
24/// <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>
25/// </note>
26/// <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>
27/// <p>The decoded message includes the following type of information:</p>
28/// <ul>
29/// <li>
30/// <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>
31/// <li>
32/// <p>The principal who made the request.</p></li>
33/// <li>
34/// <p>The requested action.</p></li>
35/// <li>
36/// <p>The requested resource.</p></li>
37/// <li>
38/// <p>The values of condition keys in the context of the user's request.</p></li>
39/// </ul>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct DecodeAuthorizationMessageFluentBuilder {
42 handle: ::std::sync::Arc<crate::client::Handle>,
43 inner: crate::operation::decode_authorization_message::builders::DecodeAuthorizationMessageInputBuilder,
44config_override: ::std::option::Option<crate::config::Builder>,
45 }
46impl
47 crate::client::customize::internal::CustomizableSend<
48 crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput,
49 crate::operation::decode_authorization_message::DecodeAuthorizationMessageError,
50 > for DecodeAuthorizationMessageFluentBuilder
51 {
52 fn send(
53 self,
54 config_override: crate::config::Builder,
55 ) -> crate::client::customize::internal::BoxFuture<
56 crate::client::customize::internal::SendResult<
57 crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput,
58 crate::operation::decode_authorization_message::DecodeAuthorizationMessageError,
59 >,
60 > {
61 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62 }
63 }
64impl DecodeAuthorizationMessageFluentBuilder {
65 /// Creates a new `DecodeAuthorizationMessageFluentBuilder`.
66 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
67 Self {
68 handle,
69 inner: ::std::default::Default::default(),
70 config_override: ::std::option::Option::None,
71 }
72 }
73 /// Access the DecodeAuthorizationMessage as a reference.
74 pub fn as_input(&self) -> &crate::operation::decode_authorization_message::builders::DecodeAuthorizationMessageInputBuilder {
75 &self.inner
76 }
77 /// Sends the request and returns the response.
78 ///
79 /// If an error occurs, an `SdkError` will be returned with additional details that
80 /// can be matched against.
81 ///
82 /// By default, any retryable failures will be retried twice. Retry behavior
83 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
84 /// set when configuring the client. Note: retries are enabled by default when using
85 /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
86 pub async fn send(self) -> ::std::result::Result<crate::operation::decode_authorization_message::DecodeAuthorizationMessageOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::decode_authorization_message::DecodeAuthorizationMessageError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
87 let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88 let runtime_plugins = crate::operation::decode_authorization_message::DecodeAuthorizationMessage::operation_runtime_plugins(
89 self.handle.runtime_plugins.clone(),
90 &self.handle.conf,
91 self.config_override,
92 );
93 crate::operation::decode_authorization_message::DecodeAuthorizationMessage::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::decode_authorization_message::DecodeAuthorizationMessageOutput, crate::operation::decode_authorization_message::DecodeAuthorizationMessageError, Self> {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(
103 mut self,
104 config_override: impl ::std::convert::Into<crate::config::Builder>,
105 ) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(
111 &mut self,
112 config_override: ::std::option::Option<crate::config::Builder>,
113 ) -> &mut Self {
114 self.config_override = config_override;
115 self
116 }
117 /// <p>The encoded message that was returned with the response.</p>
118 pub fn encoded_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.inner = self.inner.encoded_message(input.into());
120 self
121 }
122 /// <p>The encoded message that was returned with the response.</p>
123 pub fn set_encoded_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.inner = self.inner.set_encoded_message(input);
125 self
126 }
127 /// <p>The encoded message that was returned with the response.</p>
128 pub fn get_encoded_message(&self) -> &::std::option::Option<::std::string::String> {
129 self.inner.get_encoded_message()
130 }
131}
132