aws_sdk_databrew/operation/describe_recipe/
_describe_recipe_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeRecipeOutput {
6 pub created_by: ::std::option::Option<::std::string::String>,
8 pub create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
10 pub last_modified_by: ::std::option::Option<::std::string::String>,
12 pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
14 pub project_name: ::std::option::Option<::std::string::String>,
16 pub published_by: ::std::option::Option<::std::string::String>,
18 pub published_date: ::std::option::Option<::aws_smithy_types::DateTime>,
20 pub description: ::std::option::Option<::std::string::String>,
22 pub name: ::std::string::String,
24 pub steps: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>,
26 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
28 pub resource_arn: ::std::option::Option<::std::string::String>,
30 pub recipe_version: ::std::option::Option<::std::string::String>,
32 _request_id: Option<String>,
33}
34impl DescribeRecipeOutput {
35 pub fn created_by(&self) -> ::std::option::Option<&str> {
37 self.created_by.as_deref()
38 }
39 pub fn create_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
41 self.create_date.as_ref()
42 }
43 pub fn last_modified_by(&self) -> ::std::option::Option<&str> {
45 self.last_modified_by.as_deref()
46 }
47 pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
49 self.last_modified_date.as_ref()
50 }
51 pub fn project_name(&self) -> ::std::option::Option<&str> {
53 self.project_name.as_deref()
54 }
55 pub fn published_by(&self) -> ::std::option::Option<&str> {
57 self.published_by.as_deref()
58 }
59 pub fn published_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
61 self.published_date.as_ref()
62 }
63 pub fn description(&self) -> ::std::option::Option<&str> {
65 self.description.as_deref()
66 }
67 pub fn name(&self) -> &str {
69 use std::ops::Deref;
70 self.name.deref()
71 }
72 pub fn steps(&self) -> &[crate::types::RecipeStep] {
76 self.steps.as_deref().unwrap_or_default()
77 }
78 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
80 self.tags.as_ref()
81 }
82 pub fn resource_arn(&self) -> ::std::option::Option<&str> {
84 self.resource_arn.as_deref()
85 }
86 pub fn recipe_version(&self) -> ::std::option::Option<&str> {
88 self.recipe_version.as_deref()
89 }
90}
91impl ::aws_types::request_id::RequestId for DescribeRecipeOutput {
92 fn request_id(&self) -> Option<&str> {
93 self._request_id.as_deref()
94 }
95}
96impl DescribeRecipeOutput {
97 pub fn builder() -> crate::operation::describe_recipe::builders::DescribeRecipeOutputBuilder {
99 crate::operation::describe_recipe::builders::DescribeRecipeOutputBuilder::default()
100 }
101}
102
103#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
105#[non_exhaustive]
106pub struct DescribeRecipeOutputBuilder {
107 pub(crate) created_by: ::std::option::Option<::std::string::String>,
108 pub(crate) create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
109 pub(crate) last_modified_by: ::std::option::Option<::std::string::String>,
110 pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
111 pub(crate) project_name: ::std::option::Option<::std::string::String>,
112 pub(crate) published_by: ::std::option::Option<::std::string::String>,
113 pub(crate) published_date: ::std::option::Option<::aws_smithy_types::DateTime>,
114 pub(crate) description: ::std::option::Option<::std::string::String>,
115 pub(crate) name: ::std::option::Option<::std::string::String>,
116 pub(crate) steps: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>,
117 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
118 pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
119 pub(crate) recipe_version: ::std::option::Option<::std::string::String>,
120 _request_id: Option<String>,
121}
122impl DescribeRecipeOutputBuilder {
123 pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125 self.created_by = ::std::option::Option::Some(input.into());
126 self
127 }
128 pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130 self.created_by = input;
131 self
132 }
133 pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
135 &self.created_by
136 }
137 pub fn create_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
139 self.create_date = ::std::option::Option::Some(input);
140 self
141 }
142 pub fn set_create_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
144 self.create_date = input;
145 self
146 }
147 pub fn get_create_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
149 &self.create_date
150 }
151 pub fn last_modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153 self.last_modified_by = ::std::option::Option::Some(input.into());
154 self
155 }
156 pub fn set_last_modified_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158 self.last_modified_by = input;
159 self
160 }
161 pub fn get_last_modified_by(&self) -> &::std::option::Option<::std::string::String> {
163 &self.last_modified_by
164 }
165 pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
167 self.last_modified_date = ::std::option::Option::Some(input);
168 self
169 }
170 pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
172 self.last_modified_date = input;
173 self
174 }
175 pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
177 &self.last_modified_date
178 }
179 pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181 self.project_name = ::std::option::Option::Some(input.into());
182 self
183 }
184 pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186 self.project_name = input;
187 self
188 }
189 pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
191 &self.project_name
192 }
193 pub fn published_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195 self.published_by = ::std::option::Option::Some(input.into());
196 self
197 }
198 pub fn set_published_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200 self.published_by = input;
201 self
202 }
203 pub fn get_published_by(&self) -> &::std::option::Option<::std::string::String> {
205 &self.published_by
206 }
207 pub fn published_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
209 self.published_date = ::std::option::Option::Some(input);
210 self
211 }
212 pub fn set_published_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
214 self.published_date = input;
215 self
216 }
217 pub fn get_published_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
219 &self.published_date
220 }
221 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223 self.description = ::std::option::Option::Some(input.into());
224 self
225 }
226 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228 self.description = input;
229 self
230 }
231 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
233 &self.description
234 }
235 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238 self.name = ::std::option::Option::Some(input.into());
239 self
240 }
241 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
243 self.name = input;
244 self
245 }
246 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
248 &self.name
249 }
250 pub fn steps(mut self, input: crate::types::RecipeStep) -> Self {
256 let mut v = self.steps.unwrap_or_default();
257 v.push(input);
258 self.steps = ::std::option::Option::Some(v);
259 self
260 }
261 pub fn set_steps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>) -> Self {
263 self.steps = input;
264 self
265 }
266 pub fn get_steps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>> {
268 &self.steps
269 }
270 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
276 let mut hash_map = self.tags.unwrap_or_default();
277 hash_map.insert(k.into(), v.into());
278 self.tags = ::std::option::Option::Some(hash_map);
279 self
280 }
281 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
283 self.tags = input;
284 self
285 }
286 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
288 &self.tags
289 }
290 pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
292 self.resource_arn = ::std::option::Option::Some(input.into());
293 self
294 }
295 pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
297 self.resource_arn = input;
298 self
299 }
300 pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
302 &self.resource_arn
303 }
304 pub fn recipe_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
306 self.recipe_version = ::std::option::Option::Some(input.into());
307 self
308 }
309 pub fn set_recipe_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
311 self.recipe_version = input;
312 self
313 }
314 pub fn get_recipe_version(&self) -> &::std::option::Option<::std::string::String> {
316 &self.recipe_version
317 }
318 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
319 self._request_id = Some(request_id.into());
320 self
321 }
322
323 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
324 self._request_id = request_id;
325 self
326 }
327 pub fn build(
331 self,
332 ) -> ::std::result::Result<crate::operation::describe_recipe::DescribeRecipeOutput, ::aws_smithy_types::error::operation::BuildError> {
333 ::std::result::Result::Ok(crate::operation::describe_recipe::DescribeRecipeOutput {
334 created_by: self.created_by,
335 create_date: self.create_date,
336 last_modified_by: self.last_modified_by,
337 last_modified_date: self.last_modified_date,
338 project_name: self.project_name,
339 published_by: self.published_by,
340 published_date: self.published_date,
341 description: self.description,
342 name: self.name.ok_or_else(|| {
343 ::aws_smithy_types::error::operation::BuildError::missing_field(
344 "name",
345 "name was not specified but it is required when building DescribeRecipeOutput",
346 )
347 })?,
348 steps: self.steps,
349 tags: self.tags,
350 resource_arn: self.resource_arn,
351 recipe_version: self.recipe_version,
352 _request_id: self._request_id,
353 })
354 }
355}