aws_sdk_databrew/operation/describe_schedule/
_describe_schedule_output.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 DescribeScheduleOutput {
6    /// <p>The date and time that the schedule was created.</p>
7    pub create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
8    /// <p>The identifier (user name) of the user who created the schedule.</p>
9    pub created_by: ::std::option::Option<::std::string::String>,
10    /// <p>The name or names of one or more jobs to be run by using the schedule.</p>
11    pub job_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12    /// <p>The identifier (user name) of the user who last modified the schedule.</p>
13    pub last_modified_by: ::std::option::Option<::std::string::String>,
14    /// <p>The date and time that the schedule was last modified.</p>
15    pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
16    /// <p>The Amazon Resource Name (ARN) of the schedule.</p>
17    pub resource_arn: ::std::option::Option<::std::string::String>,
18    /// <p>The date or dates and time or times when the jobs are to be run for the schedule. 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>
19    pub cron_expression: ::std::option::Option<::std::string::String>,
20    /// <p>Metadata tags associated with this schedule.</p>
21    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
22    /// <p>The name of the schedule.</p>
23    pub name: ::std::string::String,
24    _request_id: Option<String>,
25}
26impl DescribeScheduleOutput {
27    /// <p>The date and time that the schedule was created.</p>
28    pub fn create_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
29        self.create_date.as_ref()
30    }
31    /// <p>The identifier (user name) of the user who created the schedule.</p>
32    pub fn created_by(&self) -> ::std::option::Option<&str> {
33        self.created_by.as_deref()
34    }
35    /// <p>The name or names of one or more jobs to be run by using the schedule.</p>
36    ///
37    /// 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()`.
38    pub fn job_names(&self) -> &[::std::string::String] {
39        self.job_names.as_deref().unwrap_or_default()
40    }
41    /// <p>The identifier (user name) of the user who last modified the schedule.</p>
42    pub fn last_modified_by(&self) -> ::std::option::Option<&str> {
43        self.last_modified_by.as_deref()
44    }
45    /// <p>The date and time that the schedule was last modified.</p>
46    pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
47        self.last_modified_date.as_ref()
48    }
49    /// <p>The Amazon Resource Name (ARN) of the schedule.</p>
50    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
51        self.resource_arn.as_deref()
52    }
53    /// <p>The date or dates and time or times when the jobs are to be run for the schedule. 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>
54    pub fn cron_expression(&self) -> ::std::option::Option<&str> {
55        self.cron_expression.as_deref()
56    }
57    /// <p>Metadata tags associated with this schedule.</p>
58    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
59        self.tags.as_ref()
60    }
61    /// <p>The name of the schedule.</p>
62    pub fn name(&self) -> &str {
63        use std::ops::Deref;
64        self.name.deref()
65    }
66}
67impl ::aws_types::request_id::RequestId for DescribeScheduleOutput {
68    fn request_id(&self) -> Option<&str> {
69        self._request_id.as_deref()
70    }
71}
72impl DescribeScheduleOutput {
73    /// Creates a new builder-style object to manufacture [`DescribeScheduleOutput`](crate::operation::describe_schedule::DescribeScheduleOutput).
74    pub fn builder() -> crate::operation::describe_schedule::builders::DescribeScheduleOutputBuilder {
75        crate::operation::describe_schedule::builders::DescribeScheduleOutputBuilder::default()
76    }
77}
78
79/// A builder for [`DescribeScheduleOutput`](crate::operation::describe_schedule::DescribeScheduleOutput).
80#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
81#[non_exhaustive]
82pub struct DescribeScheduleOutputBuilder {
83    pub(crate) create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
84    pub(crate) created_by: ::std::option::Option<::std::string::String>,
85    pub(crate) job_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
86    pub(crate) last_modified_by: ::std::option::Option<::std::string::String>,
87    pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
88    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
89    pub(crate) cron_expression: ::std::option::Option<::std::string::String>,
90    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
91    pub(crate) name: ::std::option::Option<::std::string::String>,
92    _request_id: Option<String>,
93}
94impl DescribeScheduleOutputBuilder {
95    /// <p>The date and time that the schedule was created.</p>
96    pub fn create_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
97        self.create_date = ::std::option::Option::Some(input);
98        self
99    }
100    /// <p>The date and time that the schedule was created.</p>
101    pub fn set_create_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
102        self.create_date = input;
103        self
104    }
105    /// <p>The date and time that the schedule was created.</p>
106    pub fn get_create_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
107        &self.create_date
108    }
109    /// <p>The identifier (user name) of the user who created the schedule.</p>
110    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.created_by = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The identifier (user name) of the user who created the schedule.</p>
115    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.created_by = input;
117        self
118    }
119    /// <p>The identifier (user name) of the user who created the schedule.</p>
120    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
121        &self.created_by
122    }
123    /// Appends an item to `job_names`.
124    ///
125    /// To override the contents of this collection use [`set_job_names`](Self::set_job_names).
126    ///
127    /// <p>The name or names of one or more jobs to be run by using the schedule.</p>
128    pub fn job_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        let mut v = self.job_names.unwrap_or_default();
130        v.push(input.into());
131        self.job_names = ::std::option::Option::Some(v);
132        self
133    }
134    /// <p>The name or names of one or more jobs to be run by using the schedule.</p>
135    pub fn set_job_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
136        self.job_names = input;
137        self
138    }
139    /// <p>The name or names of one or more jobs to be run by using the schedule.</p>
140    pub fn get_job_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
141        &self.job_names
142    }
143    /// <p>The identifier (user name) of the user who last modified the schedule.</p>
144    pub fn last_modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.last_modified_by = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>The identifier (user name) of the user who last modified the schedule.</p>
149    pub fn set_last_modified_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.last_modified_by = input;
151        self
152    }
153    /// <p>The identifier (user name) of the user who last modified the schedule.</p>
154    pub fn get_last_modified_by(&self) -> &::std::option::Option<::std::string::String> {
155        &self.last_modified_by
156    }
157    /// <p>The date and time that the schedule was last modified.</p>
158    pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
159        self.last_modified_date = ::std::option::Option::Some(input);
160        self
161    }
162    /// <p>The date and time that the schedule was last modified.</p>
163    pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
164        self.last_modified_date = input;
165        self
166    }
167    /// <p>The date and time that the schedule was last modified.</p>
168    pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
169        &self.last_modified_date
170    }
171    /// <p>The Amazon Resource Name (ARN) of the schedule.</p>
172    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.resource_arn = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>The Amazon Resource Name (ARN) of the schedule.</p>
177    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.resource_arn = input;
179        self
180    }
181    /// <p>The Amazon Resource Name (ARN) of the schedule.</p>
182    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
183        &self.resource_arn
184    }
185    /// <p>The date or dates and time or times when the jobs are to be run for the schedule. 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>
186    pub fn cron_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.cron_expression = ::std::option::Option::Some(input.into());
188        self
189    }
190    /// <p>The date or dates and time or times when the jobs are to be run for the schedule. 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>
191    pub fn set_cron_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192        self.cron_expression = input;
193        self
194    }
195    /// <p>The date or dates and time or times when the jobs are to be run for the schedule. 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>
196    pub fn get_cron_expression(&self) -> &::std::option::Option<::std::string::String> {
197        &self.cron_expression
198    }
199    /// Adds a key-value pair to `tags`.
200    ///
201    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
202    ///
203    /// <p>Metadata tags associated with this schedule.</p>
204    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
205        let mut hash_map = self.tags.unwrap_or_default();
206        hash_map.insert(k.into(), v.into());
207        self.tags = ::std::option::Option::Some(hash_map);
208        self
209    }
210    /// <p>Metadata tags associated with this schedule.</p>
211    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
212        self.tags = input;
213        self
214    }
215    /// <p>Metadata tags associated with this schedule.</p>
216    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
217        &self.tags
218    }
219    /// <p>The name of the schedule.</p>
220    /// This field is required.
221    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
222        self.name = ::std::option::Option::Some(input.into());
223        self
224    }
225    /// <p>The name of the schedule.</p>
226    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
227        self.name = input;
228        self
229    }
230    /// <p>The name of the schedule.</p>
231    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
232        &self.name
233    }
234    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
235        self._request_id = Some(request_id.into());
236        self
237    }
238
239    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
240        self._request_id = request_id;
241        self
242    }
243    /// Consumes the builder and constructs a [`DescribeScheduleOutput`](crate::operation::describe_schedule::DescribeScheduleOutput).
244    /// This method will fail if any of the following fields are not set:
245    /// - [`name`](crate::operation::describe_schedule::builders::DescribeScheduleOutputBuilder::name)
246    pub fn build(
247        self,
248    ) -> ::std::result::Result<crate::operation::describe_schedule::DescribeScheduleOutput, ::aws_smithy_types::error::operation::BuildError> {
249        ::std::result::Result::Ok(crate::operation::describe_schedule::DescribeScheduleOutput {
250            create_date: self.create_date,
251            created_by: self.created_by,
252            job_names: self.job_names,
253            last_modified_by: self.last_modified_by,
254            last_modified_date: self.last_modified_date,
255            resource_arn: self.resource_arn,
256            cron_expression: self.cron_expression,
257            tags: self.tags,
258            name: self.name.ok_or_else(|| {
259                ::aws_smithy_types::error::operation::BuildError::missing_field(
260                    "name",
261                    "name was not specified but it is required when building DescribeScheduleOutput",
262                )
263            })?,
264            _request_id: self._request_id,
265        })
266    }
267}