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>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct CreateAccessGrantsInstanceFluentBuilder {
42    handle: ::std::sync::Arc<crate::client::Handle>,
43    inner: crate::operation::create_access_grants_instance::builders::CreateAccessGrantsInstanceInputBuilder,
44    config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47    crate::client::customize::internal::CustomizableSend<
48        crate::operation::create_access_grants_instance::CreateAccessGrantsInstanceOutput,
49        crate::operation::create_access_grants_instance::CreateAccessGrantsInstanceError,
50    > for CreateAccessGrantsInstanceFluentBuilder
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::create_access_grants_instance::CreateAccessGrantsInstanceOutput,
58            crate::operation::create_access_grants_instance::CreateAccessGrantsInstanceError,
59        >,
60    > {
61        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62    }
63}
64impl CreateAccessGrantsInstanceFluentBuilder {
65    /// Creates a new `CreateAccessGrantsInstanceFluentBuilder`.
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 CreateAccessGrantsInstance as a reference.
74    pub fn as_input(&self) -> &crate::operation::create_access_grants_instance::builders::CreateAccessGrantsInstanceInputBuilder {
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::create_access_grants_instance::CreateAccessGrantsInstanceOutput,
89        ::aws_smithy_runtime_api::client::result::SdkError<
90            crate::operation::create_access_grants_instance::CreateAccessGrantsInstanceError,
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::create_access_grants_instance::CreateAccessGrantsInstance::operation_runtime_plugins(
99            self.handle.runtime_plugins.clone(),
100            &self.handle.conf,
101            self.config_override,
102        );
103        crate::operation::create_access_grants_instance::CreateAccessGrantsInstance::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::create_access_grants_instance::CreateAccessGrantsInstanceOutput,
111        crate::operation::create_access_grants_instance::CreateAccessGrantsInstanceError,
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>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>
140    pub fn identity_center_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.identity_center_arn(input.into());
142        self
143    }
144    /// <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>
145    pub fn set_identity_center_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_identity_center_arn(input);
147        self
148    }
149    /// <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>
150    pub fn get_identity_center_arn(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_identity_center_arn()
152    }
153    ///
154    /// Appends an item to `Tags`.
155    ///
156    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
157    ///
158    /// <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>
159    pub fn tags(mut self, input: crate::types::Tag) -> Self {
160        self.inner = self.inner.tags(input);
161        self
162    }
163    /// <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>
164    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
165        self.inner = self.inner.set_tags(input);
166        self
167    }
168    /// <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>
169    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
170        self.inner.get_tags()
171    }
172}