aws_sdk_s3control/operation/update_access_grants_location/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_access_grants_location::_update_access_grants_location_output::UpdateAccessGrantsLocationOutputBuilder;
3
4pub use crate::operation::update_access_grants_location::_update_access_grants_location_input::UpdateAccessGrantsLocationInputBuilder;
5
6impl crate::operation::update_access_grants_location::builders::UpdateAccessGrantsLocationInputBuilder {
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::update_access_grants_location::UpdateAccessGrantsLocationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_access_grants_location::UpdateAccessGrantsLocationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_access_grants_location();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateAccessGrantsLocation`.
24///
25/// <p>Updates the IAM role of a registered location in your S3 Access Grants instance.</p>
26/// <dl>
27/// <dt>
28/// Permissions
29/// </dt>
30/// <dd>
31/// <p>You must have the <code>s3:UpdateAccessGrantsLocation</code> permission to use this operation.</p>
32/// </dd>
33/// <dt>
34/// Additional Permissions
35/// </dt>
36/// <dd>
37/// <p>You must also have the following permission: <code>iam:PassRole</code></p>
38/// </dd>
39/// </dl>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct UpdateAccessGrantsLocationFluentBuilder {
42    handle: ::std::sync::Arc<crate::client::Handle>,
43    inner: crate::operation::update_access_grants_location::builders::UpdateAccessGrantsLocationInputBuilder,
44    config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47    crate::client::customize::internal::CustomizableSend<
48        crate::operation::update_access_grants_location::UpdateAccessGrantsLocationOutput,
49        crate::operation::update_access_grants_location::UpdateAccessGrantsLocationError,
50    > for UpdateAccessGrantsLocationFluentBuilder
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::update_access_grants_location::UpdateAccessGrantsLocationOutput,
58            crate::operation::update_access_grants_location::UpdateAccessGrantsLocationError,
59        >,
60    > {
61        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62    }
63}
64impl UpdateAccessGrantsLocationFluentBuilder {
65    /// Creates a new `UpdateAccessGrantsLocationFluentBuilder`.
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 UpdateAccessGrantsLocation as a reference.
74    pub fn as_input(&self) -> &crate::operation::update_access_grants_location::builders::UpdateAccessGrantsLocationInputBuilder {
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::update_access_grants_location::UpdateAccessGrantsLocationOutput,
89        ::aws_smithy_runtime_api::client::result::SdkError<
90            crate::operation::update_access_grants_location::UpdateAccessGrantsLocationError,
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::update_access_grants_location::UpdateAccessGrantsLocation::operation_runtime_plugins(
99            self.handle.runtime_plugins.clone(),
100            &self.handle.conf,
101            self.config_override,
102        );
103        crate::operation::update_access_grants_location::UpdateAccessGrantsLocation::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::update_access_grants_location::UpdateAccessGrantsLocationOutput,
111        crate::operation::update_access_grants_location::UpdateAccessGrantsLocationError,
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 ID of the registered location that you are updating. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID <code>default</code> to the default location <code>s3://</code> and assigns an auto-generated ID to other locations that you register.</p>
140    /// <p>The ID of the registered location to which you are granting access. S3 Access Grants assigned this ID when you registered the location. S3 Access Grants assigns the ID <code>default</code> to the default location <code>s3://</code> and assigns an auto-generated ID to other locations that you register.</p>
141    /// <p>If you are passing the <code>default</code> location, you cannot create an access grant for the entire default location. You must also specify a bucket or a bucket and prefix in the <code>Subprefix</code> field.</p>
142    pub fn access_grants_location_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.access_grants_location_id(input.into());
144        self
145    }
146    /// <p>The ID of the registered location that you are updating. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID <code>default</code> to the default location <code>s3://</code> and assigns an auto-generated ID to other locations that you register.</p>
147    /// <p>The ID of the registered location to which you are granting access. S3 Access Grants assigned this ID when you registered the location. S3 Access Grants assigns the ID <code>default</code> to the default location <code>s3://</code> and assigns an auto-generated ID to other locations that you register.</p>
148    /// <p>If you are passing the <code>default</code> location, you cannot create an access grant for the entire default location. You must also specify a bucket or a bucket and prefix in the <code>Subprefix</code> field.</p>
149    pub fn set_access_grants_location_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_access_grants_location_id(input);
151        self
152    }
153    /// <p>The ID of the registered location that you are updating. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID <code>default</code> to the default location <code>s3://</code> and assigns an auto-generated ID to other locations that you register.</p>
154    /// <p>The ID of the registered location to which you are granting access. S3 Access Grants assigned this ID when you registered the location. S3 Access Grants assigns the ID <code>default</code> to the default location <code>s3://</code> and assigns an auto-generated ID to other locations that you register.</p>
155    /// <p>If you are passing the <code>default</code> location, you cannot create an access grant for the entire default location. You must also specify a bucket or a bucket and prefix in the <code>Subprefix</code> field.</p>
156    pub fn get_access_grants_location_id(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_access_grants_location_id()
158    }
159    /// <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>
160    pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.inner = self.inner.iam_role_arn(input.into());
162        self
163    }
164    /// <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>
165    pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.inner = self.inner.set_iam_role_arn(input);
167        self
168    }
169    /// <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>
170    pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_iam_role_arn()
172    }
173}