aws_sdk_storagegateway/operation/update_maintenance_start_time/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_maintenance_start_time::_update_maintenance_start_time_output::UpdateMaintenanceStartTimeOutputBuilder;
3
4pub use crate::operation::update_maintenance_start_time::_update_maintenance_start_time_input::UpdateMaintenanceStartTimeInputBuilder;
5
6impl crate::operation::update_maintenance_start_time::builders::UpdateMaintenanceStartTimeInputBuilder {
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::update_maintenance_start_time::UpdateMaintenanceStartTimeOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_maintenance_start_time::UpdateMaintenanceStartTimeError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_maintenance_start_time();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateMaintenanceStartTime`.
24///
25/// <p>Updates a gateway's maintenance window schedule, with settings for monthly or weekly cadence, specific day and time to begin maintenance, and which types of updates to apply. Time configuration uses the gateway's time zone. You can pass values for a complete maintenance schedule, or update policy, or both. Previous values will persist for whichever setting you choose not to modify. If an incomplete or invalid maintenance schedule is passed, the entire request will be rejected with an error and no changes will occur.</p>
26/// <p>A complete maintenance schedule must include values for <i>both</i> <code>MinuteOfHour</code> and <code>HourOfDay</code>, and <i>either</i> <code>DayOfMonth</code> <i>or</i> <code>DayOfWeek</code>.</p><note>
27/// <p>We recommend keeping maintenance updates turned on, except in specific use cases where the brief disruptions caused by updating the gateway could critically impact your deployment.</p>
28/// </note>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct UpdateMaintenanceStartTimeFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::update_maintenance_start_time::builders::UpdateMaintenanceStartTimeInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::update_maintenance_start_time::UpdateMaintenanceStartTimeOutput,
38 crate::operation::update_maintenance_start_time::UpdateMaintenanceStartTimeError,
39 > for UpdateMaintenanceStartTimeFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::update_maintenance_start_time::UpdateMaintenanceStartTimeOutput,
47 crate::operation::update_maintenance_start_time::UpdateMaintenanceStartTimeError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl UpdateMaintenanceStartTimeFluentBuilder {
54 /// Creates a new `UpdateMaintenanceStartTimeFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the UpdateMaintenanceStartTime as a reference.
63 pub fn as_input(&self) -> &crate::operation::update_maintenance_start_time::builders::UpdateMaintenanceStartTimeInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::update_maintenance_start_time::UpdateMaintenanceStartTimeOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::update_maintenance_start_time::UpdateMaintenanceStartTimeError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::update_maintenance_start_time::UpdateMaintenanceStartTime::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::update_maintenance_start_time::UpdateMaintenanceStartTime::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::update_maintenance_start_time::UpdateMaintenanceStartTimeOutput,
100 crate::operation::update_maintenance_start_time::UpdateMaintenanceStartTimeError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
115 pub fn gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.gateway_arn(input.into());
117 self
118 }
119 /// <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
120 pub fn set_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_gateway_arn(input);
122 self
123 }
124 /// <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
125 pub fn get_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_gateway_arn()
127 }
128 /// <p>The hour component of the maintenance start time represented as <i>hh</i>, where <i>hh</i> is the hour (00 to 23). The hour of the day is in the time zone of the gateway.</p>
129 pub fn hour_of_day(mut self, input: i32) -> Self {
130 self.inner = self.inner.hour_of_day(input);
131 self
132 }
133 /// <p>The hour component of the maintenance start time represented as <i>hh</i>, where <i>hh</i> is the hour (00 to 23). The hour of the day is in the time zone of the gateway.</p>
134 pub fn set_hour_of_day(mut self, input: ::std::option::Option<i32>) -> Self {
135 self.inner = self.inner.set_hour_of_day(input);
136 self
137 }
138 /// <p>The hour component of the maintenance start time represented as <i>hh</i>, where <i>hh</i> is the hour (00 to 23). The hour of the day is in the time zone of the gateway.</p>
139 pub fn get_hour_of_day(&self) -> &::std::option::Option<i32> {
140 self.inner.get_hour_of_day()
141 }
142 /// <p>The minute component of the maintenance start time represented as <i>mm</i>, where <i>mm</i> is the minute (00 to 59). The minute of the hour is in the time zone of the gateway.</p>
143 pub fn minute_of_hour(mut self, input: i32) -> Self {
144 self.inner = self.inner.minute_of_hour(input);
145 self
146 }
147 /// <p>The minute component of the maintenance start time represented as <i>mm</i>, where <i>mm</i> is the minute (00 to 59). The minute of the hour is in the time zone of the gateway.</p>
148 pub fn set_minute_of_hour(mut self, input: ::std::option::Option<i32>) -> Self {
149 self.inner = self.inner.set_minute_of_hour(input);
150 self
151 }
152 /// <p>The minute component of the maintenance start time represented as <i>mm</i>, where <i>mm</i> is the minute (00 to 59). The minute of the hour is in the time zone of the gateway.</p>
153 pub fn get_minute_of_hour(&self) -> &::std::option::Option<i32> {
154 self.inner.get_minute_of_hour()
155 }
156 /// <p>The day of the week component of the maintenance start time week represented as an ordinal number from 0 to 6, where 0 represents Sunday and 6 represents Saturday.</p>
157 pub fn day_of_week(mut self, input: i32) -> Self {
158 self.inner = self.inner.day_of_week(input);
159 self
160 }
161 /// <p>The day of the week component of the maintenance start time week represented as an ordinal number from 0 to 6, where 0 represents Sunday and 6 represents Saturday.</p>
162 pub fn set_day_of_week(mut self, input: ::std::option::Option<i32>) -> Self {
163 self.inner = self.inner.set_day_of_week(input);
164 self
165 }
166 /// <p>The day of the week component of the maintenance start time week represented as an ordinal number from 0 to 6, where 0 represents Sunday and 6 represents Saturday.</p>
167 pub fn get_day_of_week(&self) -> &::std::option::Option<i32> {
168 self.inner.get_day_of_week()
169 }
170 /// <p>The day of the month component of the maintenance start time represented as an ordinal number from 1 to 28, where 1 represents the first day of the month. It is not possible to set the maintenance schedule to start on days 29 through 31.</p>
171 pub fn day_of_month(mut self, input: i32) -> Self {
172 self.inner = self.inner.day_of_month(input);
173 self
174 }
175 /// <p>The day of the month component of the maintenance start time represented as an ordinal number from 1 to 28, where 1 represents the first day of the month. It is not possible to set the maintenance schedule to start on days 29 through 31.</p>
176 pub fn set_day_of_month(mut self, input: ::std::option::Option<i32>) -> Self {
177 self.inner = self.inner.set_day_of_month(input);
178 self
179 }
180 /// <p>The day of the month component of the maintenance start time represented as an ordinal number from 1 to 28, where 1 represents the first day of the month. It is not possible to set the maintenance schedule to start on days 29 through 31.</p>
181 pub fn get_day_of_month(&self) -> &::std::option::Option<i32> {
182 self.inner.get_day_of_month()
183 }
184 /// <p>A set of variables indicating the software update preferences for the gateway.</p>
185 /// <p>Includes <code>AutomaticUpdatePolicy</code> field with the following inputs:</p>
186 /// <p><code>ALL_VERSIONS</code> - Enables regular gateway maintenance updates.</p>
187 /// <p><code>EMERGENCY_VERSIONS_ONLY</code> - Disables regular gateway maintenance updates. The gateway will still receive emergency version updates on rare occasions if necessary to remedy highly critical security or durability issues. You will be notified before an emergency version update is applied. These updates are applied during your gateway's scheduled maintenance window.</p>
188 pub fn software_update_preferences(mut self, input: crate::types::SoftwareUpdatePreferences) -> Self {
189 self.inner = self.inner.software_update_preferences(input);
190 self
191 }
192 /// <p>A set of variables indicating the software update preferences for the gateway.</p>
193 /// <p>Includes <code>AutomaticUpdatePolicy</code> field with the following inputs:</p>
194 /// <p><code>ALL_VERSIONS</code> - Enables regular gateway maintenance updates.</p>
195 /// <p><code>EMERGENCY_VERSIONS_ONLY</code> - Disables regular gateway maintenance updates. The gateway will still receive emergency version updates on rare occasions if necessary to remedy highly critical security or durability issues. You will be notified before an emergency version update is applied. These updates are applied during your gateway's scheduled maintenance window.</p>
196 pub fn set_software_update_preferences(mut self, input: ::std::option::Option<crate::types::SoftwareUpdatePreferences>) -> Self {
197 self.inner = self.inner.set_software_update_preferences(input);
198 self
199 }
200 /// <p>A set of variables indicating the software update preferences for the gateway.</p>
201 /// <p>Includes <code>AutomaticUpdatePolicy</code> field with the following inputs:</p>
202 /// <p><code>ALL_VERSIONS</code> - Enables regular gateway maintenance updates.</p>
203 /// <p><code>EMERGENCY_VERSIONS_ONLY</code> - Disables regular gateway maintenance updates. The gateway will still receive emergency version updates on rare occasions if necessary to remedy highly critical security or durability issues. You will be notified before an emergency version update is applied. These updates are applied during your gateway's scheduled maintenance window.</p>
204 pub fn get_software_update_preferences(&self) -> &::std::option::Option<crate::types::SoftwareUpdatePreferences> {
205 self.inner.get_software_update_preferences()
206 }
207}