aws_sdk_s3control/operation/create_access_grants_instance/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_access_grants_instance::_create_access_grants_instance_output::CreateAccessGrantsInstanceOutputBuilder;
3
4pub use crate::operation::create_access_grants_instance::_create_access_grants_instance_input::CreateAccessGrantsInstanceInputBuilder;
5
6impl crate::operation::create_access_grants_instance::builders::CreateAccessGrantsInstanceInputBuilder {
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_instance::CreateAccessGrantsInstanceOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_access_grants_instance::CreateAccessGrantsInstanceError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_access_grants_instance();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateAccessGrantsInstance`.
24///
25/// <p>Creates an S3 Access Grants instance, which serves as a logical grouping for access grants. You can create one S3 Access Grants instance per Region per account.</p>
26/// <dl>
27/// <dt>
28/// Permissions
29/// </dt>
30/// <dd>
31/// <p>You must have the <code>s3:CreateAccessGrantsInstance</code> permission to use this operation.</p>
32/// </dd>
33/// <dt>
34/// Additional Permissions
35/// </dt>
36/// <dd>
37/// <p>To associate an IAM Identity Center instance with your S3 Access Grants instance, you must also have the <code>sso:DescribeInstance</code>, <code>sso:CreateApplication</code>, <code>sso:PutApplicationGrant</code>, and <code>sso:PutApplicationAuthenticationMethod</code> permissions.</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 CreateAccessGrantsInstanceFluentBuilder {
44    handle: ::std::sync::Arc<crate::client::Handle>,
45    inner: crate::operation::create_access_grants_instance::builders::CreateAccessGrantsInstanceInputBuilder,
46    config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49    crate::client::customize::internal::CustomizableSend<
50        crate::operation::create_access_grants_instance::CreateAccessGrantsInstanceOutput,
51        crate::operation::create_access_grants_instance::CreateAccessGrantsInstanceError,
52    > for CreateAccessGrantsInstanceFluentBuilder
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::create_access_grants_instance::CreateAccessGrantsInstanceOutput,
60            crate::operation::create_access_grants_instance::CreateAccessGrantsInstanceError,
61        >,
62    > {
63        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64    }
65}
66impl CreateAccessGrantsInstanceFluentBuilder {
67    /// Creates a new `CreateAccessGrantsInstanceFluentBuilder`.
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 CreateAccessGrantsInstance as a reference.
76    pub fn as_input(&self) -> &crate::operation::create_access_grants_instance::builders::CreateAccessGrantsInstanceInputBuilder {
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::create_access_grants_instance::CreateAccessGrantsInstanceOutput,
91        ::aws_smithy_runtime_api::client::result::SdkError<
92            crate::operation::create_access_grants_instance::CreateAccessGrantsInstanceError,
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::create_access_grants_instance::CreateAccessGrantsInstance::operation_runtime_plugins(
101            self.handle.runtime_plugins.clone(),
102            &self.handle.conf,
103            self.config_override,
104        );
105        crate::operation::create_access_grants_instance::CreateAccessGrantsInstance::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::create_access_grants_instance::CreateAccessGrantsInstanceOutput,
113        crate::operation::create_access_grants_instance::CreateAccessGrantsInstanceError,
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>If you would like to associate your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance, use this field to pass the Amazon Resource Name (ARN) of the Amazon Web Services IAM Identity Center instance that you are associating with your S3 Access Grants instance. An IAM Identity Center instance is your corporate identity directory that you added to the IAM Identity Center. You can use the <a href="https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_ListInstances.html">ListInstances</a> API operation to retrieve a list of your Identity Center instances and their ARNs.</p>
142    pub fn identity_center_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.identity_center_arn(input.into());
144        self
145    }
146    /// <p>If you would like to associate your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance, use this field to pass the Amazon Resource Name (ARN) of the Amazon Web Services IAM Identity Center instance that you are associating with your S3 Access Grants instance. An IAM Identity Center instance is your corporate identity directory that you added to the IAM Identity Center. You can use the <a href="https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_ListInstances.html">ListInstances</a> API operation to retrieve a list of your Identity Center instances and their ARNs.</p>
147    pub fn set_identity_center_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_identity_center_arn(input);
149        self
150    }
151    /// <p>If you would like to associate your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance, use this field to pass the Amazon Resource Name (ARN) of the Amazon Web Services IAM Identity Center instance that you are associating with your S3 Access Grants instance. An IAM Identity Center instance is your corporate identity directory that you added to the IAM Identity Center. You can use the <a href="https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_ListInstances.html">ListInstances</a> API operation to retrieve a list of your Identity Center instances and their ARNs.</p>
152    pub fn get_identity_center_arn(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_identity_center_arn()
154    }
155    ///
156    /// Appends an item to `Tags`.
157    ///
158    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
159    ///
160    /// <p>The Amazon Web Services resource tags that you are adding to the S3 Access Grants instance. 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>
161    pub fn tags(mut self, input: crate::types::Tag) -> Self {
162        self.inner = self.inner.tags(input);
163        self
164    }
165    /// <p>The Amazon Web Services resource tags that you are adding to the S3 Access Grants instance. 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>
166    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
167        self.inner = self.inner.set_tags(input);
168        self
169    }
170    /// <p>The Amazon Web Services resource tags that you are adding to the S3 Access Grants instance. 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>
171    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
172        self.inner.get_tags()
173    }
174}