aws_sdk_iam/operation/update_assume_role_policy/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_assume_role_policy::_update_assume_role_policy_output::UpdateAssumeRolePolicyOutputBuilder;
3
4pub use crate::operation::update_assume_role_policy::_update_assume_role_policy_input::UpdateAssumeRolePolicyInputBuilder;
5
6impl crate::operation::update_assume_role_policy::builders::UpdateAssumeRolePolicyInputBuilder {
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::update_assume_role_policy::UpdateAssumeRolePolicyOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_assume_role_policy::UpdateAssumeRolePolicyError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_assume_role_policy();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateAssumeRolePolicy`.
24///
25/// <p>Updates the policy that grants an IAM entity permission to assume a role. This is typically referred to as the "role trust policy". For more information about roles, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html">Using roles to delegate permissions and federate identities</a>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateAssumeRolePolicyFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_assume_role_policy::builders::UpdateAssumeRolePolicyInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::update_assume_role_policy::UpdateAssumeRolePolicyOutput,
35 crate::operation::update_assume_role_policy::UpdateAssumeRolePolicyError,
36 > for UpdateAssumeRolePolicyFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::update_assume_role_policy::UpdateAssumeRolePolicyOutput,
44 crate::operation::update_assume_role_policy::UpdateAssumeRolePolicyError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl UpdateAssumeRolePolicyFluentBuilder {
51 /// Creates a new `UpdateAssumeRolePolicyFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the UpdateAssumeRolePolicy as a reference.
60 pub fn as_input(&self) -> &crate::operation::update_assume_role_policy::builders::UpdateAssumeRolePolicyInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::update_assume_role_policy::UpdateAssumeRolePolicyOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::update_assume_role_policy::UpdateAssumeRolePolicyError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::update_assume_role_policy::UpdateAssumeRolePolicy::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::update_assume_role_policy::UpdateAssumeRolePolicy::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::update_assume_role_policy::UpdateAssumeRolePolicyOutput,
97 crate::operation::update_assume_role_policy::UpdateAssumeRolePolicyError,
98 Self,
99 > {
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 name of the role to update with the new policy.</p>
112 /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
113 pub fn role_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.role_name(input.into());
115 self
116 }
117 /// <p>The name of the role to update with the new policy.</p>
118 /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
119 pub fn set_role_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_role_name(input);
121 self
122 }
123 /// <p>The name of the role to update with the new policy.</p>
124 /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
125 pub fn get_role_name(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_role_name()
127 }
128 /// <p>The policy that grants an entity permission to assume the role.</p>
129 /// <p>You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.</p>
130 /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
131 /// <ul>
132 /// <li>
133 /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
134 /// <li>
135 /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
136 /// <li>
137 /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
138 /// </ul>
139 pub fn policy_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140 self.inner = self.inner.policy_document(input.into());
141 self
142 }
143 /// <p>The policy that grants an entity permission to assume the role.</p>
144 /// <p>You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.</p>
145 /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
146 /// <ul>
147 /// <li>
148 /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
149 /// <li>
150 /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
151 /// <li>
152 /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
153 /// </ul>
154 pub fn set_policy_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155 self.inner = self.inner.set_policy_document(input);
156 self
157 }
158 /// <p>The policy that grants an entity permission to assume the role.</p>
159 /// <p>You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.</p>
160 /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
161 /// <ul>
162 /// <li>
163 /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
164 /// <li>
165 /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
166 /// <li>
167 /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
168 /// </ul>
169 pub fn get_policy_document(&self) -> &::std::option::Option<::std::string::String> {
170 self.inner.get_policy_document()
171 }
172}