aws_sdk_s3control/operation/delete_access_grants_instance_resource_policy/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_access_grants_instance_resource_policy::_delete_access_grants_instance_resource_policy_output::DeleteAccessGrantsInstanceResourcePolicyOutputBuilder;
3
4pub use crate::operation::delete_access_grants_instance_resource_policy::_delete_access_grants_instance_resource_policy_input::DeleteAccessGrantsInstanceResourcePolicyInputBuilder;
5
6impl crate::operation::delete_access_grants_instance_resource_policy::builders::DeleteAccessGrantsInstanceResourcePolicyInputBuilder {
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::delete_access_grants_instance_resource_policy::DeleteAccessGrantsInstanceResourcePolicyOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_access_grants_instance_resource_policy::DeleteAccessGrantsInstanceResourcePolicyError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_access_grants_instance_resource_policy();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteAccessGrantsInstanceResourcePolicy`.
24///
25/// <p>Deletes the resource policy of the S3 Access Grants instance. The resource policy is used to manage cross-account access to your S3 Access Grants instance. By deleting the resource policy, you delete any cross-account permissions to your S3 Access Grants instance.</p>
26/// <dl>
27/// <dt>
28/// Permissions
29/// </dt>
30/// <dd>
31/// <p>You must have the <code>s3:DeleteAccessGrantsInstanceResourcePolicy</code> permission to use this operation.</p>
32/// </dd>
33/// </dl><important>
34/// <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>
35/// </important>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct DeleteAccessGrantsInstanceResourcePolicyFluentBuilder {
38    handle: ::std::sync::Arc<crate::client::Handle>,
39    inner: crate::operation::delete_access_grants_instance_resource_policy::builders::DeleteAccessGrantsInstanceResourcePolicyInputBuilder,
40    config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl
43    crate::client::customize::internal::CustomizableSend<
44        crate::operation::delete_access_grants_instance_resource_policy::DeleteAccessGrantsInstanceResourcePolicyOutput,
45        crate::operation::delete_access_grants_instance_resource_policy::DeleteAccessGrantsInstanceResourcePolicyError,
46    > for DeleteAccessGrantsInstanceResourcePolicyFluentBuilder
47{
48    fn send(
49        self,
50        config_override: crate::config::Builder,
51    ) -> crate::client::customize::internal::BoxFuture<
52        crate::client::customize::internal::SendResult<
53            crate::operation::delete_access_grants_instance_resource_policy::DeleteAccessGrantsInstanceResourcePolicyOutput,
54            crate::operation::delete_access_grants_instance_resource_policy::DeleteAccessGrantsInstanceResourcePolicyError,
55        >,
56    > {
57        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
58    }
59}
60impl DeleteAccessGrantsInstanceResourcePolicyFluentBuilder {
61    /// Creates a new `DeleteAccessGrantsInstanceResourcePolicyFluentBuilder`.
62    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
63        Self {
64            handle,
65            inner: ::std::default::Default::default(),
66            config_override: ::std::option::Option::None,
67        }
68    }
69    /// Access the DeleteAccessGrantsInstanceResourcePolicy as a reference.
70    pub fn as_input(
71        &self,
72    ) -> &crate::operation::delete_access_grants_instance_resource_policy::builders::DeleteAccessGrantsInstanceResourcePolicyInputBuilder {
73        &self.inner
74    }
75    /// Sends the request and returns the response.
76    ///
77    /// If an error occurs, an `SdkError` will be returned with additional details that
78    /// can be matched against.
79    ///
80    /// By default, any retryable failures will be retried twice. Retry behavior
81    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82    /// set when configuring the client.
83    pub async fn send(
84        self,
85    ) -> ::std::result::Result<
86        crate::operation::delete_access_grants_instance_resource_policy::DeleteAccessGrantsInstanceResourcePolicyOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::delete_access_grants_instance_resource_policy::DeleteAccessGrantsInstanceResourcePolicyError,
89            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90        >,
91    > {
92        let input = self
93            .inner
94            .build()
95            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96        let runtime_plugins =
97            crate::operation::delete_access_grants_instance_resource_policy::DeleteAccessGrantsInstanceResourcePolicy::operation_runtime_plugins(
98                self.handle.runtime_plugins.clone(),
99                &self.handle.conf,
100                self.config_override,
101            );
102        crate::operation::delete_access_grants_instance_resource_policy::DeleteAccessGrantsInstanceResourcePolicy::orchestrate(
103            &runtime_plugins,
104            input,
105        )
106        .await
107    }
108
109    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
110    pub fn customize(
111        self,
112    ) -> crate::client::customize::CustomizableOperation<
113        crate::operation::delete_access_grants_instance_resource_policy::DeleteAccessGrantsInstanceResourcePolicyOutput,
114        crate::operation::delete_access_grants_instance_resource_policy::DeleteAccessGrantsInstanceResourcePolicyError,
115        Self,
116    > {
117        crate::client::customize::CustomizableOperation::new(self)
118    }
119    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
120        self.set_config_override(::std::option::Option::Some(config_override.into()));
121        self
122    }
123
124    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
125        self.config_override = config_override;
126        self
127    }
128    /// <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
129    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.account_id(input.into());
131        self
132    }
133    /// <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
134    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_account_id(input);
136        self
137    }
138    /// <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
139    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_account_id()
141    }
142}