aws_sdk_databrew/operation/publish_recipe/
_publish_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 PublishRecipeInput {
6    /// <p>A description of the recipe to be published, for this version of the recipe.</p>
7    pub description: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the recipe to be published.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10}
11impl PublishRecipeInput {
12    /// <p>A description of the recipe to be published, for this version of the recipe.</p>
13    pub fn description(&self) -> ::std::option::Option<&str> {
14        self.description.as_deref()
15    }
16    /// <p>The name of the recipe to be published.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20}
21impl PublishRecipeInput {
22    /// Creates a new builder-style object to manufacture [`PublishRecipeInput`](crate::operation::publish_recipe::PublishRecipeInput).
23    pub fn builder() -> crate::operation::publish_recipe::builders::PublishRecipeInputBuilder {
24        crate::operation::publish_recipe::builders::PublishRecipeInputBuilder::default()
25    }
26}
27
28/// A builder for [`PublishRecipeInput`](crate::operation::publish_recipe::PublishRecipeInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct PublishRecipeInputBuilder {
32    pub(crate) description: ::std::option::Option<::std::string::String>,
33    pub(crate) name: ::std::option::Option<::std::string::String>,
34}
35impl PublishRecipeInputBuilder {
36    /// <p>A description of the recipe to be published, for this version of the recipe.</p>
37    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
38        self.description = ::std::option::Option::Some(input.into());
39        self
40    }
41    /// <p>A description of the recipe to be published, for this version of the recipe.</p>
42    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
43        self.description = input;
44        self
45    }
46    /// <p>A description of the recipe to be published, for this version of the recipe.</p>
47    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
48        &self.description
49    }
50    /// <p>The name of the recipe to be published.</p>
51    /// This field is required.
52    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The name of the recipe to be published.</p>
57    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.name = input;
59        self
60    }
61    /// <p>The name of the recipe to be published.</p>
62    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.name
64    }
65    /// Consumes the builder and constructs a [`PublishRecipeInput`](crate::operation::publish_recipe::PublishRecipeInput).
66    pub fn build(
67        self,
68    ) -> ::std::result::Result<crate::operation::publish_recipe::PublishRecipeInput, ::aws_smithy_types::error::operation::BuildError> {
69        ::std::result::Result::Ok(crate::operation::publish_recipe::PublishRecipeInput {
70            description: self.description,
71            name: self.name,
72        })
73    }
74}