aws_sdk_databrew/types/
_schedule.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Schedule {
7 pub account_id: ::std::option::Option<::std::string::String>,
9 pub created_by: ::std::option::Option<::std::string::String>,
11 pub create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
13 pub job_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
15 pub last_modified_by: ::std::option::Option<::std::string::String>,
17 pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
19 pub resource_arn: ::std::option::Option<::std::string::String>,
21 pub cron_expression: ::std::option::Option<::std::string::String>,
23 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
25 pub name: ::std::string::String,
27}
28impl Schedule {
29 pub fn account_id(&self) -> ::std::option::Option<&str> {
31 self.account_id.as_deref()
32 }
33 pub fn created_by(&self) -> ::std::option::Option<&str> {
35 self.created_by.as_deref()
36 }
37 pub fn create_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
39 self.create_date.as_ref()
40 }
41 pub fn job_names(&self) -> &[::std::string::String] {
45 self.job_names.as_deref().unwrap_or_default()
46 }
47 pub fn last_modified_by(&self) -> ::std::option::Option<&str> {
49 self.last_modified_by.as_deref()
50 }
51 pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
53 self.last_modified_date.as_ref()
54 }
55 pub fn resource_arn(&self) -> ::std::option::Option<&str> {
57 self.resource_arn.as_deref()
58 }
59 pub fn cron_expression(&self) -> ::std::option::Option<&str> {
61 self.cron_expression.as_deref()
62 }
63 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
65 self.tags.as_ref()
66 }
67 pub fn name(&self) -> &str {
69 use std::ops::Deref;
70 self.name.deref()
71 }
72}
73impl Schedule {
74 pub fn builder() -> crate::types::builders::ScheduleBuilder {
76 crate::types::builders::ScheduleBuilder::default()
77 }
78}
79
80#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
82#[non_exhaustive]
83pub struct ScheduleBuilder {
84 pub(crate) account_id: ::std::option::Option<::std::string::String>,
85 pub(crate) created_by: ::std::option::Option<::std::string::String>,
86 pub(crate) create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
87 pub(crate) job_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
88 pub(crate) last_modified_by: ::std::option::Option<::std::string::String>,
89 pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
90 pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
91 pub(crate) cron_expression: ::std::option::Option<::std::string::String>,
92 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
93 pub(crate) name: ::std::option::Option<::std::string::String>,
94}
95impl ScheduleBuilder {
96 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98 self.account_id = ::std::option::Option::Some(input.into());
99 self
100 }
101 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103 self.account_id = input;
104 self
105 }
106 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
108 &self.account_id
109 }
110 pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112 self.created_by = ::std::option::Option::Some(input.into());
113 self
114 }
115 pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117 self.created_by = input;
118 self
119 }
120 pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
122 &self.created_by
123 }
124 pub fn create_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
126 self.create_date = ::std::option::Option::Some(input);
127 self
128 }
129 pub fn set_create_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
131 self.create_date = input;
132 self
133 }
134 pub fn get_create_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
136 &self.create_date
137 }
138 pub fn job_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 let mut v = self.job_names.unwrap_or_default();
145 v.push(input.into());
146 self.job_names = ::std::option::Option::Some(v);
147 self
148 }
149 pub fn set_job_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
151 self.job_names = input;
152 self
153 }
154 pub fn get_job_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
156 &self.job_names
157 }
158 pub fn last_modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.last_modified_by = ::std::option::Option::Some(input.into());
161 self
162 }
163 pub fn set_last_modified_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.last_modified_by = input;
166 self
167 }
168 pub fn get_last_modified_by(&self) -> &::std::option::Option<::std::string::String> {
170 &self.last_modified_by
171 }
172 pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
174 self.last_modified_date = ::std::option::Option::Some(input);
175 self
176 }
177 pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
179 self.last_modified_date = input;
180 self
181 }
182 pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
184 &self.last_modified_date
185 }
186 pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188 self.resource_arn = ::std::option::Option::Some(input.into());
189 self
190 }
191 pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193 self.resource_arn = input;
194 self
195 }
196 pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
198 &self.resource_arn
199 }
200 pub fn cron_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202 self.cron_expression = ::std::option::Option::Some(input.into());
203 self
204 }
205 pub fn set_cron_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207 self.cron_expression = input;
208 self
209 }
210 pub fn get_cron_expression(&self) -> &::std::option::Option<::std::string::String> {
212 &self.cron_expression
213 }
214 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
220 let mut hash_map = self.tags.unwrap_or_default();
221 hash_map.insert(k.into(), v.into());
222 self.tags = ::std::option::Option::Some(hash_map);
223 self
224 }
225 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
227 self.tags = input;
228 self
229 }
230 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
232 &self.tags
233 }
234 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
237 self.name = ::std::option::Option::Some(input.into());
238 self
239 }
240 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
242 self.name = input;
243 self
244 }
245 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
247 &self.name
248 }
249 pub fn build(self) -> ::std::result::Result<crate::types::Schedule, ::aws_smithy_types::error::operation::BuildError> {
253 ::std::result::Result::Ok(crate::types::Schedule {
254 account_id: self.account_id,
255 created_by: self.created_by,
256 create_date: self.create_date,
257 job_names: self.job_names,
258 last_modified_by: self.last_modified_by,
259 last_modified_date: self.last_modified_date,
260 resource_arn: self.resource_arn,
261 cron_expression: self.cron_expression,
262 tags: self.tags,
263 name: self.name.ok_or_else(|| {
264 ::aws_smithy_types::error::operation::BuildError::missing_field(
265 "name",
266 "name was not specified but it is required when building Schedule",
267 )
268 })?,
269 })
270 }
271}