aws_sdk_s3control/operation/get_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::get_access_grants_instance_resource_policy::_get_access_grants_instance_resource_policy_output::GetAccessGrantsInstanceResourcePolicyOutputBuilder;
3
4pub use crate::operation::get_access_grants_instance_resource_policy::_get_access_grants_instance_resource_policy_input::GetAccessGrantsInstanceResourcePolicyInputBuilder;
5
6impl crate::operation::get_access_grants_instance_resource_policy::builders::GetAccessGrantsInstanceResourcePolicyInputBuilder {
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_access_grants_instance_resource_policy::GetAccessGrantsInstanceResourcePolicyOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_access_grants_instance_resource_policy::GetAccessGrantsInstanceResourcePolicyError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_access_grants_instance_resource_policy();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetAccessGrantsInstanceResourcePolicy`.
24///
25/// <p>Returns the resource policy of the S3 Access Grants instance.</p>
26/// <dl>
27/// <dt>
28/// Permissions
29/// </dt>
30/// <dd>
31/// <p>You must have the <code>s3:GetAccessGrantsInstanceResourcePolicy</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 GetAccessGrantsInstanceResourcePolicyFluentBuilder {
38    handle: ::std::sync::Arc<crate::client::Handle>,
39    inner: crate::operation::get_access_grants_instance_resource_policy::builders::GetAccessGrantsInstanceResourcePolicyInputBuilder,
40    config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl
43    crate::client::customize::internal::CustomizableSend<
44        crate::operation::get_access_grants_instance_resource_policy::GetAccessGrantsInstanceResourcePolicyOutput,
45        crate::operation::get_access_grants_instance_resource_policy::GetAccessGrantsInstanceResourcePolicyError,
46    > for GetAccessGrantsInstanceResourcePolicyFluentBuilder
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::get_access_grants_instance_resource_policy::GetAccessGrantsInstanceResourcePolicyOutput,
54            crate::operation::get_access_grants_instance_resource_policy::GetAccessGrantsInstanceResourcePolicyError,
55        >,
56    > {
57        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
58    }
59}
60impl GetAccessGrantsInstanceResourcePolicyFluentBuilder {
61    /// Creates a new `GetAccessGrantsInstanceResourcePolicyFluentBuilder`.
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 GetAccessGrantsInstanceResourcePolicy as a reference.
70    pub fn as_input(
71        &self,
72    ) -> &crate::operation::get_access_grants_instance_resource_policy::builders::GetAccessGrantsInstanceResourcePolicyInputBuilder {
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::get_access_grants_instance_resource_policy::GetAccessGrantsInstanceResourcePolicyOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::get_access_grants_instance_resource_policy::GetAccessGrantsInstanceResourcePolicyError,
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::get_access_grants_instance_resource_policy::GetAccessGrantsInstanceResourcePolicy::operation_runtime_plugins(
98                self.handle.runtime_plugins.clone(),
99                &self.handle.conf,
100                self.config_override,
101            );
102        crate::operation::get_access_grants_instance_resource_policy::GetAccessGrantsInstanceResourcePolicy::orchestrate(&runtime_plugins, input)
103            .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_access_grants_instance_resource_policy::GetAccessGrantsInstanceResourcePolicyOutput,
111        crate::operation::get_access_grants_instance_resource_policy::GetAccessGrantsInstanceResourcePolicyError,
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}