aws_sdk_s3control/operation/get_data_access/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_data_access::_get_data_access_output::GetDataAccessOutputBuilder;
3
4pub use crate::operation::get_data_access::_get_data_access_input::GetDataAccessInputBuilder;
5
6impl crate::operation::get_data_access::builders::GetDataAccessInputBuilder {
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::get_data_access::GetDataAccessOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::get_data_access::GetDataAccessError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.get_data_access();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `GetDataAccess`.
24///
25/// <p>Returns a temporary access credential from S3 Access Grants to the grantee or client application. The <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html">temporary credential</a> is an Amazon Web Services STS token that grants them access to the S3 data.</p>
26/// <dl>
27/// <dt>
28/// Permissions
29/// </dt>
30/// <dd>
31/// <p>You must have the <code>s3:GetDataAccess</code> permission to use this operation.</p>
32/// </dd>
33/// <dt>
34/// Additional Permissions
35/// </dt>
36/// <dd>
37/// <p>The IAM role that S3 Access Grants assumes must have the following permissions specified in the trust policy when registering the location: <code>sts:AssumeRole</code>, for directory users or groups <code>sts:SetContext</code>, and for IAM users or roles <code>sts:SetSourceIdentity</code>.</p>
38/// </dd>
39/// </dl>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct GetDataAccessFluentBuilder {
42 handle: ::std::sync::Arc<crate::client::Handle>,
43 inner: crate::operation::get_data_access::builders::GetDataAccessInputBuilder,
44 config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47 crate::client::customize::internal::CustomizableSend<
48 crate::operation::get_data_access::GetDataAccessOutput,
49 crate::operation::get_data_access::GetDataAccessError,
50 > for GetDataAccessFluentBuilder
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::get_data_access::GetDataAccessOutput,
58 crate::operation::get_data_access::GetDataAccessError,
59 >,
60 > {
61 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62 }
63}
64impl GetDataAccessFluentBuilder {
65 /// Creates a new `GetDataAccessFluentBuilder`.
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 GetDataAccess as a reference.
74 pub fn as_input(&self) -> &crate::operation::get_data_access::builders::GetDataAccessInputBuilder {
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.
85 pub async fn send(
86 self,
87 ) -> ::std::result::Result<
88 crate::operation::get_data_access::GetDataAccessOutput,
89 ::aws_smithy_runtime_api::client::result::SdkError<
90 crate::operation::get_data_access::GetDataAccessError,
91 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
92 >,
93 > {
94 let input = self
95 .inner
96 .build()
97 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
98 let runtime_plugins = crate::operation::get_data_access::GetDataAccess::operation_runtime_plugins(
99 self.handle.runtime_plugins.clone(),
100 &self.handle.conf,
101 self.config_override,
102 );
103 crate::operation::get_data_access::GetDataAccess::orchestrate(&runtime_plugins, input).await
104 }
105
106 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107 pub fn customize(
108 self,
109 ) -> crate::client::customize::CustomizableOperation<
110 crate::operation::get_data_access::GetDataAccessOutput,
111 crate::operation::get_data_access::GetDataAccessError,
112 Self,
113 > {
114 crate::client::customize::CustomizableOperation::new(self)
115 }
116 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117 self.set_config_override(::std::option::Option::Some(config_override.into()));
118 self
119 }
120
121 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122 self.config_override = config_override;
123 self
124 }
125 /// <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
126 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.inner = self.inner.account_id(input.into());
128 self
129 }
130 /// <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
131 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.inner = self.inner.set_account_id(input);
133 self
134 }
135 /// <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
136 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_account_id()
138 }
139 /// <p>The S3 URI path of the data to which you are requesting temporary access credentials. If the requesting account has an access grant for this data, S3 Access Grants vends temporary access credentials in the response.</p>
140 pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141 self.inner = self.inner.target(input.into());
142 self
143 }
144 /// <p>The S3 URI path of the data to which you are requesting temporary access credentials. If the requesting account has an access grant for this data, S3 Access Grants vends temporary access credentials in the response.</p>
145 pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146 self.inner = self.inner.set_target(input);
147 self
148 }
149 /// <p>The S3 URI path of the data to which you are requesting temporary access credentials. If the requesting account has an access grant for this data, S3 Access Grants vends temporary access credentials in the response.</p>
150 pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
151 self.inner.get_target()
152 }
153 /// <p>The type of permission granted to your S3 data, which can be set to one of the following values:</p>
154 /// <ul>
155 /// <li>
156 /// <p><code>READ</code> – Grant read-only access to the S3 data.</p></li>
157 /// <li>
158 /// <p><code>WRITE</code> – Grant write-only access to the S3 data.</p></li>
159 /// <li>
160 /// <p><code>READWRITE</code> – Grant both read and write access to the S3 data.</p></li>
161 /// </ul>
162 pub fn permission(mut self, input: crate::types::Permission) -> Self {
163 self.inner = self.inner.permission(input);
164 self
165 }
166 /// <p>The type of permission granted to your S3 data, which can be set to one of the following values:</p>
167 /// <ul>
168 /// <li>
169 /// <p><code>READ</code> – Grant read-only access to the S3 data.</p></li>
170 /// <li>
171 /// <p><code>WRITE</code> – Grant write-only access to the S3 data.</p></li>
172 /// <li>
173 /// <p><code>READWRITE</code> – Grant both read and write access to the S3 data.</p></li>
174 /// </ul>
175 pub fn set_permission(mut self, input: ::std::option::Option<crate::types::Permission>) -> Self {
176 self.inner = self.inner.set_permission(input);
177 self
178 }
179 /// <p>The type of permission granted to your S3 data, which can be set to one of the following values:</p>
180 /// <ul>
181 /// <li>
182 /// <p><code>READ</code> – Grant read-only access to the S3 data.</p></li>
183 /// <li>
184 /// <p><code>WRITE</code> – Grant write-only access to the S3 data.</p></li>
185 /// <li>
186 /// <p><code>READWRITE</code> – Grant both read and write access to the S3 data.</p></li>
187 /// </ul>
188 pub fn get_permission(&self) -> &::std::option::Option<crate::types::Permission> {
189 self.inner.get_permission()
190 }
191 /// <p>The session duration, in seconds, of the temporary access credential that S3 Access Grants vends to the grantee or client application. The default value is 1 hour, but the grantee can specify a range from 900 seconds (15 minutes) up to 43200 seconds (12 hours). If the grantee requests a value higher than this maximum, the operation fails.</p>
192 pub fn duration_seconds(mut self, input: i32) -> Self {
193 self.inner = self.inner.duration_seconds(input);
194 self
195 }
196 /// <p>The session duration, in seconds, of the temporary access credential that S3 Access Grants vends to the grantee or client application. The default value is 1 hour, but the grantee can specify a range from 900 seconds (15 minutes) up to 43200 seconds (12 hours). If the grantee requests a value higher than this maximum, the operation fails.</p>
197 pub fn set_duration_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
198 self.inner = self.inner.set_duration_seconds(input);
199 self
200 }
201 /// <p>The session duration, in seconds, of the temporary access credential that S3 Access Grants vends to the grantee or client application. The default value is 1 hour, but the grantee can specify a range from 900 seconds (15 minutes) up to 43200 seconds (12 hours). If the grantee requests a value higher than this maximum, the operation fails.</p>
202 pub fn get_duration_seconds(&self) -> &::std::option::Option<i32> {
203 self.inner.get_duration_seconds()
204 }
205 /// <p>The scope of the temporary access credential that S3 Access Grants vends to the grantee or client application.</p>
206 /// <ul>
207 /// <li>
208 /// <p><code>Default</code> – The scope of the returned temporary access token is the scope of the grant that is closest to the target scope.</p></li>
209 /// <li>
210 /// <p><code>Minimal</code> – The scope of the returned temporary access token is the same as the requested target scope as long as the requested scope is the same as or a subset of the grant scope.</p></li>
211 /// </ul>
212 pub fn privilege(mut self, input: crate::types::Privilege) -> Self {
213 self.inner = self.inner.privilege(input);
214 self
215 }
216 /// <p>The scope of the temporary access credential that S3 Access Grants vends to the grantee or client application.</p>
217 /// <ul>
218 /// <li>
219 /// <p><code>Default</code> – The scope of the returned temporary access token is the scope of the grant that is closest to the target scope.</p></li>
220 /// <li>
221 /// <p><code>Minimal</code> – The scope of the returned temporary access token is the same as the requested target scope as long as the requested scope is the same as or a subset of the grant scope.</p></li>
222 /// </ul>
223 pub fn set_privilege(mut self, input: ::std::option::Option<crate::types::Privilege>) -> Self {
224 self.inner = self.inner.set_privilege(input);
225 self
226 }
227 /// <p>The scope of the temporary access credential that S3 Access Grants vends to the grantee or client application.</p>
228 /// <ul>
229 /// <li>
230 /// <p><code>Default</code> – The scope of the returned temporary access token is the scope of the grant that is closest to the target scope.</p></li>
231 /// <li>
232 /// <p><code>Minimal</code> – The scope of the returned temporary access token is the same as the requested target scope as long as the requested scope is the same as or a subset of the grant scope.</p></li>
233 /// </ul>
234 pub fn get_privilege(&self) -> &::std::option::Option<crate::types::Privilege> {
235 self.inner.get_privilege()
236 }
237 /// <p>The type of <code>Target</code>. The only possible value is <code>Object</code>. Pass this value if the target data that you would like to access is a path to an object. Do not pass this value if the target data is a bucket or a bucket and a prefix.</p>
238 pub fn target_type(mut self, input: crate::types::S3PrefixType) -> Self {
239 self.inner = self.inner.target_type(input);
240 self
241 }
242 /// <p>The type of <code>Target</code>. The only possible value is <code>Object</code>. Pass this value if the target data that you would like to access is a path to an object. Do not pass this value if the target data is a bucket or a bucket and a prefix.</p>
243 pub fn set_target_type(mut self, input: ::std::option::Option<crate::types::S3PrefixType>) -> Self {
244 self.inner = self.inner.set_target_type(input);
245 self
246 }
247 /// <p>The type of <code>Target</code>. The only possible value is <code>Object</code>. Pass this value if the target data that you would like to access is a path to an object. Do not pass this value if the target data is a bucket or a bucket and a prefix.</p>
248 pub fn get_target_type(&self) -> &::std::option::Option<crate::types::S3PrefixType> {
249 self.inner.get_target_type()
250 }
251}