aws_sdk_storagegateway/operation/create_tapes/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_tapes::_create_tapes_output::CreateTapesOutputBuilder;
3
4pub use crate::operation::create_tapes::_create_tapes_input::CreateTapesInputBuilder;
5
6impl crate::operation::create_tapes::builders::CreateTapesInputBuilder {
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_tapes::CreateTapesOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_tapes::CreateTapesError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_tapes();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateTapes`.
24///
25/// <p>Creates one or more virtual tapes. You write data to the virtual tapes and then archive the tapes. This operation is only supported in the tape gateway type.</p><note>
26/// <p>Cache storage must be allocated to the gateway before you can create virtual tapes. Use the <code>AddCache</code> operation to add cache storage to a gateway.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateTapesFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::create_tapes::builders::CreateTapesInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::create_tapes::CreateTapesOutput,
37 crate::operation::create_tapes::CreateTapesError,
38 > for CreateTapesFluentBuilder
39{
40 fn send(
41 self,
42 config_override: crate::config::Builder,
43 ) -> crate::client::customize::internal::BoxFuture<
44 crate::client::customize::internal::SendResult<
45 crate::operation::create_tapes::CreateTapesOutput,
46 crate::operation::create_tapes::CreateTapesError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl CreateTapesFluentBuilder {
53 /// Creates a new `CreateTapesFluentBuilder`.
54 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55 Self {
56 handle,
57 inner: ::std::default::Default::default(),
58 config_override: ::std::option::Option::None,
59 }
60 }
61 /// Access the CreateTapes as a reference.
62 pub fn as_input(&self) -> &crate::operation::create_tapes::builders::CreateTapesInputBuilder {
63 &self.inner
64 }
65 /// Sends the request and returns the response.
66 ///
67 /// If an error occurs, an `SdkError` will be returned with additional details that
68 /// can be matched against.
69 ///
70 /// By default, any retryable failures will be retried twice. Retry behavior
71 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72 /// set when configuring the client.
73 pub async fn send(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::create_tapes::CreateTapesOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::create_tapes::CreateTapesError,
79 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80 >,
81 > {
82 let input = self
83 .inner
84 .build()
85 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86 let runtime_plugins = crate::operation::create_tapes::CreateTapes::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::create_tapes::CreateTapes::orchestrate(&runtime_plugins, input).await
92 }
93
94 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95 pub fn customize(
96 self,
97 ) -> crate::client::customize::CustomizableOperation<
98 crate::operation::create_tapes::CreateTapesOutput,
99 crate::operation::create_tapes::CreateTapesError,
100 Self,
101 > {
102 crate::client::customize::CustomizableOperation::new(self)
103 }
104 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105 self.set_config_override(::std::option::Option::Some(config_override.into()));
106 self
107 }
108
109 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110 self.config_override = config_override;
111 self
112 }
113 /// <p>The unique Amazon Resource Name (ARN) that represents the gateway to associate the virtual tapes with. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
114 pub fn gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.gateway_arn(input.into());
116 self
117 }
118 /// <p>The unique Amazon Resource Name (ARN) that represents the gateway to associate the virtual tapes with. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
119 pub fn set_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_gateway_arn(input);
121 self
122 }
123 /// <p>The unique Amazon Resource Name (ARN) that represents the gateway to associate the virtual tapes with. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
124 pub fn get_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
125 self.inner.get_gateway_arn()
126 }
127 /// <p>The size, in bytes, of the virtual tapes that you want to create.</p><note>
128 /// <p>The size must be aligned by gigabyte (1024*1024*1024 bytes).</p>
129 /// </note>
130 pub fn tape_size_in_bytes(mut self, input: i64) -> Self {
131 self.inner = self.inner.tape_size_in_bytes(input);
132 self
133 }
134 /// <p>The size, in bytes, of the virtual tapes that you want to create.</p><note>
135 /// <p>The size must be aligned by gigabyte (1024*1024*1024 bytes).</p>
136 /// </note>
137 pub fn set_tape_size_in_bytes(mut self, input: ::std::option::Option<i64>) -> Self {
138 self.inner = self.inner.set_tape_size_in_bytes(input);
139 self
140 }
141 /// <p>The size, in bytes, of the virtual tapes that you want to create.</p><note>
142 /// <p>The size must be aligned by gigabyte (1024*1024*1024 bytes).</p>
143 /// </note>
144 pub fn get_tape_size_in_bytes(&self) -> &::std::option::Option<i64> {
145 self.inner.get_tape_size_in_bytes()
146 }
147 /// <p>A unique identifier that you use to retry a request. If you retry a request, use the same <code>ClientToken</code> you specified in the initial request.</p><note>
148 /// <p>Using the same <code>ClientToken</code> prevents creating the tape multiple times.</p>
149 /// </note>
150 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.inner = self.inner.client_token(input.into());
152 self
153 }
154 /// <p>A unique identifier that you use to retry a request. If you retry a request, use the same <code>ClientToken</code> you specified in the initial request.</p><note>
155 /// <p>Using the same <code>ClientToken</code> prevents creating the tape multiple times.</p>
156 /// </note>
157 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158 self.inner = self.inner.set_client_token(input);
159 self
160 }
161 /// <p>A unique identifier that you use to retry a request. If you retry a request, use the same <code>ClientToken</code> you specified in the initial request.</p><note>
162 /// <p>Using the same <code>ClientToken</code> prevents creating the tape multiple times.</p>
163 /// </note>
164 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
165 self.inner.get_client_token()
166 }
167 /// <p>The number of virtual tapes that you want to create.</p>
168 pub fn num_tapes_to_create(mut self, input: i32) -> Self {
169 self.inner = self.inner.num_tapes_to_create(input);
170 self
171 }
172 /// <p>The number of virtual tapes that you want to create.</p>
173 pub fn set_num_tapes_to_create(mut self, input: ::std::option::Option<i32>) -> Self {
174 self.inner = self.inner.set_num_tapes_to_create(input);
175 self
176 }
177 /// <p>The number of virtual tapes that you want to create.</p>
178 pub fn get_num_tapes_to_create(&self) -> &::std::option::Option<i32> {
179 self.inner.get_num_tapes_to_create()
180 }
181 /// <p>A prefix that you append to the barcode of the virtual tape you are creating. This prefix makes the barcode unique.</p><note>
182 /// <p>The prefix must be 1-4 characters in length and must be one of the uppercase letters from A to Z.</p>
183 /// </note>
184 pub fn tape_barcode_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185 self.inner = self.inner.tape_barcode_prefix(input.into());
186 self
187 }
188 /// <p>A prefix that you append to the barcode of the virtual tape you are creating. This prefix makes the barcode unique.</p><note>
189 /// <p>The prefix must be 1-4 characters in length and must be one of the uppercase letters from A to Z.</p>
190 /// </note>
191 pub fn set_tape_barcode_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192 self.inner = self.inner.set_tape_barcode_prefix(input);
193 self
194 }
195 /// <p>A prefix that you append to the barcode of the virtual tape you are creating. This prefix makes the barcode unique.</p><note>
196 /// <p>The prefix must be 1-4 characters in length and must be one of the uppercase letters from A to Z.</p>
197 /// </note>
198 pub fn get_tape_barcode_prefix(&self) -> &::std::option::Option<::std::string::String> {
199 self.inner.get_tape_barcode_prefix()
200 }
201 /// <p>Set to <code>true</code> to use Amazon S3 server-side encryption with your own KMS key, or <code>false</code> to use a key managed by Amazon S3. Optional.</p>
202 /// <p>Valid Values: <code>true</code> | <code>false</code></p>
203 pub fn kms_encrypted(mut self, input: bool) -> Self {
204 self.inner = self.inner.kms_encrypted(input);
205 self
206 }
207 /// <p>Set to <code>true</code> to use Amazon S3 server-side encryption with your own KMS key, or <code>false</code> to use a key managed by Amazon S3. Optional.</p>
208 /// <p>Valid Values: <code>true</code> | <code>false</code></p>
209 pub fn set_kms_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
210 self.inner = self.inner.set_kms_encrypted(input);
211 self
212 }
213 /// <p>Set to <code>true</code> to use Amazon S3 server-side encryption with your own KMS key, or <code>false</code> to use a key managed by Amazon S3. Optional.</p>
214 /// <p>Valid Values: <code>true</code> | <code>false</code></p>
215 pub fn get_kms_encrypted(&self) -> &::std::option::Option<bool> {
216 self.inner.get_kms_encrypted()
217 }
218 /// <p>The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon S3 server-side encryption. Storage Gateway does not support asymmetric CMKs. This value can only be set when <code>KMSEncrypted</code> is <code>true</code>. Optional.</p>
219 pub fn kms_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220 self.inner = self.inner.kms_key(input.into());
221 self
222 }
223 /// <p>The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon S3 server-side encryption. Storage Gateway does not support asymmetric CMKs. This value can only be set when <code>KMSEncrypted</code> is <code>true</code>. Optional.</p>
224 pub fn set_kms_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225 self.inner = self.inner.set_kms_key(input);
226 self
227 }
228 /// <p>The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon S3 server-side encryption. Storage Gateway does not support asymmetric CMKs. This value can only be set when <code>KMSEncrypted</code> is <code>true</code>. Optional.</p>
229 pub fn get_kms_key(&self) -> &::std::option::Option<::std::string::String> {
230 self.inner.get_kms_key()
231 }
232 /// <p>The ID of the pool that you want to add your tape to for archiving. The tape in this pool is archived in the S3 storage class that is associated with the pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.</p>
233 pub fn pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
234 self.inner = self.inner.pool_id(input.into());
235 self
236 }
237 /// <p>The ID of the pool that you want to add your tape to for archiving. The tape in this pool is archived in the S3 storage class that is associated with the pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.</p>
238 pub fn set_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
239 self.inner = self.inner.set_pool_id(input);
240 self
241 }
242 /// <p>The ID of the pool that you want to add your tape to for archiving. The tape in this pool is archived in the S3 storage class that is associated with the pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.</p>
243 pub fn get_pool_id(&self) -> &::std::option::Option<::std::string::String> {
244 self.inner.get_pool_id()
245 }
246 /// <p>Set to <code>TRUE</code> if the tape you are creating is to be configured as a write-once-read-many (WORM) tape.</p>
247 pub fn worm(mut self, input: bool) -> Self {
248 self.inner = self.inner.worm(input);
249 self
250 }
251 /// <p>Set to <code>TRUE</code> if the tape you are creating is to be configured as a write-once-read-many (WORM) tape.</p>
252 pub fn set_worm(mut self, input: ::std::option::Option<bool>) -> Self {
253 self.inner = self.inner.set_worm(input);
254 self
255 }
256 /// <p>Set to <code>TRUE</code> if the tape you are creating is to be configured as a write-once-read-many (WORM) tape.</p>
257 pub fn get_worm(&self) -> &::std::option::Option<bool> {
258 self.inner.get_worm()
259 }
260 ///
261 /// Appends an item to `Tags`.
262 ///
263 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
264 ///
265 /// <p>A list of up to 50 tags that can be assigned to a virtual tape. Each tag is a key-value pair.</p><note>
266 /// <p>Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.</p>
267 /// </note>
268 pub fn tags(mut self, input: crate::types::Tag) -> Self {
269 self.inner = self.inner.tags(input);
270 self
271 }
272 /// <p>A list of up to 50 tags that can be assigned to a virtual tape. Each tag is a key-value pair.</p><note>
273 /// <p>Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.</p>
274 /// </note>
275 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
276 self.inner = self.inner.set_tags(input);
277 self
278 }
279 /// <p>A list of up to 50 tags that can be assigned to a virtual tape. Each tag is a key-value pair.</p><note>
280 /// <p>Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.</p>
281 /// </note>
282 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
283 self.inner.get_tags()
284 }
285}