aws_sdk_backup/operation/create_backup_access_point/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_backup_access_point::_create_backup_access_point_input::CreateBackupAccessPointInputBuilder;
3
4pub use crate::operation::create_backup_access_point::_create_backup_access_point_output::CreateBackupAccessPointOutputBuilder;
5
6impl crate::operation::create_backup_access_point::builders::CreateBackupAccessPointInputBuilder {
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_backup_access_point::CreateBackupAccessPointOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_backup_access_point::CreateBackupAccessPointError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_backup_access_point();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateBackupAccessPoint`.
24///
25/// <p>Creates a backup access point for an Amazon S3 recovery point. A backup access point provides on-demand, read-only access to the backup data in a recovery point through an Amazon S3 access point, without initiating a restore.</p>
26/// <p>While a backup access point is active for a recovery point, Backup pauses lifecycle transitions and blocks deletion of that recovery point.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateBackupAccessPointFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::create_backup_access_point::builders::CreateBackupAccessPointInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::create_backup_access_point::CreateBackupAccessPointOutput,
36 crate::operation::create_backup_access_point::CreateBackupAccessPointError,
37 > for CreateBackupAccessPointFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<
44 crate::operation::create_backup_access_point::CreateBackupAccessPointOutput,
45 crate::operation::create_backup_access_point::CreateBackupAccessPointError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl CreateBackupAccessPointFluentBuilder {
52 /// Creates a new `CreateBackupAccessPointFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the CreateBackupAccessPoint as a reference.
61 pub fn as_input(&self) -> &crate::operation::create_backup_access_point::builders::CreateBackupAccessPointInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::create_backup_access_point::CreateBackupAccessPointOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::create_backup_access_point::CreateBackupAccessPointError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::create_backup_access_point::CreateBackupAccessPoint::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::create_backup_access_point::CreateBackupAccessPoint::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::create_backup_access_point::CreateBackupAccessPointOutput,
98 crate::operation::create_backup_access_point::CreateBackupAccessPointError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 ///
113 /// Adds a key-value pair to `AccessPointMetadata`.
114 ///
115 /// To override the contents of this collection use [`set_access_point_metadata`](Self::set_access_point_metadata).
116 ///
117 /// <p>Metadata for the backup access point. For continuous (point-in-time) recovery points, you must include an <code>AccessPointInTime</code> timestamp (in format <code>2021-11-27T03:30:27Z</code>). The access point provides access to the content present in the backup at that specific time. You can specify any time within the continuous backup's retention period, up to the latest restorable time. For snapshot recovery points, do not include <code>AccessPointInTime</code>.</p>
118 pub fn access_point_metadata(
119 mut self,
120 k: impl ::std::convert::Into<::std::string::String>,
121 v: impl ::std::convert::Into<::std::string::String>,
122 ) -> Self {
123 self.inner = self.inner.access_point_metadata(k.into(), v.into());
124 self
125 }
126 /// <p>Metadata for the backup access point. For continuous (point-in-time) recovery points, you must include an <code>AccessPointInTime</code> timestamp (in format <code>2021-11-27T03:30:27Z</code>). The access point provides access to the content present in the backup at that specific time. You can specify any time within the continuous backup's retention period, up to the latest restorable time. For snapshot recovery points, do not include <code>AccessPointInTime</code>.</p>
127 pub fn set_access_point_metadata(
128 mut self,
129 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
130 ) -> Self {
131 self.inner = self.inner.set_access_point_metadata(input);
132 self
133 }
134 /// <p>Metadata for the backup access point. For continuous (point-in-time) recovery points, you must include an <code>AccessPointInTime</code> timestamp (in format <code>2021-11-27T03:30:27Z</code>). The access point provides access to the content present in the backup at that specific time. You can specify any time within the continuous backup's retention period, up to the latest restorable time. For snapshot recovery points, do not include <code>AccessPointInTime</code>.</p>
135 pub fn get_access_point_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
136 self.inner.get_access_point_metadata()
137 }
138 /// <p>An optional resource-based policy, in JSON format, to apply to the underlying Amazon S3 access point. The policy controls how backup data can be accessed through the access point. If you do not specify a policy, access is governed by the caller's IAM permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-policies.html">Configuring IAM policies for using access points</a> in the <i>Amazon S3 User Guide</i>.</p>
139 pub fn access_point_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140 self.inner = self.inner.access_point_policy(input.into());
141 self
142 }
143 /// <p>An optional resource-based policy, in JSON format, to apply to the underlying Amazon S3 access point. The policy controls how backup data can be accessed through the access point. If you do not specify a policy, access is governed by the caller's IAM permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-policies.html">Configuring IAM policies for using access points</a> in the <i>Amazon S3 User Guide</i>.</p>
144 pub fn set_access_point_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145 self.inner = self.inner.set_access_point_policy(input);
146 self
147 }
148 /// <p>An optional resource-based policy, in JSON format, to apply to the underlying Amazon S3 access point. The policy controls how backup data can be accessed through the access point. If you do not specify a policy, access is governed by the caller's IAM permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-policies.html">Configuring IAM policies for using access points</a> in the <i>Amazon S3 User Guide</i>.</p>
149 pub fn get_access_point_policy(&self) -> &::std::option::Option<::std::string::String> {
150 self.inner.get_access_point_policy()
151 }
152 /// <p>The name of the backup access point. This name is shared with the Amazon S3 access point namespace. It must be unique within your account and Region and cannot conflict with an existing Amazon S3 access point. For more information about access point naming, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-restrictions-limitations-naming-rules.html">Access points naming rules, restrictions, and limitations</a> in the <i>Amazon S3 User Guide</i>.</p>
153 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154 self.inner = self.inner.name(input.into());
155 self
156 }
157 /// <p>The name of the backup access point. This name is shared with the Amazon S3 access point namespace. It must be unique within your account and Region and cannot conflict with an existing Amazon S3 access point. For more information about access point naming, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-restrictions-limitations-naming-rules.html">Access points naming rules, restrictions, and limitations</a> in the <i>Amazon S3 User Guide</i>.</p>
158 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.inner = self.inner.set_name(input);
160 self
161 }
162 /// <p>The name of the backup access point. This name is shared with the Amazon S3 access point namespace. It must be unique within your account and Region and cannot conflict with an existing Amazon S3 access point. For more information about access point naming, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-restrictions-limitations-naming-rules.html">Access points naming rules, restrictions, and limitations</a> in the <i>Amazon S3 User Guide</i>.</p>
163 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
164 self.inner.get_name()
165 }
166 /// <p>The Amazon Resource Name (ARN) of the recovery point for which to create the backup access point. The recovery point must be an Amazon S3 recovery point in the <code>AVAILABLE</code>, <code>STOPPED</code>, or <code>COMPLETED</code> state.</p>
167 pub fn recovery_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168 self.inner = self.inner.recovery_point_arn(input.into());
169 self
170 }
171 /// <p>The Amazon Resource Name (ARN) of the recovery point for which to create the backup access point. The recovery point must be an Amazon S3 recovery point in the <code>AVAILABLE</code>, <code>STOPPED</code>, or <code>COMPLETED</code> state.</p>
172 pub fn set_recovery_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173 self.inner = self.inner.set_recovery_point_arn(input);
174 self
175 }
176 /// <p>The Amazon Resource Name (ARN) of the recovery point for which to create the backup access point. The recovery point must be an Amazon S3 recovery point in the <code>AVAILABLE</code>, <code>STOPPED</code>, or <code>COMPLETED</code> state.</p>
177 pub fn get_recovery_point_arn(&self) -> &::std::option::Option<::std::string::String> {
178 self.inner.get_recovery_point_arn()
179 }
180 ///
181 /// Adds a key-value pair to `Tags`.
182 ///
183 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
184 ///
185 /// <p>The tags to assign to the backup access point.</p>
186 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
187 self.inner = self.inner.tags(k.into(), v.into());
188 self
189 }
190 /// <p>The tags to assign to the backup access point.</p>
191 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
192 self.inner = self.inner.set_tags(input);
193 self
194 }
195 /// <p>The tags to assign to the backup access point.</p>
196 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
197 self.inner.get_tags()
198 }
199}