aws_sdk_databrew/operation/describe_schedule/
_describe_schedule_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeScheduleOutput {
6 pub create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
8 pub created_by: ::std::option::Option<::std::string::String>,
10 pub job_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12 pub last_modified_by: ::std::option::Option<::std::string::String>,
14 pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
16 pub resource_arn: ::std::option::Option<::std::string::String>,
18 pub cron_expression: ::std::option::Option<::std::string::String>,
20 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
22 pub name: ::std::string::String,
24 _request_id: Option<String>,
25}
26impl DescribeScheduleOutput {
27 pub fn create_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
29 self.create_date.as_ref()
30 }
31 pub fn created_by(&self) -> ::std::option::Option<&str> {
33 self.created_by.as_deref()
34 }
35 pub fn job_names(&self) -> &[::std::string::String] {
39 self.job_names.as_deref().unwrap_or_default()
40 }
41 pub fn last_modified_by(&self) -> ::std::option::Option<&str> {
43 self.last_modified_by.as_deref()
44 }
45 pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
47 self.last_modified_date.as_ref()
48 }
49 pub fn resource_arn(&self) -> ::std::option::Option<&str> {
51 self.resource_arn.as_deref()
52 }
53 pub fn cron_expression(&self) -> ::std::option::Option<&str> {
55 self.cron_expression.as_deref()
56 }
57 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
59 self.tags.as_ref()
60 }
61 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 pub fn builder() -> crate::operation::describe_schedule::builders::DescribeScheduleOutputBuilder {
75 crate::operation::describe_schedule::builders::DescribeScheduleOutputBuilder::default()
76 }
77}
78
79#[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 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 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 pub fn get_create_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
107 &self.create_date
108 }
109 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 pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.created_by = input;
117 self
118 }
119 pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
121 &self.created_by
122 }
123 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 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 pub fn get_job_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
141 &self.job_names
142 }
143 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 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 pub fn get_last_modified_by(&self) -> &::std::option::Option<::std::string::String> {
155 &self.last_modified_by
156 }
157 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 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 pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
169 &self.last_modified_date
170 }
171 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 pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178 self.resource_arn = input;
179 self
180 }
181 pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
183 &self.resource_arn
184 }
185 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 pub fn set_cron_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192 self.cron_expression = input;
193 self
194 }
195 pub fn get_cron_expression(&self) -> &::std::option::Option<::std::string::String> {
197 &self.cron_expression
198 }
199 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
217 &self.tags
218 }
219 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
227 self.name = input;
228 self
229 }
230 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 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}