Skip to main content

aws_sdk_databrew/operation/batch_delete_recipe_version/
_batch_delete_recipe_version_output.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 BatchDeleteRecipeVersionOutput {
6    /// <p>The name of the recipe that was modified.</p>
7    pub name: ::std::string::String,
8    /// <p>Errors, if any, that occurred while attempting to delete the recipe versions.</p>
9    pub errors: ::std::option::Option<::std::vec::Vec<crate::types::RecipeVersionErrorDetail>>,
10    _request_id: Option<String>,
11}
12impl BatchDeleteRecipeVersionOutput {
13    /// <p>The name of the recipe that was modified.</p>
14    pub fn name(&self) -> &str {
15        use std::ops::Deref;
16        self.name.deref()
17    }
18    /// <p>Errors, if any, that occurred while attempting to delete the recipe versions.</p>
19    ///
20    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.errors.is_none()`.
21    pub fn errors(&self) -> &[crate::types::RecipeVersionErrorDetail] {
22        self.errors.as_deref().unwrap_or_default()
23    }
24}
25impl ::aws_types::request_id::RequestId for BatchDeleteRecipeVersionOutput {
26    fn request_id(&self) -> Option<&str> {
27        self._request_id.as_deref()
28    }
29}
30impl BatchDeleteRecipeVersionOutput {
31    /// Creates a new builder-style object to manufacture [`BatchDeleteRecipeVersionOutput`](crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionOutput).
32    pub fn builder() -> crate::operation::batch_delete_recipe_version::builders::BatchDeleteRecipeVersionOutputBuilder {
33        crate::operation::batch_delete_recipe_version::builders::BatchDeleteRecipeVersionOutputBuilder::default()
34    }
35}
36
37/// A builder for [`BatchDeleteRecipeVersionOutput`](crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionOutput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct BatchDeleteRecipeVersionOutputBuilder {
41    pub(crate) name: ::std::option::Option<::std::string::String>,
42    pub(crate) errors: ::std::option::Option<::std::vec::Vec<crate::types::RecipeVersionErrorDetail>>,
43    _request_id: Option<String>,
44}
45impl BatchDeleteRecipeVersionOutputBuilder {
46    /// <p>The name of the recipe that was modified.</p>
47    /// This field is required.
48    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49        self.name = ::std::option::Option::Some(input.into());
50        self
51    }
52    /// <p>The name of the recipe that was modified.</p>
53    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54        self.name = input;
55        self
56    }
57    /// <p>The name of the recipe that was modified.</p>
58    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
59        &self.name
60    }
61    /// Appends an item to `errors`.
62    ///
63    /// To override the contents of this collection use [`set_errors`](Self::set_errors).
64    ///
65    /// <p>Errors, if any, that occurred while attempting to delete the recipe versions.</p>
66    pub fn errors(mut self, input: crate::types::RecipeVersionErrorDetail) -> Self {
67        let mut v = self.errors.unwrap_or_default();
68        v.push(input);
69        self.errors = ::std::option::Option::Some(v);
70        self
71    }
72    /// <p>Errors, if any, that occurred while attempting to delete the recipe versions.</p>
73    pub fn set_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecipeVersionErrorDetail>>) -> Self {
74        self.errors = input;
75        self
76    }
77    /// <p>Errors, if any, that occurred while attempting to delete the recipe versions.</p>
78    pub fn get_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecipeVersionErrorDetail>> {
79        &self.errors
80    }
81    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
82        self._request_id = Some(request_id.into());
83        self
84    }
85
86    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
87        self._request_id = request_id;
88        self
89    }
90    /// Consumes the builder and constructs a [`BatchDeleteRecipeVersionOutput`](crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionOutput).
91    /// This method will fail if any of the following fields are not set:
92    /// - [`name`](crate::operation::batch_delete_recipe_version::builders::BatchDeleteRecipeVersionOutputBuilder::name)
93    pub fn build(
94        self,
95    ) -> ::std::result::Result<
96        crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionOutput,
97        ::aws_smithy_types::error::operation::BuildError,
98    > {
99        ::std::result::Result::Ok(crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionOutput {
100            name: self.name.ok_or_else(|| {
101                ::aws_smithy_types::error::operation::BuildError::missing_field(
102                    "name",
103                    "name was not specified but it is required when building BatchDeleteRecipeVersionOutput",
104                )
105            })?,
106            errors: self.errors,
107            _request_id: self._request_id,
108        })
109    }
110}