aws_sdk_databrew/operation/update_recipe/
_update_recipe_input.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 UpdateRecipeInput {
6    /// <p>A description of the recipe.</p>
7    pub description: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the recipe to be updated.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>One or more steps to be performed by the recipe. Each step consists of an action, and the conditions under which the action should succeed.</p>
11    pub steps: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>,
12}
13impl UpdateRecipeInput {
14    /// <p>A description of the recipe.</p>
15    pub fn description(&self) -> ::std::option::Option<&str> {
16        self.description.as_deref()
17    }
18    /// <p>The name of the recipe to be updated.</p>
19    pub fn name(&self) -> ::std::option::Option<&str> {
20        self.name.as_deref()
21    }
22    /// <p>One or more steps to be performed by the recipe. Each step consists of an action, and the conditions under which the action should succeed.</p>
23    ///
24    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.steps.is_none()`.
25    pub fn steps(&self) -> &[crate::types::RecipeStep] {
26        self.steps.as_deref().unwrap_or_default()
27    }
28}
29impl UpdateRecipeInput {
30    /// Creates a new builder-style object to manufacture [`UpdateRecipeInput`](crate::operation::update_recipe::UpdateRecipeInput).
31    pub fn builder() -> crate::operation::update_recipe::builders::UpdateRecipeInputBuilder {
32        crate::operation::update_recipe::builders::UpdateRecipeInputBuilder::default()
33    }
34}
35
36/// A builder for [`UpdateRecipeInput`](crate::operation::update_recipe::UpdateRecipeInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct UpdateRecipeInputBuilder {
40    pub(crate) description: ::std::option::Option<::std::string::String>,
41    pub(crate) name: ::std::option::Option<::std::string::String>,
42    pub(crate) steps: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>,
43}
44impl UpdateRecipeInputBuilder {
45    /// <p>A description of the recipe.</p>
46    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.description = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>A description of the recipe.</p>
51    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.description = input;
53        self
54    }
55    /// <p>A description of the recipe.</p>
56    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
57        &self.description
58    }
59    /// <p>The name of the recipe to be updated.</p>
60    /// This field is required.
61    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name of the recipe to be updated.</p>
66    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.name = input;
68        self
69    }
70    /// <p>The name of the recipe to be updated.</p>
71    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.name
73    }
74    /// Appends an item to `steps`.
75    ///
76    /// To override the contents of this collection use [`set_steps`](Self::set_steps).
77    ///
78    /// <p>One or more steps to be performed by the recipe. Each step consists of an action, and the conditions under which the action should succeed.</p>
79    pub fn steps(mut self, input: crate::types::RecipeStep) -> Self {
80        let mut v = self.steps.unwrap_or_default();
81        v.push(input);
82        self.steps = ::std::option::Option::Some(v);
83        self
84    }
85    /// <p>One or more steps to be performed by the recipe. Each step consists of an action, and the conditions under which the action should succeed.</p>
86    pub fn set_steps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>) -> Self {
87        self.steps = input;
88        self
89    }
90    /// <p>One or more steps to be performed by the recipe. Each step consists of an action, and the conditions under which the action should succeed.</p>
91    pub fn get_steps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>> {
92        &self.steps
93    }
94    /// Consumes the builder and constructs a [`UpdateRecipeInput`](crate::operation::update_recipe::UpdateRecipeInput).
95    pub fn build(
96        self,
97    ) -> ::std::result::Result<crate::operation::update_recipe::UpdateRecipeInput, ::aws_smithy_types::error::operation::BuildError> {
98        ::std::result::Result::Ok(crate::operation::update_recipe::UpdateRecipeInput {
99            description: self.description,
100            name: self.name,
101            steps: self.steps,
102        })
103    }
104}