aws_sdk_s3control/operation/create_access_grants_location/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_access_grants_location::_create_access_grants_location_output::CreateAccessGrantsLocationOutputBuilder;
3
4pub use crate::operation::create_access_grants_location::_create_access_grants_location_input::CreateAccessGrantsLocationInputBuilder;
5
6impl crate::operation::create_access_grants_location::builders::CreateAccessGrantsLocationInputBuilder {
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_access_grants_location::CreateAccessGrantsLocationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_access_grants_location::CreateAccessGrantsLocationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_access_grants_location();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateAccessGrantsLocation`.
24///
25/// <p>The S3 data location that you would like to register in your S3 Access Grants instance. Your S3 data must be in the same Region as your S3 Access Grants instance. The location can be one of the following:</p>
26/// <ul>
27/// <li>
28/// <p>The default S3 location <code>s3://</code></p></li>
29/// <li>
30/// <p>A bucket - <code>S3://<bucket-name></bucket-name></code></p></li>
31/// <li>
32/// <p>A bucket and prefix - <code>S3://<bucket-name>
33/// /
34/// <prefix></prefix>
35/// </bucket-name></code></p></li>
36/// </ul>
37/// <p>When you register a location, you must include the IAM role that has permission to manage the S3 location that you are registering. Give S3 Access Grants permission to assume this role <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-grants-location.html">using a policy</a>. S3 Access Grants assumes this role to manage access to the location and to vend temporary credentials to grantees or client applications.</p>
38/// <dl>
39/// <dt>
40/// Permissions
41/// </dt>
42/// <dd>
43/// <p>You must have the <code>s3:CreateAccessGrantsLocation</code> permission to use this operation.</p>
44/// </dd>
45/// <dt>
46/// Additional Permissions
47/// </dt>
48/// <dd>
49/// <p>You must also have the following permission for the specified IAM role: <code>iam:PassRole</code></p>
50/// </dd>
51/// </dl>
52#[derive(::std::clone::Clone, ::std::fmt::Debug)]
53pub struct CreateAccessGrantsLocationFluentBuilder {
54    handle: ::std::sync::Arc<crate::client::Handle>,
55    inner: crate::operation::create_access_grants_location::builders::CreateAccessGrantsLocationInputBuilder,
56    config_override: ::std::option::Option<crate::config::Builder>,
57}
58impl
59    crate::client::customize::internal::CustomizableSend<
60        crate::operation::create_access_grants_location::CreateAccessGrantsLocationOutput,
61        crate::operation::create_access_grants_location::CreateAccessGrantsLocationError,
62    > for CreateAccessGrantsLocationFluentBuilder
63{
64    fn send(
65        self,
66        config_override: crate::config::Builder,
67    ) -> crate::client::customize::internal::BoxFuture<
68        crate::client::customize::internal::SendResult<
69            crate::operation::create_access_grants_location::CreateAccessGrantsLocationOutput,
70            crate::operation::create_access_grants_location::CreateAccessGrantsLocationError,
71        >,
72    > {
73        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
74    }
75}
76impl CreateAccessGrantsLocationFluentBuilder {
77    /// Creates a new `CreateAccessGrantsLocationFluentBuilder`.
78    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
79        Self {
80            handle,
81            inner: ::std::default::Default::default(),
82            config_override: ::std::option::Option::None,
83        }
84    }
85    /// Access the CreateAccessGrantsLocation as a reference.
86    pub fn as_input(&self) -> &crate::operation::create_access_grants_location::builders::CreateAccessGrantsLocationInputBuilder {
87        &self.inner
88    }
89    /// Sends the request and returns the response.
90    ///
91    /// If an error occurs, an `SdkError` will be returned with additional details that
92    /// can be matched against.
93    ///
94    /// By default, any retryable failures will be retried twice. Retry behavior
95    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
96    /// set when configuring the client.
97    pub async fn send(
98        self,
99    ) -> ::std::result::Result<
100        crate::operation::create_access_grants_location::CreateAccessGrantsLocationOutput,
101        ::aws_smithy_runtime_api::client::result::SdkError<
102            crate::operation::create_access_grants_location::CreateAccessGrantsLocationError,
103            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
104        >,
105    > {
106        let input = self
107            .inner
108            .build()
109            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
110        let runtime_plugins = crate::operation::create_access_grants_location::CreateAccessGrantsLocation::operation_runtime_plugins(
111            self.handle.runtime_plugins.clone(),
112            &self.handle.conf,
113            self.config_override,
114        );
115        crate::operation::create_access_grants_location::CreateAccessGrantsLocation::orchestrate(&runtime_plugins, input).await
116    }
117
118    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
119    pub fn customize(
120        self,
121    ) -> crate::client::customize::CustomizableOperation<
122        crate::operation::create_access_grants_location::CreateAccessGrantsLocationOutput,
123        crate::operation::create_access_grants_location::CreateAccessGrantsLocationError,
124        Self,
125    > {
126        crate::client::customize::CustomizableOperation::new(self)
127    }
128    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
129        self.set_config_override(::std::option::Option::Some(config_override.into()));
130        self
131    }
132
133    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
134        self.config_override = config_override;
135        self
136    }
137    /// <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
138    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.account_id(input.into());
140        self
141    }
142    /// <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
143    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.inner = self.inner.set_account_id(input);
145        self
146    }
147    /// <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
148    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
149        self.inner.get_account_id()
150    }
151    /// <p>The S3 path to the location that you are registering. The location scope can be the default S3 location <code>s3://</code>, the S3 path to a bucket <code>s3://<bucket></bucket></code>, or the S3 path to a bucket and prefix <code>s3://<bucket>
152    /// /
153    /// <prefix></prefix>
154    /// </bucket></code>. A prefix in S3 is a string of characters at the beginning of an object key name used to organize the objects that you store in your S3 buckets. For example, object key names that start with the <code>engineering/</code> prefix or object key names that start with the <code>marketing/campaigns/</code> prefix.</p>
155    pub fn location_scope(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.inner = self.inner.location_scope(input.into());
157        self
158    }
159    /// <p>The S3 path to the location that you are registering. The location scope can be the default S3 location <code>s3://</code>, the S3 path to a bucket <code>s3://<bucket></bucket></code>, or the S3 path to a bucket and prefix <code>s3://<bucket>
160    /// /
161    /// <prefix></prefix>
162    /// </bucket></code>. A prefix in S3 is a string of characters at the beginning of an object key name used to organize the objects that you store in your S3 buckets. For example, object key names that start with the <code>engineering/</code> prefix or object key names that start with the <code>marketing/campaigns/</code> prefix.</p>
163    pub fn set_location_scope(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_location_scope(input);
165        self
166    }
167    /// <p>The S3 path to the location that you are registering. The location scope can be the default S3 location <code>s3://</code>, the S3 path to a bucket <code>s3://<bucket></bucket></code>, or the S3 path to a bucket and prefix <code>s3://<bucket>
168    /// /
169    /// <prefix></prefix>
170    /// </bucket></code>. A prefix in S3 is a string of characters at the beginning of an object key name used to organize the objects that you store in your S3 buckets. For example, object key names that start with the <code>engineering/</code> prefix or object key names that start with the <code>marketing/campaigns/</code> prefix.</p>
171    pub fn get_location_scope(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_location_scope()
173    }
174    /// <p>The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 Access Grants assumes this role to manage access to the registered location.</p>
175    pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.inner = self.inner.iam_role_arn(input.into());
177        self
178    }
179    /// <p>The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 Access Grants assumes this role to manage access to the registered location.</p>
180    pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_iam_role_arn(input);
182        self
183    }
184    /// <p>The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 Access Grants assumes this role to manage access to the registered location.</p>
185    pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
186        self.inner.get_iam_role_arn()
187    }
188    ///
189    /// Appends an item to `Tags`.
190    ///
191    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
192    ///
193    /// <p>The Amazon Web Services resource tags that you are adding to the S3 Access Grants location. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources.</p>
194    pub fn tags(mut self, input: crate::types::Tag) -> Self {
195        self.inner = self.inner.tags(input);
196        self
197    }
198    /// <p>The Amazon Web Services resource tags that you are adding to the S3 Access Grants location. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources.</p>
199    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
200        self.inner = self.inner.set_tags(input);
201        self
202    }
203    /// <p>The Amazon Web Services resource tags that you are adding to the S3 Access Grants location. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources.</p>
204    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
205        self.inner.get_tags()
206    }
207}