aws_sdk_databrew/operation/create_schedule/
_create_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 CreateScheduleInput {
6    /// <p>The name or names of one or more jobs to be run.</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>Metadata tags to apply to this schedule.</p>
11    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12    /// <p>A unique name for the schedule. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
13    pub name: ::std::option::Option<::std::string::String>,
14}
15impl CreateScheduleInput {
16    /// <p>The name or names of one or more jobs to be run.</p>
17    ///
18    /// 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()`.
19    pub fn job_names(&self) -> &[::std::string::String] {
20        self.job_names.as_deref().unwrap_or_default()
21    }
22    /// <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>
23    pub fn cron_expression(&self) -> ::std::option::Option<&str> {
24        self.cron_expression.as_deref()
25    }
26    /// <p>Metadata tags to apply to this schedule.</p>
27    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
28        self.tags.as_ref()
29    }
30    /// <p>A unique name for the schedule. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
31    pub fn name(&self) -> ::std::option::Option<&str> {
32        self.name.as_deref()
33    }
34}
35impl CreateScheduleInput {
36    /// Creates a new builder-style object to manufacture [`CreateScheduleInput`](crate::operation::create_schedule::CreateScheduleInput).
37    pub fn builder() -> crate::operation::create_schedule::builders::CreateScheduleInputBuilder {
38        crate::operation::create_schedule::builders::CreateScheduleInputBuilder::default()
39    }
40}
41
42/// A builder for [`CreateScheduleInput`](crate::operation::create_schedule::CreateScheduleInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateScheduleInputBuilder {
46    pub(crate) job_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
47    pub(crate) cron_expression: ::std::option::Option<::std::string::String>,
48    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
49    pub(crate) name: ::std::option::Option<::std::string::String>,
50}
51impl CreateScheduleInputBuilder {
52    /// Appends an item to `job_names`.
53    ///
54    /// To override the contents of this collection use [`set_job_names`](Self::set_job_names).
55    ///
56    /// <p>The name or names of one or more jobs to be run.</p>
57    pub fn job_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
58        let mut v = self.job_names.unwrap_or_default();
59        v.push(input.into());
60        self.job_names = ::std::option::Option::Some(v);
61        self
62    }
63    /// <p>The name or names of one or more jobs to be run.</p>
64    pub fn set_job_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
65        self.job_names = input;
66        self
67    }
68    /// <p>The name or names of one or more jobs to be run.</p>
69    pub fn get_job_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
70        &self.job_names
71    }
72    /// <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>
73    /// This field is required.
74    pub fn cron_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.cron_expression = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <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>
79    pub fn set_cron_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.cron_expression = input;
81        self
82    }
83    /// <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>
84    pub fn get_cron_expression(&self) -> &::std::option::Option<::std::string::String> {
85        &self.cron_expression
86    }
87    /// Adds a key-value pair to `tags`.
88    ///
89    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
90    ///
91    /// <p>Metadata tags to apply to this schedule.</p>
92    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
93        let mut hash_map = self.tags.unwrap_or_default();
94        hash_map.insert(k.into(), v.into());
95        self.tags = ::std::option::Option::Some(hash_map);
96        self
97    }
98    /// <p>Metadata tags to apply to this schedule.</p>
99    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
100        self.tags = input;
101        self
102    }
103    /// <p>Metadata tags to apply to this schedule.</p>
104    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
105        &self.tags
106    }
107    /// <p>A unique name for the schedule. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
108    /// This field is required.
109    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.name = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>A unique name for the schedule. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
114    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.name = input;
116        self
117    }
118    /// <p>A unique name for the schedule. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
119    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
120        &self.name
121    }
122    /// Consumes the builder and constructs a [`CreateScheduleInput`](crate::operation::create_schedule::CreateScheduleInput).
123    pub fn build(
124        self,
125    ) -> ::std::result::Result<crate::operation::create_schedule::CreateScheduleInput, ::aws_smithy_types::error::operation::BuildError> {
126        ::std::result::Result::Ok(crate::operation::create_schedule::CreateScheduleInput {
127            job_names: self.job_names,
128            cron_expression: self.cron_expression,
129            tags: self.tags,
130            name: self.name,
131        })
132    }
133}