aws_sdk_databrew/operation/create_recipe/
_create_recipe_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateRecipeInput {
6 pub description: ::std::option::Option<::std::string::String>,
8 pub name: ::std::option::Option<::std::string::String>,
10 pub steps: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>,
12 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl CreateRecipeInput {
16 pub fn description(&self) -> ::std::option::Option<&str> {
18 self.description.as_deref()
19 }
20 pub fn name(&self) -> ::std::option::Option<&str> {
22 self.name.as_deref()
23 }
24 pub fn steps(&self) -> &[crate::types::RecipeStep] {
28 self.steps.as_deref().unwrap_or_default()
29 }
30 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
32 self.tags.as_ref()
33 }
34}
35impl CreateRecipeInput {
36 pub fn builder() -> crate::operation::create_recipe::builders::CreateRecipeInputBuilder {
38 crate::operation::create_recipe::builders::CreateRecipeInputBuilder::default()
39 }
40}
41
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateRecipeInputBuilder {
46 pub(crate) description: ::std::option::Option<::std::string::String>,
47 pub(crate) name: ::std::option::Option<::std::string::String>,
48 pub(crate) steps: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>,
49 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
50}
51impl CreateRecipeInputBuilder {
52 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54 self.description = ::std::option::Option::Some(input.into());
55 self
56 }
57 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59 self.description = input;
60 self
61 }
62 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
64 &self.description
65 }
66 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69 self.name = ::std::option::Option::Some(input.into());
70 self
71 }
72 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74 self.name = input;
75 self
76 }
77 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
79 &self.name
80 }
81 pub fn steps(mut self, input: crate::types::RecipeStep) -> Self {
87 let mut v = self.steps.unwrap_or_default();
88 v.push(input);
89 self.steps = ::std::option::Option::Some(v);
90 self
91 }
92 pub fn set_steps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>) -> Self {
94 self.steps = input;
95 self
96 }
97 pub fn get_steps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>> {
99 &self.steps
100 }
101 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
107 let mut hash_map = self.tags.unwrap_or_default();
108 hash_map.insert(k.into(), v.into());
109 self.tags = ::std::option::Option::Some(hash_map);
110 self
111 }
112 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
114 self.tags = input;
115 self
116 }
117 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
119 &self.tags
120 }
121 pub fn build(
123 self,
124 ) -> ::std::result::Result<crate::operation::create_recipe::CreateRecipeInput, ::aws_smithy_types::error::operation::BuildError> {
125 ::std::result::Result::Ok(crate::operation::create_recipe::CreateRecipeInput {
126 description: self.description,
127 name: self.name,
128 steps: self.steps,
129 tags: self.tags,
130 })
131 }
132}