Skip to main content

aws_sdk_glue/types/
_recipe_reference.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A reference to a Glue DataBrew recipe.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RecipeReference {
7    /// <p>The ARN of the DataBrew recipe.</p>
8    pub recipe_arn: ::std::string::String,
9    /// <p>The RecipeVersion of the DataBrew recipe.</p>
10    pub recipe_version: ::std::string::String,
11}
12impl RecipeReference {
13    /// <p>The ARN of the DataBrew recipe.</p>
14    pub fn recipe_arn(&self) -> &str {
15        use std::ops::Deref;
16        self.recipe_arn.deref()
17    }
18    /// <p>The RecipeVersion of the DataBrew recipe.</p>
19    pub fn recipe_version(&self) -> &str {
20        use std::ops::Deref;
21        self.recipe_version.deref()
22    }
23}
24impl RecipeReference {
25    /// Creates a new builder-style object to manufacture [`RecipeReference`](crate::types::RecipeReference).
26    pub fn builder() -> crate::types::builders::RecipeReferenceBuilder {
27        crate::types::builders::RecipeReferenceBuilder::default()
28    }
29}
30
31/// A builder for [`RecipeReference`](crate::types::RecipeReference).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct RecipeReferenceBuilder {
35    pub(crate) recipe_arn: ::std::option::Option<::std::string::String>,
36    pub(crate) recipe_version: ::std::option::Option<::std::string::String>,
37}
38impl RecipeReferenceBuilder {
39    /// <p>The ARN of the DataBrew recipe.</p>
40    /// This field is required.
41    pub fn recipe_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
42        self.recipe_arn = ::std::option::Option::Some(input.into());
43        self
44    }
45    /// <p>The ARN of the DataBrew recipe.</p>
46    pub fn set_recipe_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
47        self.recipe_arn = input;
48        self
49    }
50    /// <p>The ARN of the DataBrew recipe.</p>
51    pub fn get_recipe_arn(&self) -> &::std::option::Option<::std::string::String> {
52        &self.recipe_arn
53    }
54    /// <p>The RecipeVersion of the DataBrew recipe.</p>
55    /// This field is required.
56    pub fn recipe_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57        self.recipe_version = ::std::option::Option::Some(input.into());
58        self
59    }
60    /// <p>The RecipeVersion of the DataBrew recipe.</p>
61    pub fn set_recipe_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62        self.recipe_version = input;
63        self
64    }
65    /// <p>The RecipeVersion of the DataBrew recipe.</p>
66    pub fn get_recipe_version(&self) -> &::std::option::Option<::std::string::String> {
67        &self.recipe_version
68    }
69    /// Consumes the builder and constructs a [`RecipeReference`](crate::types::RecipeReference).
70    /// This method will fail if any of the following fields are not set:
71    /// - [`recipe_arn`](crate::types::builders::RecipeReferenceBuilder::recipe_arn)
72    /// - [`recipe_version`](crate::types::builders::RecipeReferenceBuilder::recipe_version)
73    pub fn build(self) -> ::std::result::Result<crate::types::RecipeReference, ::aws_smithy_types::error::operation::BuildError> {
74        ::std::result::Result::Ok(crate::types::RecipeReference {
75            recipe_arn: self.recipe_arn.ok_or_else(|| {
76                ::aws_smithy_types::error::operation::BuildError::missing_field(
77                    "recipe_arn",
78                    "recipe_arn was not specified but it is required when building RecipeReference",
79                )
80            })?,
81            recipe_version: self.recipe_version.ok_or_else(|| {
82                ::aws_smithy_types::error::operation::BuildError::missing_field(
83                    "recipe_version",
84                    "recipe_version was not specified but it is required when building RecipeReference",
85                )
86            })?,
87        })
88    }
89}