1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::get_resource_oauth2_token::_get_resource_oauth2_token_input::GetResourceOauth2TokenInputBuilder;
pub use crate::operation::get_resource_oauth2_token::_get_resource_oauth2_token_output::GetResourceOauth2TokenOutputBuilder;
impl crate::operation::get_resource_oauth2_token::builders::GetResourceOauth2TokenInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::get_resource_oauth2_token::GetResourceOauth2TokenOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_resource_oauth2_token::GetResourceOauth2TokenError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.get_resource_oauth2_token();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `GetResourceOauth2Token`.
///
/// <p>Returns the OAuth 2.0 token of the provided resource.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetResourceOauth2TokenFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::get_resource_oauth2_token::builders::GetResourceOauth2TokenInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::get_resource_oauth2_token::GetResourceOauth2TokenOutput,
crate::operation::get_resource_oauth2_token::GetResourceOauth2TokenError,
> for GetResourceOauth2TokenFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::get_resource_oauth2_token::GetResourceOauth2TokenOutput,
crate::operation::get_resource_oauth2_token::GetResourceOauth2TokenError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl GetResourceOauth2TokenFluentBuilder {
/// Creates a new `GetResourceOauth2TokenFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the GetResourceOauth2Token as a reference.
pub fn as_input(&self) -> &crate::operation::get_resource_oauth2_token::builders::GetResourceOauth2TokenInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::get_resource_oauth2_token::GetResourceOauth2TokenOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_resource_oauth2_token::GetResourceOauth2TokenError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::get_resource_oauth2_token::GetResourceOauth2Token::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::get_resource_oauth2_token::GetResourceOauth2Token::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::get_resource_oauth2_token::GetResourceOauth2TokenOutput,
crate::operation::get_resource_oauth2_token::GetResourceOauth2TokenError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The identity token of the workload from which you want to retrieve the OAuth2 token.</p>
pub fn workload_identity_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.workload_identity_token(input.into());
self
}
/// <p>The identity token of the workload from which you want to retrieve the OAuth2 token.</p>
pub fn set_workload_identity_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_workload_identity_token(input);
self
}
/// <p>The identity token of the workload from which you want to retrieve the OAuth2 token.</p>
pub fn get_workload_identity_token(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_workload_identity_token()
}
/// <p>The name of the resource's credential provider.</p>
pub fn resource_credential_provider_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.resource_credential_provider_name(input.into());
self
}
/// <p>The name of the resource's credential provider.</p>
pub fn set_resource_credential_provider_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_resource_credential_provider_name(input);
self
}
/// <p>The name of the resource's credential provider.</p>
pub fn get_resource_credential_provider_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_resource_credential_provider_name()
}
///
/// Appends an item to `scopes`.
///
/// To override the contents of this collection use [`set_scopes`](Self::set_scopes).
///
/// <p>The OAuth scopes being requested.</p>
pub fn scopes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.scopes(input.into());
self
}
/// <p>The OAuth scopes being requested.</p>
pub fn set_scopes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_scopes(input);
self
}
/// <p>The OAuth scopes being requested.</p>
pub fn get_scopes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_scopes()
}
/// <p>The type of flow to be performed.</p>
pub fn oauth2_flow(mut self, input: crate::types::Oauth2FlowType) -> Self {
self.inner = self.inner.oauth2_flow(input);
self
}
/// <p>The type of flow to be performed.</p>
pub fn set_oauth2_flow(mut self, input: ::std::option::Option<crate::types::Oauth2FlowType>) -> Self {
self.inner = self.inner.set_oauth2_flow(input);
self
}
/// <p>The type of flow to be performed.</p>
pub fn get_oauth2_flow(&self) -> &::std::option::Option<crate::types::Oauth2FlowType> {
self.inner.get_oauth2_flow()
}
/// <p>Unique identifier for the user's authentication session for retrieving OAuth2 tokens. This ID tracks the authorization flow state across multiple requests and responses during the OAuth2 authentication process.</p>
pub fn session_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.session_uri(input.into());
self
}
/// <p>Unique identifier for the user's authentication session for retrieving OAuth2 tokens. This ID tracks the authorization flow state across multiple requests and responses during the OAuth2 authentication process.</p>
pub fn set_session_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_session_uri(input);
self
}
/// <p>Unique identifier for the user's authentication session for retrieving OAuth2 tokens. This ID tracks the authorization flow state across multiple requests and responses during the OAuth2 authentication process.</p>
pub fn get_session_uri(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_session_uri()
}
/// <p>The callback URL to redirect to after the OAuth 2.0 token retrieval is complete. This URL must be one of the provided URLs configured for the workload identity.</p>
pub fn resource_oauth2_return_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.resource_oauth2_return_url(input.into());
self
}
/// <p>The callback URL to redirect to after the OAuth 2.0 token retrieval is complete. This URL must be one of the provided URLs configured for the workload identity.</p>
pub fn set_resource_oauth2_return_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_resource_oauth2_return_url(input);
self
}
/// <p>The callback URL to redirect to after the OAuth 2.0 token retrieval is complete. This URL must be one of the provided URLs configured for the workload identity.</p>
pub fn get_resource_oauth2_return_url(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_resource_oauth2_return_url()
}
/// <p>Indicates whether to always initiate a new three-legged OAuth (3LO) flow, regardless of any existing session.</p>
pub fn force_authentication(mut self, input: bool) -> Self {
self.inner = self.inner.force_authentication(input);
self
}
/// <p>Indicates whether to always initiate a new three-legged OAuth (3LO) flow, regardless of any existing session.</p>
pub fn set_force_authentication(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_force_authentication(input);
self
}
/// <p>Indicates whether to always initiate a new three-legged OAuth (3LO) flow, regardless of any existing session.</p>
pub fn get_force_authentication(&self) -> &::std::option::Option<bool> {
self.inner.get_force_authentication()
}
///
/// Adds a key-value pair to `customParameters`.
///
/// To override the contents of this collection use [`set_custom_parameters`](Self::set_custom_parameters).
///
/// <p>A map of custom parameters to include in the authorization request to the resource credential provider. These parameters are in addition to the standard OAuth 2.0 flow parameters, and will not override them.</p>
pub fn custom_parameters(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
self.inner = self.inner.custom_parameters(k.into(), v.into());
self
}
/// <p>A map of custom parameters to include in the authorization request to the resource credential provider. These parameters are in addition to the standard OAuth 2.0 flow parameters, and will not override them.</p>
pub fn set_custom_parameters(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.inner = self.inner.set_custom_parameters(input);
self
}
/// <p>A map of custom parameters to include in the authorization request to the resource credential provider. These parameters are in addition to the standard OAuth 2.0 flow parameters, and will not override them.</p>
pub fn get_custom_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.inner.get_custom_parameters()
}
/// <p>An opaque string that will be sent back to the callback URL provided in resourceOauth2ReturnUrl. This state should be used to protect the callback URL of your application against CSRF attacks by ensuring the response corresponds to the original request.</p>
pub fn custom_state(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.custom_state(input.into());
self
}
/// <p>An opaque string that will be sent back to the callback URL provided in resourceOauth2ReturnUrl. This state should be used to protect the callback URL of your application against CSRF attacks by ensuring the response corresponds to the original request.</p>
pub fn set_custom_state(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_custom_state(input);
self
}
/// <p>An opaque string that will be sent back to the callback URL provided in resourceOauth2ReturnUrl. This state should be used to protect the callback URL of your application against CSRF attacks by ensuring the response corresponds to the original request.</p>
pub fn get_custom_state(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_custom_state()
}
///
/// Appends an item to `resources`.
///
/// To override the contents of this collection use [`set_resources`](Self::set_resources).
///
/// <p>The resources to include in the token request. These are used to specify the target resources for which the OAuth2 token is being requested.</p>
pub fn resources(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.resources(input.into());
self
}
/// <p>The resources to include in the token request. These are used to specify the target resources for which the OAuth2 token is being requested.</p>
pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_resources(input);
self
}
/// <p>The resources to include in the token request. These are used to specify the target resources for which the OAuth2 token is being requested.</p>
pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_resources()
}
///
/// Appends an item to `audiences`.
///
/// To override the contents of this collection use [`set_audiences`](Self::set_audiences).
///
/// <p>The audiences to include in the token request. These are used to specify the intended recipients of the OAuth2 token.</p>
pub fn audiences(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.audiences(input.into());
self
}
/// <p>The audiences to include in the token request. These are used to specify the intended recipients of the OAuth2 token.</p>
pub fn set_audiences(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_audiences(input);
self
}
/// <p>The audiences to include in the token request. These are used to specify the intended recipients of the OAuth2 token.</p>
pub fn get_audiences(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_audiences()
}
}