aws_sdk_arczonalshift/operation/update_practice_run_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_practice_run_configuration::_update_practice_run_configuration_output::UpdatePracticeRunConfigurationOutputBuilder;
3
4pub use crate::operation::update_practice_run_configuration::_update_practice_run_configuration_input::UpdatePracticeRunConfigurationInputBuilder;
5
6impl crate::operation::update_practice_run_configuration::builders::UpdatePracticeRunConfigurationInputBuilder {
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_practice_run_configuration::UpdatePracticeRunConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_practice_run_configuration::UpdatePracticeRunConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_practice_run_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdatePracticeRunConfiguration`.
24///
25/// <p>Update a practice run configuration to change one or more of the following: add, change, or remove the blocking alarm; change the outcome alarm; or add, change, or remove blocking dates or time windows.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdatePracticeRunConfigurationFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_practice_run_configuration::builders::UpdatePracticeRunConfigurationInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_practice_run_configuration::UpdatePracticeRunConfigurationOutput,
35        crate::operation::update_practice_run_configuration::UpdatePracticeRunConfigurationError,
36    > for UpdatePracticeRunConfigurationFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_practice_run_configuration::UpdatePracticeRunConfigurationOutput,
44            crate::operation::update_practice_run_configuration::UpdatePracticeRunConfigurationError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdatePracticeRunConfigurationFluentBuilder {
51    /// Creates a new `UpdatePracticeRunConfigurationFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdatePracticeRunConfiguration as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_practice_run_configuration::builders::UpdatePracticeRunConfigurationInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_practice_run_configuration::UpdatePracticeRunConfigurationOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_practice_run_configuration::UpdatePracticeRunConfigurationError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_practice_run_configuration::UpdatePracticeRunConfiguration::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_practice_run_configuration::UpdatePracticeRunConfiguration::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_practice_run_configuration::UpdatePracticeRunConfigurationOutput,
97        crate::operation::update_practice_run_configuration::UpdatePracticeRunConfigurationError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The identifier for the resource that you want to update the practice run configuration for. The identifier is the Amazon Resource Name (ARN) for the resource.</p>
112    pub fn resource_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.resource_identifier(input.into());
114        self
115    }
116    /// <p>The identifier for the resource that you want to update the practice run configuration for. The identifier is the Amazon Resource Name (ARN) for the resource.</p>
117    pub fn set_resource_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_resource_identifier(input);
119        self
120    }
121    /// <p>The identifier for the resource that you want to update the practice run configuration for. The identifier is the Amazon Resource Name (ARN) for the resource.</p>
122    pub fn get_resource_identifier(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_resource_identifier()
124    }
125    ///
126    /// Appends an item to `blockedWindows`.
127    ///
128    /// To override the contents of this collection use [`set_blocked_windows`](Self::set_blocked_windows).
129    ///
130    /// <p>Add, change, or remove windows of days and times for when you can, optionally, block ARC from starting a practice run for a resource.</p>
131    /// <p>The format for blocked windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple blocked windows with spaces.</p>
132    /// <p>For example, say you run business report summaries three days a week. For this scenario, you might set the following recurring days and times as blocked windows, for example: <code>MON-20:30-21:30 WED-20:30-21:30 FRI-20:30-21:30</code>.</p>
133    pub fn blocked_windows(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.blocked_windows(input.into());
135        self
136    }
137    /// <p>Add, change, or remove windows of days and times for when you can, optionally, block ARC from starting a practice run for a resource.</p>
138    /// <p>The format for blocked windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple blocked windows with spaces.</p>
139    /// <p>For example, say you run business report summaries three days a week. For this scenario, you might set the following recurring days and times as blocked windows, for example: <code>MON-20:30-21:30 WED-20:30-21:30 FRI-20:30-21:30</code>.</p>
140    pub fn set_blocked_windows(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
141        self.inner = self.inner.set_blocked_windows(input);
142        self
143    }
144    /// <p>Add, change, or remove windows of days and times for when you can, optionally, block ARC from starting a practice run for a resource.</p>
145    /// <p>The format for blocked windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple blocked windows with spaces.</p>
146    /// <p>For example, say you run business report summaries three days a week. For this scenario, you might set the following recurring days and times as blocked windows, for example: <code>MON-20:30-21:30 WED-20:30-21:30 FRI-20:30-21:30</code>.</p>
147    pub fn get_blocked_windows(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
148        self.inner.get_blocked_windows()
149    }
150    ///
151    /// Appends an item to `blockedDates`.
152    ///
153    /// To override the contents of this collection use [`set_blocked_dates`](Self::set_blocked_dates).
154    ///
155    /// <p>Add, change, or remove blocked dates for a practice run in zonal autoshift.</p>
156    /// <p>Optionally, you can block practice runs for specific calendar dates. The format for blocked dates is: YYYY-MM-DD. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Separate multiple blocked dates with spaces.</p>
157    /// <p>For example, if you have an application update scheduled to launch on May 1, 2024, and you don't want practice runs to shift traffic away at that time, you could set a blocked date for <code>2024-05-01</code>.</p>
158    pub fn blocked_dates(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.inner = self.inner.blocked_dates(input.into());
160        self
161    }
162    /// <p>Add, change, or remove blocked dates for a practice run in zonal autoshift.</p>
163    /// <p>Optionally, you can block practice runs for specific calendar dates. The format for blocked dates is: YYYY-MM-DD. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Separate multiple blocked dates with spaces.</p>
164    /// <p>For example, if you have an application update scheduled to launch on May 1, 2024, and you don't want practice runs to shift traffic away at that time, you could set a blocked date for <code>2024-05-01</code>.</p>
165    pub fn set_blocked_dates(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
166        self.inner = self.inner.set_blocked_dates(input);
167        self
168    }
169    /// <p>Add, change, or remove blocked dates for a practice run in zonal autoshift.</p>
170    /// <p>Optionally, you can block practice runs for specific calendar dates. The format for blocked dates is: YYYY-MM-DD. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Separate multiple blocked dates with spaces.</p>
171    /// <p>For example, if you have an application update scheduled to launch on May 1, 2024, and you don't want practice runs to shift traffic away at that time, you could set a blocked date for <code>2024-05-01</code>.</p>
172    pub fn get_blocked_dates(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
173        self.inner.get_blocked_dates()
174    }
175    ///
176    /// Appends an item to `blockingAlarms`.
177    ///
178    /// To override the contents of this collection use [`set_blocking_alarms`](Self::set_blocking_alarms).
179    ///
180    /// <p>Add, change, or remove the Amazon CloudWatch alarms that you optionally specify as the blocking alarms for practice runs.</p>
181    pub fn blocking_alarms(mut self, input: crate::types::ControlCondition) -> Self {
182        self.inner = self.inner.blocking_alarms(input);
183        self
184    }
185    /// <p>Add, change, or remove the Amazon CloudWatch alarms that you optionally specify as the blocking alarms for practice runs.</p>
186    pub fn set_blocking_alarms(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ControlCondition>>) -> Self {
187        self.inner = self.inner.set_blocking_alarms(input);
188        self
189    }
190    /// <p>Add, change, or remove the Amazon CloudWatch alarms that you optionally specify as the blocking alarms for practice runs.</p>
191    pub fn get_blocking_alarms(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ControlCondition>> {
192        self.inner.get_blocking_alarms()
193    }
194    ///
195    /// Appends an item to `allowedWindows`.
196    ///
197    /// To override the contents of this collection use [`set_allowed_windows`](Self::set_allowed_windows).
198    ///
199    /// <p>Add, change, or remove windows of days and times for when you can, optionally, allow ARC to start a practice run for a resource.</p>
200    /// <p>The format for allowed windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple allowed windows with spaces.</p>
201    /// <p>For example, say you want to allow practice runs only on Wednesdays and Fridays from noon to 5 p.m. For this scenario, you could set the following recurring days and times as allowed windows, for example: <code>Wed-12:00-Wed:17:00 Fri-12:00-Fri:17:00</code>.</p><important>
202    /// <p>The <code>allowedWindows</code> have to start and end on the same day. Windows that span multiple days aren't supported.</p>
203    /// </important>
204    pub fn allowed_windows(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.inner = self.inner.allowed_windows(input.into());
206        self
207    }
208    /// <p>Add, change, or remove windows of days and times for when you can, optionally, allow ARC to start a practice run for a resource.</p>
209    /// <p>The format for allowed windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple allowed windows with spaces.</p>
210    /// <p>For example, say you want to allow practice runs only on Wednesdays and Fridays from noon to 5 p.m. For this scenario, you could set the following recurring days and times as allowed windows, for example: <code>Wed-12:00-Wed:17:00 Fri-12:00-Fri:17:00</code>.</p><important>
211    /// <p>The <code>allowedWindows</code> have to start and end on the same day. Windows that span multiple days aren't supported.</p>
212    /// </important>
213    pub fn set_allowed_windows(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
214        self.inner = self.inner.set_allowed_windows(input);
215        self
216    }
217    /// <p>Add, change, or remove windows of days and times for when you can, optionally, allow ARC to start a practice run for a resource.</p>
218    /// <p>The format for allowed windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple allowed windows with spaces.</p>
219    /// <p>For example, say you want to allow practice runs only on Wednesdays and Fridays from noon to 5 p.m. For this scenario, you could set the following recurring days and times as allowed windows, for example: <code>Wed-12:00-Wed:17:00 Fri-12:00-Fri:17:00</code>.</p><important>
220    /// <p>The <code>allowedWindows</code> have to start and end on the same day. Windows that span multiple days aren't supported.</p>
221    /// </important>
222    pub fn get_allowed_windows(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
223        self.inner.get_allowed_windows()
224    }
225    ///
226    /// Appends an item to `outcomeAlarms`.
227    ///
228    /// To override the contents of this collection use [`set_outcome_alarms`](Self::set_outcome_alarms).
229    ///
230    /// <p>Specify one or more Amazon CloudWatch alarms as the outcome alarms for practice runs.</p>
231    pub fn outcome_alarms(mut self, input: crate::types::ControlCondition) -> Self {
232        self.inner = self.inner.outcome_alarms(input);
233        self
234    }
235    /// <p>Specify one or more Amazon CloudWatch alarms as the outcome alarms for practice runs.</p>
236    pub fn set_outcome_alarms(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ControlCondition>>) -> Self {
237        self.inner = self.inner.set_outcome_alarms(input);
238        self
239    }
240    /// <p>Specify one or more Amazon CloudWatch alarms as the outcome alarms for practice runs.</p>
241    pub fn get_outcome_alarms(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ControlCondition>> {
242        self.inner.get_outcome_alarms()
243    }
244}