aws_sdk_fsx/operation/create_and_attach_s3_access_point/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_and_attach_s3_access_point::_create_and_attach_s3_access_point_output::CreateAndAttachS3AccessPointOutputBuilder;
3
4pub use crate::operation::create_and_attach_s3_access_point::_create_and_attach_s3_access_point_input::CreateAndAttachS3AccessPointInputBuilder;
5
6impl crate::operation::create_and_attach_s3_access_point::builders::CreateAndAttachS3AccessPointInputBuilder {
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_and_attach_s3_access_point::CreateAndAttachS3AccessPointOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_and_attach_s3_access_point::CreateAndAttachS3AccessPointError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_and_attach_s3_access_point();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateAndAttachS3AccessPoint`.
24///
25/// <p>Creates an S3 access point and attaches it to an Amazon FSx volume. For FSx for OpenZFS file systems, the volume must be hosted on a high-availability file system, either Single-AZ or Multi-AZ. For more information, see <a href="https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/s3accesspoints-for-FSx.html">Accessing your data using Amazon S3 access points</a>. in the Amazon FSx for OpenZFS User Guide.</p>
26/// <p>The requester requires the following permissions to perform these actions:</p>
27/// <ul>
28/// <li>
29/// <p><code>fsx:CreateAndAttachS3AccessPoint</code></p></li>
30/// <li>
31/// <p><code>s3:CreateAccessPoint</code></p></li>
32/// <li>
33/// <p><code>s3:GetAccessPoint</code></p></li>
34/// <li>
35/// <p><code>s3:PutAccessPointPolicy</code></p></li>
36/// <li>
37/// <p><code>s3:DeleteAccessPoint</code></p></li>
38/// </ul>
39/// <p>The following actions are related to <code>CreateAndAttachS3AccessPoint</code>:</p>
40/// <ul>
41/// <li>
42/// <p><code>DescribeS3AccessPointAttachments</code></p></li>
43/// <li>
44/// <p><code>DetachAndDeleteS3AccessPoint</code></p></li>
45/// </ul>
46#[derive(::std::clone::Clone, ::std::fmt::Debug)]
47pub struct CreateAndAttachS3AccessPointFluentBuilder {
48    handle: ::std::sync::Arc<crate::client::Handle>,
49    inner: crate::operation::create_and_attach_s3_access_point::builders::CreateAndAttachS3AccessPointInputBuilder,
50    config_override: ::std::option::Option<crate::config::Builder>,
51}
52impl
53    crate::client::customize::internal::CustomizableSend<
54        crate::operation::create_and_attach_s3_access_point::CreateAndAttachS3AccessPointOutput,
55        crate::operation::create_and_attach_s3_access_point::CreateAndAttachS3AccessPointError,
56    > for CreateAndAttachS3AccessPointFluentBuilder
57{
58    fn send(
59        self,
60        config_override: crate::config::Builder,
61    ) -> crate::client::customize::internal::BoxFuture<
62        crate::client::customize::internal::SendResult<
63            crate::operation::create_and_attach_s3_access_point::CreateAndAttachS3AccessPointOutput,
64            crate::operation::create_and_attach_s3_access_point::CreateAndAttachS3AccessPointError,
65        >,
66    > {
67        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
68    }
69}
70impl CreateAndAttachS3AccessPointFluentBuilder {
71    /// Creates a new `CreateAndAttachS3AccessPointFluentBuilder`.
72    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
73        Self {
74            handle,
75            inner: ::std::default::Default::default(),
76            config_override: ::std::option::Option::None,
77        }
78    }
79    /// Access the CreateAndAttachS3AccessPoint as a reference.
80    pub fn as_input(&self) -> &crate::operation::create_and_attach_s3_access_point::builders::CreateAndAttachS3AccessPointInputBuilder {
81        &self.inner
82    }
83    /// Sends the request and returns the response.
84    ///
85    /// If an error occurs, an `SdkError` will be returned with additional details that
86    /// can be matched against.
87    ///
88    /// By default, any retryable failures will be retried twice. Retry behavior
89    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
90    /// set when configuring the client.
91    pub async fn send(
92        self,
93    ) -> ::std::result::Result<
94        crate::operation::create_and_attach_s3_access_point::CreateAndAttachS3AccessPointOutput,
95        ::aws_smithy_runtime_api::client::result::SdkError<
96            crate::operation::create_and_attach_s3_access_point::CreateAndAttachS3AccessPointError,
97            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
98        >,
99    > {
100        let input = self
101            .inner
102            .build()
103            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
104        let runtime_plugins = crate::operation::create_and_attach_s3_access_point::CreateAndAttachS3AccessPoint::operation_runtime_plugins(
105            self.handle.runtime_plugins.clone(),
106            &self.handle.conf,
107            self.config_override,
108        );
109        crate::operation::create_and_attach_s3_access_point::CreateAndAttachS3AccessPoint::orchestrate(&runtime_plugins, input).await
110    }
111
112    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
113    pub fn customize(
114        self,
115    ) -> crate::client::customize::CustomizableOperation<
116        crate::operation::create_and_attach_s3_access_point::CreateAndAttachS3AccessPointOutput,
117        crate::operation::create_and_attach_s3_access_point::CreateAndAttachS3AccessPointError,
118        Self,
119    > {
120        crate::client::customize::CustomizableOperation::new(self)
121    }
122    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
123        self.set_config_override(::std::option::Option::Some(config_override.into()));
124        self
125    }
126
127    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
128        self.config_override = config_override;
129        self
130    }
131    /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
132    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.client_request_token(input.into());
134        self
135    }
136    /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
137    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_client_request_token(input);
139        self
140    }
141    /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
142    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_client_request_token()
144    }
145    /// <p>The name you want to assign to this S3 access point.</p>
146    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.name(input.into());
148        self
149    }
150    /// <p>The name you want to assign to this S3 access point.</p>
151    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_name(input);
153        self
154    }
155    /// <p>The name you want to assign to this S3 access point.</p>
156    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_name()
158    }
159    /// <p>The type of S3 access point you want to create. Only <code>OpenZFS</code> is supported.</p>
160    pub fn r#type(mut self, input: crate::types::S3AccessPointAttachmentType) -> Self {
161        self.inner = self.inner.r#type(input);
162        self
163    }
164    /// <p>The type of S3 access point you want to create. Only <code>OpenZFS</code> is supported.</p>
165    pub fn set_type(mut self, input: ::std::option::Option<crate::types::S3AccessPointAttachmentType>) -> Self {
166        self.inner = self.inner.set_type(input);
167        self
168    }
169    /// <p>The type of S3 access point you want to create. Only <code>OpenZFS</code> is supported.</p>
170    pub fn get_type(&self) -> &::std::option::Option<crate::types::S3AccessPointAttachmentType> {
171        self.inner.get_type()
172    }
173    /// <p>Specifies the configuration to use when creating and attaching an S3 access point to an FSx for OpenZFS volume.</p>
174    pub fn open_zfs_configuration(mut self, input: crate::types::CreateAndAttachS3AccessPointOpenZfsConfiguration) -> Self {
175        self.inner = self.inner.open_zfs_configuration(input);
176        self
177    }
178    /// <p>Specifies the configuration to use when creating and attaching an S3 access point to an FSx for OpenZFS volume.</p>
179    pub fn set_open_zfs_configuration(
180        mut self,
181        input: ::std::option::Option<crate::types::CreateAndAttachS3AccessPointOpenZfsConfiguration>,
182    ) -> Self {
183        self.inner = self.inner.set_open_zfs_configuration(input);
184        self
185    }
186    /// <p>Specifies the configuration to use when creating and attaching an S3 access point to an FSx for OpenZFS volume.</p>
187    pub fn get_open_zfs_configuration(&self) -> &::std::option::Option<crate::types::CreateAndAttachS3AccessPointOpenZfsConfiguration> {
188        self.inner.get_open_zfs_configuration()
189    }
190    /// <p>Specifies the virtual private cloud (VPC) configuration if you're creating an access point that is restricted to a VPC. For more information, see <a href="https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/access-points-vpc.html">Creating access points restricted to a virtual private cloud</a>.</p>
191    pub fn s3_access_point(mut self, input: crate::types::CreateAndAttachS3AccessPointS3Configuration) -> Self {
192        self.inner = self.inner.s3_access_point(input);
193        self
194    }
195    /// <p>Specifies the virtual private cloud (VPC) configuration if you're creating an access point that is restricted to a VPC. For more information, see <a href="https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/access-points-vpc.html">Creating access points restricted to a virtual private cloud</a>.</p>
196    pub fn set_s3_access_point(mut self, input: ::std::option::Option<crate::types::CreateAndAttachS3AccessPointS3Configuration>) -> Self {
197        self.inner = self.inner.set_s3_access_point(input);
198        self
199    }
200    /// <p>Specifies the virtual private cloud (VPC) configuration if you're creating an access point that is restricted to a VPC. For more information, see <a href="https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/access-points-vpc.html">Creating access points restricted to a virtual private cloud</a>.</p>
201    pub fn get_s3_access_point(&self) -> &::std::option::Option<crate::types::CreateAndAttachS3AccessPointS3Configuration> {
202        self.inner.get_s3_access_point()
203    }
204}