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><important>
40/// <p>You must URL encode any signed header values that contain spaces. For example, if your header value is <code>my file.txt</code>, containing two spaces after <code>my</code>, you must URL encode this value to <code>my%20%20file.txt</code>.</p>
41/// </important>
42#[derive(::std::clone::Clone, ::std::fmt::Debug)]
43pub struct GetDataAccessFluentBuilder {
44    handle: ::std::sync::Arc<crate::client::Handle>,
45    inner: crate::operation::get_data_access::builders::GetDataAccessInputBuilder,
46    config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49    crate::client::customize::internal::CustomizableSend<
50        crate::operation::get_data_access::GetDataAccessOutput,
51        crate::operation::get_data_access::GetDataAccessError,
52    > for GetDataAccessFluentBuilder
53{
54    fn send(
55        self,
56        config_override: crate::config::Builder,
57    ) -> crate::client::customize::internal::BoxFuture<
58        crate::client::customize::internal::SendResult<
59            crate::operation::get_data_access::GetDataAccessOutput,
60            crate::operation::get_data_access::GetDataAccessError,
61        >,
62    > {
63        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64    }
65}
66impl GetDataAccessFluentBuilder {
67    /// Creates a new `GetDataAccessFluentBuilder`.
68    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
69        Self {
70            handle,
71            inner: ::std::default::Default::default(),
72            config_override: ::std::option::Option::None,
73        }
74    }
75    /// Access the GetDataAccess as a reference.
76    pub fn as_input(&self) -> &crate::operation::get_data_access::builders::GetDataAccessInputBuilder {
77        &self.inner
78    }
79    /// Sends the request and returns the response.
80    ///
81    /// If an error occurs, an `SdkError` will be returned with additional details that
82    /// can be matched against.
83    ///
84    /// By default, any retryable failures will be retried twice. Retry behavior
85    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
86    /// set when configuring the client.
87    pub async fn send(
88        self,
89    ) -> ::std::result::Result<
90        crate::operation::get_data_access::GetDataAccessOutput,
91        ::aws_smithy_runtime_api::client::result::SdkError<
92            crate::operation::get_data_access::GetDataAccessError,
93            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
94        >,
95    > {
96        let input = self
97            .inner
98            .build()
99            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
100        let runtime_plugins = crate::operation::get_data_access::GetDataAccess::operation_runtime_plugins(
101            self.handle.runtime_plugins.clone(),
102            &self.handle.conf,
103            self.config_override,
104        );
105        crate::operation::get_data_access::GetDataAccess::orchestrate(&runtime_plugins, input).await
106    }
107
108    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
109    pub fn customize(
110        self,
111    ) -> crate::client::customize::CustomizableOperation<
112        crate::operation::get_data_access::GetDataAccessOutput,
113        crate::operation::get_data_access::GetDataAccessError,
114        Self,
115    > {
116        crate::client::customize::CustomizableOperation::new(self)
117    }
118    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
119        self.set_config_override(::std::option::Option::Some(config_override.into()));
120        self
121    }
122
123    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
124        self.config_override = config_override;
125        self
126    }
127    /// <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
128    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.account_id(input.into());
130        self
131    }
132    /// <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
133    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_account_id(input);
135        self
136    }
137    /// <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
138    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_account_id()
140    }
141    /// <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>
142    pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.target(input.into());
144        self
145    }
146    /// <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>
147    pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_target(input);
149        self
150    }
151    /// <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>
152    pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_target()
154    }
155    /// <p>The type of permission granted to your S3 data, which can be set to one of the following values:</p>
156    /// <ul>
157    /// <li>
158    /// <p><code>READ</code> – Grant read-only access to the S3 data.</p></li>
159    /// <li>
160    /// <p><code>WRITE</code> – Grant write-only access to the S3 data.</p></li>
161    /// <li>
162    /// <p><code>READWRITE</code> – Grant both read and write access to the S3 data.</p></li>
163    /// </ul>
164    pub fn permission(mut self, input: crate::types::Permission) -> Self {
165        self.inner = self.inner.permission(input);
166        self
167    }
168    /// <p>The type of permission granted to your S3 data, which can be set to one of the following values:</p>
169    /// <ul>
170    /// <li>
171    /// <p><code>READ</code> – Grant read-only access to the S3 data.</p></li>
172    /// <li>
173    /// <p><code>WRITE</code> – Grant write-only access to the S3 data.</p></li>
174    /// <li>
175    /// <p><code>READWRITE</code> – Grant both read and write access to the S3 data.</p></li>
176    /// </ul>
177    pub fn set_permission(mut self, input: ::std::option::Option<crate::types::Permission>) -> Self {
178        self.inner = self.inner.set_permission(input);
179        self
180    }
181    /// <p>The type of permission granted to your S3 data, which can be set to one of the following values:</p>
182    /// <ul>
183    /// <li>
184    /// <p><code>READ</code> – Grant read-only access to the S3 data.</p></li>
185    /// <li>
186    /// <p><code>WRITE</code> – Grant write-only access to the S3 data.</p></li>
187    /// <li>
188    /// <p><code>READWRITE</code> – Grant both read and write access to the S3 data.</p></li>
189    /// </ul>
190    pub fn get_permission(&self) -> &::std::option::Option<crate::types::Permission> {
191        self.inner.get_permission()
192    }
193    /// <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>
194    pub fn duration_seconds(mut self, input: i32) -> Self {
195        self.inner = self.inner.duration_seconds(input);
196        self
197    }
198    /// <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>
199    pub fn set_duration_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
200        self.inner = self.inner.set_duration_seconds(input);
201        self
202    }
203    /// <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>
204    pub fn get_duration_seconds(&self) -> &::std::option::Option<i32> {
205        self.inner.get_duration_seconds()
206    }
207    /// <p>The scope of the temporary access credential that S3 Access Grants vends to the grantee or client application.</p>
208    /// <ul>
209    /// <li>
210    /// <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>
211    /// <li>
212    /// <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>
213    /// </ul>
214    pub fn privilege(mut self, input: crate::types::Privilege) -> Self {
215        self.inner = self.inner.privilege(input);
216        self
217    }
218    /// <p>The scope of the temporary access credential that S3 Access Grants vends to the grantee or client application.</p>
219    /// <ul>
220    /// <li>
221    /// <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>
222    /// <li>
223    /// <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>
224    /// </ul>
225    pub fn set_privilege(mut self, input: ::std::option::Option<crate::types::Privilege>) -> Self {
226        self.inner = self.inner.set_privilege(input);
227        self
228    }
229    /// <p>The scope of the temporary access credential that S3 Access Grants vends to the grantee or client application.</p>
230    /// <ul>
231    /// <li>
232    /// <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>
233    /// <li>
234    /// <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>
235    /// </ul>
236    pub fn get_privilege(&self) -> &::std::option::Option<crate::types::Privilege> {
237        self.inner.get_privilege()
238    }
239    /// <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>
240    pub fn target_type(mut self, input: crate::types::S3PrefixType) -> Self {
241        self.inner = self.inner.target_type(input);
242        self
243    }
244    /// <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>
245    pub fn set_target_type(mut self, input: ::std::option::Option<crate::types::S3PrefixType>) -> Self {
246        self.inner = self.inner.set_target_type(input);
247        self
248    }
249    /// <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>
250    pub fn get_target_type(&self) -> &::std::option::Option<crate::types::S3PrefixType> {
251        self.inner.get_target_type()
252    }
253}