aws_sdk_databrew/operation/update_schedule/_update_schedule_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateScheduleInput {
6 /// <p>The name or names of one or more jobs to be run for this schedule.</p>
7 pub job_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8 /// <p>The date or dates and time or times when the jobs are to be run. For more information, see <a href="https://docs.aws.amazon.com/databrew/latest/dg/jobs.cron.html">Cron expressions</a> in the <i>Glue DataBrew Developer Guide</i>.</p>
9 pub cron_expression: ::std::option::Option<::std::string::String>,
10 /// <p>The name of the schedule to update.</p>
11 pub name: ::std::option::Option<::std::string::String>,
12}
13impl UpdateScheduleInput {
14 /// <p>The name or names of one or more jobs to be run for this schedule.</p>
15 ///
16 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.job_names.is_none()`.
17 pub fn job_names(&self) -> &[::std::string::String] {
18 self.job_names.as_deref().unwrap_or_default()
19 }
20 /// <p>The date or dates and time or times when the jobs are to be run. For more information, see <a href="https://docs.aws.amazon.com/databrew/latest/dg/jobs.cron.html">Cron expressions</a> in the <i>Glue DataBrew Developer Guide</i>.</p>
21 pub fn cron_expression(&self) -> ::std::option::Option<&str> {
22 self.cron_expression.as_deref()
23 }
24 /// <p>The name of the schedule to update.</p>
25 pub fn name(&self) -> ::std::option::Option<&str> {
26 self.name.as_deref()
27 }
28}
29impl UpdateScheduleInput {
30 /// Creates a new builder-style object to manufacture [`UpdateScheduleInput`](crate::operation::update_schedule::UpdateScheduleInput).
31 pub fn builder() -> crate::operation::update_schedule::builders::UpdateScheduleInputBuilder {
32 crate::operation::update_schedule::builders::UpdateScheduleInputBuilder::default()
33 }
34}
35
36/// A builder for [`UpdateScheduleInput`](crate::operation::update_schedule::UpdateScheduleInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct UpdateScheduleInputBuilder {
40 pub(crate) job_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
41 pub(crate) cron_expression: ::std::option::Option<::std::string::String>,
42 pub(crate) name: ::std::option::Option<::std::string::String>,
43}
44impl UpdateScheduleInputBuilder {
45 /// Appends an item to `job_names`.
46 ///
47 /// To override the contents of this collection use [`set_job_names`](Self::set_job_names).
48 ///
49 /// <p>The name or names of one or more jobs to be run for this schedule.</p>
50 pub fn job_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
51 let mut v = self.job_names.unwrap_or_default();
52 v.push(input.into());
53 self.job_names = ::std::option::Option::Some(v);
54 self
55 }
56 /// <p>The name or names of one or more jobs to be run for this schedule.</p>
57 pub fn set_job_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
58 self.job_names = input;
59 self
60 }
61 /// <p>The name or names of one or more jobs to be run for this schedule.</p>
62 pub fn get_job_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
63 &self.job_names
64 }
65 /// <p>The date or dates and time or times when the jobs are to be run. For more information, see <a href="https://docs.aws.amazon.com/databrew/latest/dg/jobs.cron.html">Cron expressions</a> in the <i>Glue DataBrew Developer Guide</i>.</p>
66 /// This field is required.
67 pub fn cron_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68 self.cron_expression = ::std::option::Option::Some(input.into());
69 self
70 }
71 /// <p>The date or dates and time or times when the jobs are to be run. For more information, see <a href="https://docs.aws.amazon.com/databrew/latest/dg/jobs.cron.html">Cron expressions</a> in the <i>Glue DataBrew Developer Guide</i>.</p>
72 pub fn set_cron_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73 self.cron_expression = input;
74 self
75 }
76 /// <p>The date or dates and time or times when the jobs are to be run. For more information, see <a href="https://docs.aws.amazon.com/databrew/latest/dg/jobs.cron.html">Cron expressions</a> in the <i>Glue DataBrew Developer Guide</i>.</p>
77 pub fn get_cron_expression(&self) -> &::std::option::Option<::std::string::String> {
78 &self.cron_expression
79 }
80 /// <p>The name of the schedule to update.</p>
81 /// This field is required.
82 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83 self.name = ::std::option::Option::Some(input.into());
84 self
85 }
86 /// <p>The name of the schedule to update.</p>
87 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.name = input;
89 self
90 }
91 /// <p>The name of the schedule to update.</p>
92 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
93 &self.name
94 }
95 /// Consumes the builder and constructs a [`UpdateScheduleInput`](crate::operation::update_schedule::UpdateScheduleInput).
96 pub fn build(
97 self,
98 ) -> ::std::result::Result<crate::operation::update_schedule::UpdateScheduleInput, ::aws_smithy_types::error::operation::BuildError> {
99 ::std::result::Result::Ok(crate::operation::update_schedule::UpdateScheduleInput {
100 job_names: self.job_names,
101 cron_expression: self.cron_expression,
102 name: self.name,
103 })
104 }
105}