aws_sdk_scheduler/operation/create_schedule/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_schedule::_create_schedule_output::CreateScheduleOutputBuilder;
3
4pub use crate::operation::create_schedule::_create_schedule_input::CreateScheduleInputBuilder;
5
6impl crate::operation::create_schedule::builders::CreateScheduleInputBuilder {
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_schedule::CreateScheduleOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_schedule::CreateScheduleError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_schedule();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateSchedule`.
24///
25/// <p>Creates the specified schedule.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateScheduleFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_schedule::builders::CreateScheduleInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_schedule::CreateScheduleOutput,
35        crate::operation::create_schedule::CreateScheduleError,
36    > for CreateScheduleFluentBuilder
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::create_schedule::CreateScheduleOutput,
44            crate::operation::create_schedule::CreateScheduleError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateScheduleFluentBuilder {
51    /// Creates a new `CreateScheduleFluentBuilder`.
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 CreateSchedule as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_schedule::builders::CreateScheduleInputBuilder {
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::create_schedule::CreateScheduleOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_schedule::CreateScheduleError,
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::create_schedule::CreateSchedule::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_schedule::CreateSchedule::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::create_schedule::CreateScheduleOutput,
97        crate::operation::create_schedule::CreateScheduleError,
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 name of the schedule that you are creating.</p>
112    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.name(input.into());
114        self
115    }
116    /// <p>The name of the schedule that you are creating.</p>
117    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_name(input);
119        self
120    }
121    /// <p>The name of the schedule that you are creating.</p>
122    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_name()
124    }
125    /// <p>The name of the schedule group to associate with this schedule. If you omit this, the default schedule group is used.</p>
126    pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.group_name(input.into());
128        self
129    }
130    /// <p>The name of the schedule group to associate with this schedule. If you omit this, the default schedule group is used.</p>
131    pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_group_name(input);
133        self
134    }
135    /// <p>The name of the schedule group to associate with this schedule. If you omit this, the default schedule group is used.</p>
136    pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_group_name()
138    }
139    /// <p>The expression that defines when the schedule runs. The following formats are supported.</p>
140    /// <ul>
141    /// <li>
142    /// <p><code>at</code> expression - <code>at(yyyy-mm-ddThh:mm:ss)</code></p></li>
143    /// <li>
144    /// <p><code>rate</code> expression - <code>rate(value unit)</code></p></li>
145    /// <li>
146    /// <p><code>cron</code> expression - <code>cron(fields)</code></p></li>
147    /// </ul>
148    /// <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>
149    /// <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>
150    /// <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>
151    /// <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>
152    pub fn schedule_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.schedule_expression(input.into());
154        self
155    }
156    /// <p>The expression that defines when the schedule runs. The following formats are supported.</p>
157    /// <ul>
158    /// <li>
159    /// <p><code>at</code> expression - <code>at(yyyy-mm-ddThh:mm:ss)</code></p></li>
160    /// <li>
161    /// <p><code>rate</code> expression - <code>rate(value unit)</code></p></li>
162    /// <li>
163    /// <p><code>cron</code> expression - <code>cron(fields)</code></p></li>
164    /// </ul>
165    /// <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>
166    /// <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>
167    /// <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>
168    /// <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>
169    pub fn set_schedule_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_schedule_expression(input);
171        self
172    }
173    /// <p>The expression that defines when the schedule runs. The following formats are supported.</p>
174    /// <ul>
175    /// <li>
176    /// <p><code>at</code> expression - <code>at(yyyy-mm-ddThh:mm:ss)</code></p></li>
177    /// <li>
178    /// <p><code>rate</code> expression - <code>rate(value unit)</code></p></li>
179    /// <li>
180    /// <p><code>cron</code> expression - <code>cron(fields)</code></p></li>
181    /// </ul>
182    /// <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>
183    /// <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>
184    /// <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>
185    /// <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>
186    pub fn get_schedule_expression(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_schedule_expression()
188    }
189    /// <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>
190    pub fn start_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
191        self.inner = self.inner.start_date(input);
192        self
193    }
194    /// <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>
195    pub fn set_start_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
196        self.inner = self.inner.set_start_date(input);
197        self
198    }
199    /// <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>
200    pub fn get_start_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
201        self.inner.get_start_date()
202    }
203    /// <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>
204    pub fn end_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
205        self.inner = self.inner.end_date(input);
206        self
207    }
208    /// <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>
209    pub fn set_end_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
210        self.inner = self.inner.set_end_date(input);
211        self
212    }
213    /// <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>
214    pub fn get_end_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
215        self.inner.get_end_date()
216    }
217    /// <p>The description you specify for the schedule.</p>
218    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219        self.inner = self.inner.description(input.into());
220        self
221    }
222    /// <p>The description you specify for the schedule.</p>
223    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224        self.inner = self.inner.set_description(input);
225        self
226    }
227    /// <p>The description you specify for the schedule.</p>
228    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
229        self.inner.get_description()
230    }
231    /// <p>The timezone in which the scheduling expression is evaluated.</p>
232    pub fn schedule_expression_timezone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
233        self.inner = self.inner.schedule_expression_timezone(input.into());
234        self
235    }
236    /// <p>The timezone in which the scheduling expression is evaluated.</p>
237    pub fn set_schedule_expression_timezone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
238        self.inner = self.inner.set_schedule_expression_timezone(input);
239        self
240    }
241    /// <p>The timezone in which the scheduling expression is evaluated.</p>
242    pub fn get_schedule_expression_timezone(&self) -> &::std::option::Option<::std::string::String> {
243        self.inner.get_schedule_expression_timezone()
244    }
245    /// <p>Specifies whether the schedule is enabled or disabled.</p>
246    pub fn state(mut self, input: crate::types::ScheduleState) -> Self {
247        self.inner = self.inner.state(input);
248        self
249    }
250    /// <p>Specifies whether the schedule is enabled or disabled.</p>
251    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ScheduleState>) -> Self {
252        self.inner = self.inner.set_state(input);
253        self
254    }
255    /// <p>Specifies whether the schedule is enabled or disabled.</p>
256    pub fn get_state(&self) -> &::std::option::Option<crate::types::ScheduleState> {
257        self.inner.get_state()
258    }
259    /// <p>The Amazon Resource Name (ARN) for the customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data.</p>
260    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
261        self.inner = self.inner.kms_key_arn(input.into());
262        self
263    }
264    /// <p>The Amazon Resource Name (ARN) for the customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data.</p>
265    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
266        self.inner = self.inner.set_kms_key_arn(input);
267        self
268    }
269    /// <p>The Amazon Resource Name (ARN) for the customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data.</p>
270    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
271        self.inner.get_kms_key_arn()
272    }
273    /// <p>The schedule's target.</p>
274    pub fn target(mut self, input: crate::types::Target) -> Self {
275        self.inner = self.inner.target(input);
276        self
277    }
278    /// <p>The schedule's target.</p>
279    pub fn set_target(mut self, input: ::std::option::Option<crate::types::Target>) -> Self {
280        self.inner = self.inner.set_target(input);
281        self
282    }
283    /// <p>The schedule's target.</p>
284    pub fn get_target(&self) -> &::std::option::Option<crate::types::Target> {
285        self.inner.get_target()
286    }
287    /// <p>Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.</p>
288    pub fn flexible_time_window(mut self, input: crate::types::FlexibleTimeWindow) -> Self {
289        self.inner = self.inner.flexible_time_window(input);
290        self
291    }
292    /// <p>Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.</p>
293    pub fn set_flexible_time_window(mut self, input: ::std::option::Option<crate::types::FlexibleTimeWindow>) -> Self {
294        self.inner = self.inner.set_flexible_time_window(input);
295        self
296    }
297    /// <p>Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.</p>
298    pub fn get_flexible_time_window(&self) -> &::std::option::Option<crate::types::FlexibleTimeWindow> {
299        self.inner.get_flexible_time_window()
300    }
301    /// <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>
302    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
303        self.inner = self.inner.client_token(input.into());
304        self
305    }
306    /// <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>
307    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
308        self.inner = self.inner.set_client_token(input);
309        self
310    }
311    /// <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>
312    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
313        self.inner.get_client_token()
314    }
315    /// <p>Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.</p>
316    pub fn action_after_completion(mut self, input: crate::types::ActionAfterCompletion) -> Self {
317        self.inner = self.inner.action_after_completion(input);
318        self
319    }
320    /// <p>Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.</p>
321    pub fn set_action_after_completion(mut self, input: ::std::option::Option<crate::types::ActionAfterCompletion>) -> Self {
322        self.inner = self.inner.set_action_after_completion(input);
323        self
324    }
325    /// <p>Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.</p>
326    pub fn get_action_after_completion(&self) -> &::std::option::Option<crate::types::ActionAfterCompletion> {
327        self.inner.get_action_after_completion()
328    }
329}