aws_sdk_scheduler/operation/update_schedule/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_schedule::_update_schedule_output::UpdateScheduleOutputBuilder;
3
4pub use crate::operation::update_schedule::_update_schedule_input::UpdateScheduleInputBuilder;
5
6impl crate::operation::update_schedule::builders::UpdateScheduleInputBuilder {
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_schedule::UpdateScheduleOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_schedule::UpdateScheduleError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_schedule();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateSchedule`.
24///
25/// <p>Updates the specified schedule. When you call <code>UpdateSchedule</code>, EventBridge Scheduler uses all values, including empty values, specified in the request and overrides the existing schedule. This is by design. This means that if you do not set an optional field in your request, that field will be set to its system-default value after the update.</p>
26/// <p>Before calling this operation, we recommend that you call the <code>GetSchedule</code> API operation and make a note of all optional parameters for your <code>UpdateSchedule</code> call.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct UpdateScheduleFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::update_schedule::builders::UpdateScheduleInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::update_schedule::UpdateScheduleOutput,
36        crate::operation::update_schedule::UpdateScheduleError,
37    > for UpdateScheduleFluentBuilder
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::update_schedule::UpdateScheduleOutput,
45            crate::operation::update_schedule::UpdateScheduleError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl UpdateScheduleFluentBuilder {
52    /// Creates a new `UpdateScheduleFluentBuilder`.
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 UpdateSchedule as a reference.
61    pub fn as_input(&self) -> &crate::operation::update_schedule::builders::UpdateScheduleInputBuilder {
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::update_schedule::UpdateScheduleOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::update_schedule::UpdateScheduleError,
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::update_schedule::UpdateSchedule::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::update_schedule::UpdateSchedule::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::update_schedule::UpdateScheduleOutput,
98        crate::operation::update_schedule::UpdateScheduleError,
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    /// <p>The name of the schedule that you are updating.</p>
113    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.name(input.into());
115        self
116    }
117    /// <p>The name of the schedule that you are updating.</p>
118    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_name(input);
120        self
121    }
122    /// <p>The name of the schedule that you are updating.</p>
123    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_name()
125    }
126    /// <p>The name of the schedule group with which the schedule is associated. You must provide this value in order for EventBridge Scheduler to find the schedule you want to update. If you omit this value, EventBridge Scheduler assumes the group is associated to the default group.</p>
127    pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.group_name(input.into());
129        self
130    }
131    /// <p>The name of the schedule group with which the schedule is associated. You must provide this value in order for EventBridge Scheduler to find the schedule you want to update. If you omit this value, EventBridge Scheduler assumes the group is associated to the default group.</p>
132    pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_group_name(input);
134        self
135    }
136    /// <p>The name of the schedule group with which the schedule is associated. You must provide this value in order for EventBridge Scheduler to find the schedule you want to update. If you omit this value, EventBridge Scheduler assumes the group is associated to the default group.</p>
137    pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_group_name()
139    }
140    /// <p>The expression that defines when the schedule runs. The following formats are supported.</p>
141    /// <ul>
142    /// <li>
143    /// <p><code>at</code> expression - <code>at(yyyy-mm-ddThh:mm:ss)</code></p></li>
144    /// <li>
145    /// <p><code>rate</code> expression - <code>rate(value unit)</code></p></li>
146    /// <li>
147    /// <p><code>cron</code> expression - <code>cron(fields)</code></p></li>
148    /// </ul>
149    /// <p>You can use <code>at</code> expressions to create one-time schedules that invoke a target once, at the time and in the time zone, that you specify. You can use <code>rate</code> and <code>cron</code> expressions to create recurring schedules. Rate-based schedules are useful when you want to invoke a target at regular intervals, such as every 15 minutes or every five days. Cron-based schedules are useful when you want to invoke a target periodically at a specific time, such as at 8:00 am (UTC+0) every 1st day of the month.</p>
150    /// <p>A <code>cron</code> expression consists of six fields separated by white spaces: <code>(minutes hours day_of_month month day_of_week year)</code>.</p>
151    /// <p>A <code>rate</code> expression consists of a <i>value</i> as a positive integer, and a <i>unit</i> with the following options: <code>minute</code> | <code>minutes</code> | <code>hour</code> | <code>hours</code> | <code>day</code> | <code>days</code></p>
152    /// <p>For more information and examples, see <a href="https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html">Schedule types on EventBridge Scheduler</a> in the <i>EventBridge Scheduler User Guide</i>.</p>
153    pub fn schedule_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.inner = self.inner.schedule_expression(input.into());
155        self
156    }
157    /// <p>The expression that defines when the schedule runs. The following formats are supported.</p>
158    /// <ul>
159    /// <li>
160    /// <p><code>at</code> expression - <code>at(yyyy-mm-ddThh:mm:ss)</code></p></li>
161    /// <li>
162    /// <p><code>rate</code> expression - <code>rate(value unit)</code></p></li>
163    /// <li>
164    /// <p><code>cron</code> expression - <code>cron(fields)</code></p></li>
165    /// </ul>
166    /// <p>You can use <code>at</code> expressions to create one-time schedules that invoke a target once, at the time and in the time zone, that you specify. You can use <code>rate</code> and <code>cron</code> expressions to create recurring schedules. Rate-based schedules are useful when you want to invoke a target at regular intervals, such as every 15 minutes or every five days. Cron-based schedules are useful when you want to invoke a target periodically at a specific time, such as at 8:00 am (UTC+0) every 1st day of the month.</p>
167    /// <p>A <code>cron</code> expression consists of six fields separated by white spaces: <code>(minutes hours day_of_month month day_of_week year)</code>.</p>
168    /// <p>A <code>rate</code> expression consists of a <i>value</i> as a positive integer, and a <i>unit</i> with the following options: <code>minute</code> | <code>minutes</code> | <code>hour</code> | <code>hours</code> | <code>day</code> | <code>days</code></p>
169    /// <p>For more information and examples, see <a href="https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html">Schedule types on EventBridge Scheduler</a> in the <i>EventBridge Scheduler User Guide</i>.</p>
170    pub fn set_schedule_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.inner = self.inner.set_schedule_expression(input);
172        self
173    }
174    /// <p>The expression that defines when the schedule runs. The following formats are supported.</p>
175    /// <ul>
176    /// <li>
177    /// <p><code>at</code> expression - <code>at(yyyy-mm-ddThh:mm:ss)</code></p></li>
178    /// <li>
179    /// <p><code>rate</code> expression - <code>rate(value unit)</code></p></li>
180    /// <li>
181    /// <p><code>cron</code> expression - <code>cron(fields)</code></p></li>
182    /// </ul>
183    /// <p>You can use <code>at</code> expressions to create one-time schedules that invoke a target once, at the time and in the time zone, that you specify. You can use <code>rate</code> and <code>cron</code> expressions to create recurring schedules. Rate-based schedules are useful when you want to invoke a target at regular intervals, such as every 15 minutes or every five days. Cron-based schedules are useful when you want to invoke a target periodically at a specific time, such as at 8:00 am (UTC+0) every 1st day of the month.</p>
184    /// <p>A <code>cron</code> expression consists of six fields separated by white spaces: <code>(minutes hours day_of_month month day_of_week year)</code>.</p>
185    /// <p>A <code>rate</code> expression consists of a <i>value</i> as a positive integer, and a <i>unit</i> with the following options: <code>minute</code> | <code>minutes</code> | <code>hour</code> | <code>hours</code> | <code>day</code> | <code>days</code></p>
186    /// <p>For more information and examples, see <a href="https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html">Schedule types on EventBridge Scheduler</a> in the <i>EventBridge Scheduler User Guide</i>.</p>
187    pub fn get_schedule_expression(&self) -> &::std::option::Option<::std::string::String> {
188        self.inner.get_schedule_expression()
189    }
190    /// <p>The date, in UTC, after which the schedule can begin invoking its target. Depending on the schedule's recurrence expression, invocations might occur on, or after, the <code>StartDate</code> you specify. EventBridge Scheduler ignores <code>StartDate</code> for one-time schedules.</p>
191    pub fn start_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
192        self.inner = self.inner.start_date(input);
193        self
194    }
195    /// <p>The date, in UTC, after which the schedule can begin invoking its target. Depending on the schedule's recurrence expression, invocations might occur on, or after, the <code>StartDate</code> you specify. EventBridge Scheduler ignores <code>StartDate</code> for one-time schedules.</p>
196    pub fn set_start_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
197        self.inner = self.inner.set_start_date(input);
198        self
199    }
200    /// <p>The date, in UTC, after which the schedule can begin invoking its target. Depending on the schedule's recurrence expression, invocations might occur on, or after, the <code>StartDate</code> you specify. EventBridge Scheduler ignores <code>StartDate</code> for one-time schedules.</p>
201    pub fn get_start_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
202        self.inner.get_start_date()
203    }
204    /// <p>The date, in UTC, before which the schedule can invoke its target. Depending on the schedule's recurrence expression, invocations might stop on, or before, the <code>EndDate</code> you specify. EventBridge Scheduler ignores <code>EndDate</code> for one-time schedules.</p>
205    pub fn end_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
206        self.inner = self.inner.end_date(input);
207        self
208    }
209    /// <p>The date, in UTC, before which the schedule can invoke its target. Depending on the schedule's recurrence expression, invocations might stop on, or before, the <code>EndDate</code> you specify. EventBridge Scheduler ignores <code>EndDate</code> for one-time schedules.</p>
210    pub fn set_end_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
211        self.inner = self.inner.set_end_date(input);
212        self
213    }
214    /// <p>The date, in UTC, before which the schedule can invoke its target. Depending on the schedule's recurrence expression, invocations might stop on, or before, the <code>EndDate</code> you specify. EventBridge Scheduler ignores <code>EndDate</code> for one-time schedules.</p>
215    pub fn get_end_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
216        self.inner.get_end_date()
217    }
218    /// <p>The description you specify for the schedule.</p>
219    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220        self.inner = self.inner.description(input.into());
221        self
222    }
223    /// <p>The description you specify for the schedule.</p>
224    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225        self.inner = self.inner.set_description(input);
226        self
227    }
228    /// <p>The description you specify for the schedule.</p>
229    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
230        self.inner.get_description()
231    }
232    /// <p>The timezone in which the scheduling expression is evaluated.</p>
233    pub fn schedule_expression_timezone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
234        self.inner = self.inner.schedule_expression_timezone(input.into());
235        self
236    }
237    /// <p>The timezone in which the scheduling expression is evaluated.</p>
238    pub fn set_schedule_expression_timezone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
239        self.inner = self.inner.set_schedule_expression_timezone(input);
240        self
241    }
242    /// <p>The timezone in which the scheduling expression is evaluated.</p>
243    pub fn get_schedule_expression_timezone(&self) -> &::std::option::Option<::std::string::String> {
244        self.inner.get_schedule_expression_timezone()
245    }
246    /// <p>Specifies whether the schedule is enabled or disabled.</p>
247    pub fn state(mut self, input: crate::types::ScheduleState) -> Self {
248        self.inner = self.inner.state(input);
249        self
250    }
251    /// <p>Specifies whether the schedule is enabled or disabled.</p>
252    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ScheduleState>) -> Self {
253        self.inner = self.inner.set_state(input);
254        self
255    }
256    /// <p>Specifies whether the schedule is enabled or disabled.</p>
257    pub fn get_state(&self) -> &::std::option::Option<crate::types::ScheduleState> {
258        self.inner.get_state()
259    }
260    /// <p>The ARN for the customer managed KMS key that that you want EventBridge Scheduler to use to encrypt and decrypt your data.</p>
261    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
262        self.inner = self.inner.kms_key_arn(input.into());
263        self
264    }
265    /// <p>The ARN for the customer managed KMS key that that you want EventBridge Scheduler to use to encrypt and decrypt your data.</p>
266    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
267        self.inner = self.inner.set_kms_key_arn(input);
268        self
269    }
270    /// <p>The ARN for the customer managed KMS key that that you want EventBridge Scheduler to use to encrypt and decrypt your data.</p>
271    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
272        self.inner.get_kms_key_arn()
273    }
274    /// <p>The schedule target. You can use this operation to change the target that your schedule invokes.</p>
275    pub fn target(mut self, input: crate::types::Target) -> Self {
276        self.inner = self.inner.target(input);
277        self
278    }
279    /// <p>The schedule target. You can use this operation to change the target that your schedule invokes.</p>
280    pub fn set_target(mut self, input: ::std::option::Option<crate::types::Target>) -> Self {
281        self.inner = self.inner.set_target(input);
282        self
283    }
284    /// <p>The schedule target. You can use this operation to change the target that your schedule invokes.</p>
285    pub fn get_target(&self) -> &::std::option::Option<crate::types::Target> {
286        self.inner.get_target()
287    }
288    /// <p>Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.</p>
289    pub fn flexible_time_window(mut self, input: crate::types::FlexibleTimeWindow) -> Self {
290        self.inner = self.inner.flexible_time_window(input);
291        self
292    }
293    /// <p>Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.</p>
294    pub fn set_flexible_time_window(mut self, input: ::std::option::Option<crate::types::FlexibleTimeWindow>) -> Self {
295        self.inner = self.inner.set_flexible_time_window(input);
296        self
297    }
298    /// <p>Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.</p>
299    pub fn get_flexible_time_window(&self) -> &::std::option::Option<crate::types::FlexibleTimeWindow> {
300        self.inner.get_flexible_time_window()
301    }
302    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.</p>
303    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
304        self.inner = self.inner.client_token(input.into());
305        self
306    }
307    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.</p>
308    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
309        self.inner = self.inner.set_client_token(input);
310        self
311    }
312    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.</p>
313    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
314        self.inner.get_client_token()
315    }
316    /// <p>Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.</p>
317    pub fn action_after_completion(mut self, input: crate::types::ActionAfterCompletion) -> Self {
318        self.inner = self.inner.action_after_completion(input);
319        self
320    }
321    /// <p>Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.</p>
322    pub fn set_action_after_completion(mut self, input: ::std::option::Option<crate::types::ActionAfterCompletion>) -> Self {
323        self.inner = self.inner.set_action_after_completion(input);
324        self
325    }
326    /// <p>Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.</p>
327    pub fn get_action_after_completion(&self) -> &::std::option::Option<crate::types::ActionAfterCompletion> {
328        self.inner.get_action_after_completion()
329    }
330}