aws_sdk_storagegateway/operation/activate_gateway/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::activate_gateway::_activate_gateway_output::ActivateGatewayOutputBuilder;
3
4pub use crate::operation::activate_gateway::_activate_gateway_input::ActivateGatewayInputBuilder;
5
6impl crate::operation::activate_gateway::builders::ActivateGatewayInputBuilder {
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::activate_gateway::ActivateGatewayOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::activate_gateway::ActivateGatewayError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.activate_gateway();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ActivateGateway`.
24///
25/// <p>Activates the gateway you previously deployed on your host. In the activation process, you specify information such as the Amazon Web Services Region that you want to use for storing snapshots or tapes, the time zone for scheduled snapshots the gateway snapshot schedule window, an activation key, and a name for your gateway. The activation process also associates your gateway with your account. For more information, see <code>UpdateGatewayInformation</code>.</p><note>
26/// <p>You must turn on the gateway VM before you can activate your gateway.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct ActivateGatewayFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::activate_gateway::builders::ActivateGatewayInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::activate_gateway::ActivateGatewayOutput,
37 crate::operation::activate_gateway::ActivateGatewayError,
38 > for ActivateGatewayFluentBuilder
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::activate_gateway::ActivateGatewayOutput,
46 crate::operation::activate_gateway::ActivateGatewayError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl ActivateGatewayFluentBuilder {
53 /// Creates a new `ActivateGatewayFluentBuilder`.
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 ActivateGateway as a reference.
62 pub fn as_input(&self) -> &crate::operation::activate_gateway::builders::ActivateGatewayInputBuilder {
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::activate_gateway::ActivateGatewayOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::activate_gateway::ActivateGatewayError,
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::activate_gateway::ActivateGateway::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::activate_gateway::ActivateGateway::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::activate_gateway::ActivateGatewayOutput,
99 crate::operation::activate_gateway::ActivateGatewayError,
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>Your gateway activation key. You can obtain the activation key by sending an HTTP GET request with redirects enabled to the gateway IP address (port 80). The redirect URL returned in the response provides you the activation key for your gateway in the query string parameter <code>activationKey</code>. It may also include other activation-related parameters, however, these are merely defaults -- the arguments you pass to the <code>ActivateGateway</code> API call determine the actual configuration of your gateway.</p>
114 /// <p>For more information, see <a href="https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html">Getting activation key</a> in the <i>Storage Gateway User Guide</i>.</p>
115 pub fn activation_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.activation_key(input.into());
117 self
118 }
119 /// <p>Your gateway activation key. You can obtain the activation key by sending an HTTP GET request with redirects enabled to the gateway IP address (port 80). The redirect URL returned in the response provides you the activation key for your gateway in the query string parameter <code>activationKey</code>. It may also include other activation-related parameters, however, these are merely defaults -- the arguments you pass to the <code>ActivateGateway</code> API call determine the actual configuration of your gateway.</p>
120 /// <p>For more information, see <a href="https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html">Getting activation key</a> in the <i>Storage Gateway User Guide</i>.</p>
121 pub fn set_activation_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.inner = self.inner.set_activation_key(input);
123 self
124 }
125 /// <p>Your gateway activation key. You can obtain the activation key by sending an HTTP GET request with redirects enabled to the gateway IP address (port 80). The redirect URL returned in the response provides you the activation key for your gateway in the query string parameter <code>activationKey</code>. It may also include other activation-related parameters, however, these are merely defaults -- the arguments you pass to the <code>ActivateGateway</code> API call determine the actual configuration of your gateway.</p>
126 /// <p>For more information, see <a href="https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html">Getting activation key</a> in the <i>Storage Gateway User Guide</i>.</p>
127 pub fn get_activation_key(&self) -> &::std::option::Option<::std::string::String> {
128 self.inner.get_activation_key()
129 }
130 /// <p>The name you configured for your gateway.</p>
131 pub fn gateway_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132 self.inner = self.inner.gateway_name(input.into());
133 self
134 }
135 /// <p>The name you configured for your gateway.</p>
136 pub fn set_gateway_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137 self.inner = self.inner.set_gateway_name(input);
138 self
139 }
140 /// <p>The name you configured for your gateway.</p>
141 pub fn get_gateway_name(&self) -> &::std::option::Option<::std::string::String> {
142 self.inner.get_gateway_name()
143 }
144 /// <p>A value that indicates the time zone you want to set for the gateway. The time zone is of the format "GMT", "GMT-hr:mm", or "GMT+hr:mm". For example, GMT indicates Greenwich Mean Time without any offset. GMT-4:00 indicates the time is 4 hours behind GMT. GMT+2:00 indicates the time is 2 hours ahead of GMT. The time zone is used, for example, for scheduling snapshots and your gateway's maintenance schedule.</p>
145 pub fn gateway_timezone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.inner = self.inner.gateway_timezone(input.into());
147 self
148 }
149 /// <p>A value that indicates the time zone you want to set for the gateway. The time zone is of the format "GMT", "GMT-hr:mm", or "GMT+hr:mm". For example, GMT indicates Greenwich Mean Time without any offset. GMT-4:00 indicates the time is 4 hours behind GMT. GMT+2:00 indicates the time is 2 hours ahead of GMT. The time zone is used, for example, for scheduling snapshots and your gateway's maintenance schedule.</p>
150 pub fn set_gateway_timezone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151 self.inner = self.inner.set_gateway_timezone(input);
152 self
153 }
154 /// <p>A value that indicates the time zone you want to set for the gateway. The time zone is of the format "GMT", "GMT-hr:mm", or "GMT+hr:mm". For example, GMT indicates Greenwich Mean Time without any offset. GMT-4:00 indicates the time is 4 hours behind GMT. GMT+2:00 indicates the time is 2 hours ahead of GMT. The time zone is used, for example, for scheduling snapshots and your gateway's maintenance schedule.</p>
155 pub fn get_gateway_timezone(&self) -> &::std::option::Option<::std::string::String> {
156 self.inner.get_gateway_timezone()
157 }
158 /// <p>A value that indicates the Amazon Web Services Region where you want to store your data. The gateway Amazon Web Services Region specified must be the same Amazon Web Services Region as the Amazon Web Services Region in your <code>Host</code> header in the request. For more information about available Amazon Web Services Regions and endpoints for Storage Gateway, see <a href="https://docs.aws.amazon.com/general/latest/gr/sg.html"> Storage Gateway endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
159 /// <p>Valid Values: See <a href="https://docs.aws.amazon.com/general/latest/gr/sg.html"> Storage Gateway endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
160 pub fn gateway_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161 self.inner = self.inner.gateway_region(input.into());
162 self
163 }
164 /// <p>A value that indicates the Amazon Web Services Region where you want to store your data. The gateway Amazon Web Services Region specified must be the same Amazon Web Services Region as the Amazon Web Services Region in your <code>Host</code> header in the request. For more information about available Amazon Web Services Regions and endpoints for Storage Gateway, see <a href="https://docs.aws.amazon.com/general/latest/gr/sg.html"> Storage Gateway endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
165 /// <p>Valid Values: See <a href="https://docs.aws.amazon.com/general/latest/gr/sg.html"> Storage Gateway endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
166 pub fn set_gateway_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167 self.inner = self.inner.set_gateway_region(input);
168 self
169 }
170 /// <p>A value that indicates the Amazon Web Services Region where you want to store your data. The gateway Amazon Web Services Region specified must be the same Amazon Web Services Region as the Amazon Web Services Region in your <code>Host</code> header in the request. For more information about available Amazon Web Services Regions and endpoints for Storage Gateway, see <a href="https://docs.aws.amazon.com/general/latest/gr/sg.html"> Storage Gateway endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
171 /// <p>Valid Values: See <a href="https://docs.aws.amazon.com/general/latest/gr/sg.html"> Storage Gateway endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
172 pub fn get_gateway_region(&self) -> &::std::option::Option<::std::string::String> {
173 self.inner.get_gateway_region()
174 }
175 /// <p>A value that defines the type of gateway to activate. The type specified is critical to all later functions of the gateway and cannot be changed after activation. The default value is <code>CACHED</code>.</p><important>
176 /// <p>Amazon FSx File Gateway is no longer available to new customers. Existing customers of FSx File Gateway can continue to use the service normally. For capabilities similar to FSx File Gateway, visit <a href="https://aws.amazon.com/blogs/storage/switch-your-file-share-access-from-amazon-fsx-file-gateway-to-amazon-fsx-for-windows-file-server/">this blog post</a>.</p>
177 /// </important>
178 /// <p>Valid Values: <code>STORED</code> | <code>CACHED</code> | <code>VTL</code> | <code>FILE_S3</code> | <code>FILE_FSX_SMB</code></p>
179 pub fn gateway_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180 self.inner = self.inner.gateway_type(input.into());
181 self
182 }
183 /// <p>A value that defines the type of gateway to activate. The type specified is critical to all later functions of the gateway and cannot be changed after activation. The default value is <code>CACHED</code>.</p><important>
184 /// <p>Amazon FSx File Gateway is no longer available to new customers. Existing customers of FSx File Gateway can continue to use the service normally. For capabilities similar to FSx File Gateway, visit <a href="https://aws.amazon.com/blogs/storage/switch-your-file-share-access-from-amazon-fsx-file-gateway-to-amazon-fsx-for-windows-file-server/">this blog post</a>.</p>
185 /// </important>
186 /// <p>Valid Values: <code>STORED</code> | <code>CACHED</code> | <code>VTL</code> | <code>FILE_S3</code> | <code>FILE_FSX_SMB</code></p>
187 pub fn set_gateway_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188 self.inner = self.inner.set_gateway_type(input);
189 self
190 }
191 /// <p>A value that defines the type of gateway to activate. The type specified is critical to all later functions of the gateway and cannot be changed after activation. The default value is <code>CACHED</code>.</p><important>
192 /// <p>Amazon FSx File Gateway is no longer available to new customers. Existing customers of FSx File Gateway can continue to use the service normally. For capabilities similar to FSx File Gateway, visit <a href="https://aws.amazon.com/blogs/storage/switch-your-file-share-access-from-amazon-fsx-file-gateway-to-amazon-fsx-for-windows-file-server/">this blog post</a>.</p>
193 /// </important>
194 /// <p>Valid Values: <code>STORED</code> | <code>CACHED</code> | <code>VTL</code> | <code>FILE_S3</code> | <code>FILE_FSX_SMB</code></p>
195 pub fn get_gateway_type(&self) -> &::std::option::Option<::std::string::String> {
196 self.inner.get_gateway_type()
197 }
198 /// <p>The value that indicates the type of tape drive to use for tape gateway. This field is optional.</p>
199 /// <p>Valid Values: <code>IBM-ULT3580-TD5</code></p>
200 pub fn tape_drive_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
201 self.inner = self.inner.tape_drive_type(input.into());
202 self
203 }
204 /// <p>The value that indicates the type of tape drive to use for tape gateway. This field is optional.</p>
205 /// <p>Valid Values: <code>IBM-ULT3580-TD5</code></p>
206 pub fn set_tape_drive_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207 self.inner = self.inner.set_tape_drive_type(input);
208 self
209 }
210 /// <p>The value that indicates the type of tape drive to use for tape gateway. This field is optional.</p>
211 /// <p>Valid Values: <code>IBM-ULT3580-TD5</code></p>
212 pub fn get_tape_drive_type(&self) -> &::std::option::Option<::std::string::String> {
213 self.inner.get_tape_drive_type()
214 }
215 /// <p>The value that indicates the type of medium changer to use for tape gateway. This field is optional.</p>
216 /// <p>Valid Values: <code>STK-L700</code> | <code>AWS-Gateway-VTL</code> | <code>IBM-03584L32-0402</code></p>
217 pub fn medium_changer_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218 self.inner = self.inner.medium_changer_type(input.into());
219 self
220 }
221 /// <p>The value that indicates the type of medium changer to use for tape gateway. This field is optional.</p>
222 /// <p>Valid Values: <code>STK-L700</code> | <code>AWS-Gateway-VTL</code> | <code>IBM-03584L32-0402</code></p>
223 pub fn set_medium_changer_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224 self.inner = self.inner.set_medium_changer_type(input);
225 self
226 }
227 /// <p>The value that indicates the type of medium changer to use for tape gateway. This field is optional.</p>
228 /// <p>Valid Values: <code>STK-L700</code> | <code>AWS-Gateway-VTL</code> | <code>IBM-03584L32-0402</code></p>
229 pub fn get_medium_changer_type(&self) -> &::std::option::Option<::std::string::String> {
230 self.inner.get_medium_changer_type()
231 }
232 ///
233 /// Appends an item to `Tags`.
234 ///
235 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
236 ///
237 /// <p>A list of up to 50 tags that you can assign to the gateway. Each tag is a key-value pair.</p><note>
238 /// <p>Valid characters for key and value are letters, spaces, and numbers that can be represented 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 characters.</p>
239 /// </note>
240 pub fn tags(mut self, input: crate::types::Tag) -> Self {
241 self.inner = self.inner.tags(input);
242 self
243 }
244 /// <p>A list of up to 50 tags that you can assign to the gateway. Each tag is a key-value pair.</p><note>
245 /// <p>Valid characters for key and value are letters, spaces, and numbers that can be represented 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 characters.</p>
246 /// </note>
247 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
248 self.inner = self.inner.set_tags(input);
249 self
250 }
251 /// <p>A list of up to 50 tags that you can assign to the gateway. Each tag is a key-value pair.</p><note>
252 /// <p>Valid characters for key and value are letters, spaces, and numbers that can be represented 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 characters.</p>
253 /// </note>
254 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
255 self.inner.get_tags()
256 }
257}