aws_sdk_iam/operation/create_delegation_request/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_delegation_request::_create_delegation_request_output::CreateDelegationRequestOutputBuilder;
3
4pub use crate::operation::create_delegation_request::_create_delegation_request_input::CreateDelegationRequestInputBuilder;
5
6impl crate::operation::create_delegation_request::builders::CreateDelegationRequestInputBuilder {
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::create_delegation_request::CreateDelegationRequestOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_delegation_request::CreateDelegationRequestError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_delegation_request();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateDelegationRequest`.
24///
25/// <p>Creates an IAM delegation request for temporary access delegation.</p>
26/// <p>This API is not available for general use. In order to use this API, a caller first need to go through an onboarding process described in the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-temporary-delegation-partner-guide.html">partner onboarding documentation</a>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateDelegationRequestFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::create_delegation_request::builders::CreateDelegationRequestInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::create_delegation_request::CreateDelegationRequestOutput,
36 crate::operation::create_delegation_request::CreateDelegationRequestError,
37 > for CreateDelegationRequestFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<
44 crate::operation::create_delegation_request::CreateDelegationRequestOutput,
45 crate::operation::create_delegation_request::CreateDelegationRequestError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl CreateDelegationRequestFluentBuilder {
52 /// Creates a new `CreateDelegationRequestFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the CreateDelegationRequest as a reference.
61 pub fn as_input(&self) -> &crate::operation::create_delegation_request::builders::CreateDelegationRequestInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::create_delegation_request::CreateDelegationRequestOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::create_delegation_request::CreateDelegationRequestError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::create_delegation_request::CreateDelegationRequest::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::create_delegation_request::CreateDelegationRequest::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::create_delegation_request::CreateDelegationRequestOutput,
98 crate::operation::create_delegation_request::CreateDelegationRequestError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// <p>The Amazon Web Services account ID this delegation request is targeted to.</p>
113 /// <p>If the account ID is not known, this parameter can be omitted, resulting in a request that can be associated by any account. If the account ID passed, then the created delegation request can only be associated with an identity of that target account.</p>
114 pub fn owner_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.owner_account_id(input.into());
116 self
117 }
118 /// <p>The Amazon Web Services account ID this delegation request is targeted to.</p>
119 /// <p>If the account ID is not known, this parameter can be omitted, resulting in a request that can be associated by any account. If the account ID passed, then the created delegation request can only be associated with an identity of that target account.</p>
120 pub fn set_owner_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_owner_account_id(input);
122 self
123 }
124 /// <p>The Amazon Web Services account ID this delegation request is targeted to.</p>
125 /// <p>If the account ID is not known, this parameter can be omitted, resulting in a request that can be associated by any account. If the account ID passed, then the created delegation request can only be associated with an identity of that target account.</p>
126 pub fn get_owner_account_id(&self) -> &::std::option::Option<::std::string::String> {
127 self.inner.get_owner_account_id()
128 }
129 /// <p>A description of the delegation request.</p>
130 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.inner = self.inner.description(input.into());
132 self
133 }
134 /// <p>A description of the delegation request.</p>
135 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.inner = self.inner.set_description(input);
137 self
138 }
139 /// <p>A description of the delegation request.</p>
140 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
141 self.inner.get_description()
142 }
143 /// <p>The permissions to be delegated in this delegation request.</p>
144 pub fn permissions(mut self, input: crate::types::DelegationPermission) -> Self {
145 self.inner = self.inner.permissions(input);
146 self
147 }
148 /// <p>The permissions to be delegated in this delegation request.</p>
149 pub fn set_permissions(mut self, input: ::std::option::Option<crate::types::DelegationPermission>) -> Self {
150 self.inner = self.inner.set_permissions(input);
151 self
152 }
153 /// <p>The permissions to be delegated in this delegation request.</p>
154 pub fn get_permissions(&self) -> &::std::option::Option<crate::types::DelegationPermission> {
155 self.inner.get_permissions()
156 }
157 /// <p>A message explaining the reason for the delegation request.</p>
158 /// <p>Requesters can utilize this field to add a custom note to the delegation request. This field is different from the description such that this is to be utilized for a custom messaging on a case-by-case basis.</p>
159 /// <p>For example, if the current delegation request is in response to a previous request being rejected, this explanation can be added to the request via this field.</p>
160 pub fn request_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161 self.inner = self.inner.request_message(input.into());
162 self
163 }
164 /// <p>A message explaining the reason for the delegation request.</p>
165 /// <p>Requesters can utilize this field to add a custom note to the delegation request. This field is different from the description such that this is to be utilized for a custom messaging on a case-by-case basis.</p>
166 /// <p>For example, if the current delegation request is in response to a previous request being rejected, this explanation can be added to the request via this field.</p>
167 pub fn set_request_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168 self.inner = self.inner.set_request_message(input);
169 self
170 }
171 /// <p>A message explaining the reason for the delegation request.</p>
172 /// <p>Requesters can utilize this field to add a custom note to the delegation request. This field is different from the description such that this is to be utilized for a custom messaging on a case-by-case basis.</p>
173 /// <p>For example, if the current delegation request is in response to a previous request being rejected, this explanation can be added to the request via this field.</p>
174 pub fn get_request_message(&self) -> &::std::option::Option<::std::string::String> {
175 self.inner.get_request_message()
176 }
177 /// <p>The workflow ID associated with the requestor.</p>
178 /// <p>This is the unique identifier on the partner side that can be used to track the progress of the request.</p>
179 /// <p>IAM maintains a uniqueness check on this workflow id for each request - if a workflow id for an existing request is passed, this API call will fail.</p>
180 pub fn requestor_workflow_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181 self.inner = self.inner.requestor_workflow_id(input.into());
182 self
183 }
184 /// <p>The workflow ID associated with the requestor.</p>
185 /// <p>This is the unique identifier on the partner side that can be used to track the progress of the request.</p>
186 /// <p>IAM maintains a uniqueness check on this workflow id for each request - if a workflow id for an existing request is passed, this API call will fail.</p>
187 pub fn set_requestor_workflow_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188 self.inner = self.inner.set_requestor_workflow_id(input);
189 self
190 }
191 /// <p>The workflow ID associated with the requestor.</p>
192 /// <p>This is the unique identifier on the partner side that can be used to track the progress of the request.</p>
193 /// <p>IAM maintains a uniqueness check on this workflow id for each request - if a workflow id for an existing request is passed, this API call will fail.</p>
194 pub fn get_requestor_workflow_id(&self) -> &::std::option::Option<::std::string::String> {
195 self.inner.get_requestor_workflow_id()
196 }
197 /// <p>The URL to redirect to after the delegation request is processed.</p>
198 /// <p>This URL is used by the IAM console to show a link to the customer to re-load the partner workflow.</p>
199 pub fn redirect_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200 self.inner = self.inner.redirect_url(input.into());
201 self
202 }
203 /// <p>The URL to redirect to after the delegation request is processed.</p>
204 /// <p>This URL is used by the IAM console to show a link to the customer to re-load the partner workflow.</p>
205 pub fn set_redirect_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206 self.inner = self.inner.set_redirect_url(input);
207 self
208 }
209 /// <p>The URL to redirect to after the delegation request is processed.</p>
210 /// <p>This URL is used by the IAM console to show a link to the customer to re-load the partner workflow.</p>
211 pub fn get_redirect_url(&self) -> &::std::option::Option<::std::string::String> {
212 self.inner.get_redirect_url()
213 }
214 /// <p>The notification channel for updates about the delegation request.</p>
215 /// <p>At this time,only SNS topic ARNs are accepted for notification. This topic ARN must have a resource policy granting <code>SNS:Publish</code> permission to the IAM service principal (<code>iam.amazonaws.com</code>). See <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-temporary-delegation-partner-guide.html">partner onboarding documentation</a> for more details.</p>
216 pub fn notification_channel(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217 self.inner = self.inner.notification_channel(input.into());
218 self
219 }
220 /// <p>The notification channel for updates about the delegation request.</p>
221 /// <p>At this time,only SNS topic ARNs are accepted for notification. This topic ARN must have a resource policy granting <code>SNS:Publish</code> permission to the IAM service principal (<code>iam.amazonaws.com</code>). See <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-temporary-delegation-partner-guide.html">partner onboarding documentation</a> for more details.</p>
222 pub fn set_notification_channel(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223 self.inner = self.inner.set_notification_channel(input);
224 self
225 }
226 /// <p>The notification channel for updates about the delegation request.</p>
227 /// <p>At this time,only SNS topic ARNs are accepted for notification. This topic ARN must have a resource policy granting <code>SNS:Publish</code> permission to the IAM service principal (<code>iam.amazonaws.com</code>). See <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-temporary-delegation-partner-guide.html">partner onboarding documentation</a> for more details.</p>
228 pub fn get_notification_channel(&self) -> &::std::option::Option<::std::string::String> {
229 self.inner.get_notification_channel()
230 }
231 /// <p>The duration for which the delegated session should remain active, in seconds.</p>
232 /// <p>The active time window for the session starts when the customer calls the <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_SendDelegationToken.html">SendDelegationToken</a> API.</p>
233 pub fn session_duration(mut self, input: i32) -> Self {
234 self.inner = self.inner.session_duration(input);
235 self
236 }
237 /// <p>The duration for which the delegated session should remain active, in seconds.</p>
238 /// <p>The active time window for the session starts when the customer calls the <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_SendDelegationToken.html">SendDelegationToken</a> API.</p>
239 pub fn set_session_duration(mut self, input: ::std::option::Option<i32>) -> Self {
240 self.inner = self.inner.set_session_duration(input);
241 self
242 }
243 /// <p>The duration for which the delegated session should remain active, in seconds.</p>
244 /// <p>The active time window for the session starts when the customer calls the <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_SendDelegationToken.html">SendDelegationToken</a> API.</p>
245 pub fn get_session_duration(&self) -> &::std::option::Option<i32> {
246 self.inner.get_session_duration()
247 }
248 /// <p>Specifies whether the delegation token should only be sent by the owner.</p>
249 /// <p>This flag prevents any party other than the owner from calling <code>SendDelegationToken</code> API for this delegation request. This behavior becomes useful when the delegation request owner needs to be present for subsequent partner interactions, but the delegation request was sent to a more privileged user for approval due to the owner lacking sufficient delegation permissions.</p>
250 pub fn only_send_by_owner(mut self, input: bool) -> Self {
251 self.inner = self.inner.only_send_by_owner(input);
252 self
253 }
254 /// <p>Specifies whether the delegation token should only be sent by the owner.</p>
255 /// <p>This flag prevents any party other than the owner from calling <code>SendDelegationToken</code> API for this delegation request. This behavior becomes useful when the delegation request owner needs to be present for subsequent partner interactions, but the delegation request was sent to a more privileged user for approval due to the owner lacking sufficient delegation permissions.</p>
256 pub fn set_only_send_by_owner(mut self, input: ::std::option::Option<bool>) -> Self {
257 self.inner = self.inner.set_only_send_by_owner(input);
258 self
259 }
260 /// <p>Specifies whether the delegation token should only be sent by the owner.</p>
261 /// <p>This flag prevents any party other than the owner from calling <code>SendDelegationToken</code> API for this delegation request. This behavior becomes useful when the delegation request owner needs to be present for subsequent partner interactions, but the delegation request was sent to a more privileged user for approval due to the owner lacking sufficient delegation permissions.</p>
262 pub fn get_only_send_by_owner(&self) -> &::std::option::Option<bool> {
263 self.inner.get_only_send_by_owner()
264 }
265}