aws_sdk_databrew/operation/batch_delete_recipe_version/
_batch_delete_recipe_version_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct BatchDeleteRecipeVersionOutput {
6 pub name: ::std::string::String,
8 pub errors: ::std::option::Option<::std::vec::Vec<crate::types::RecipeVersionErrorDetail>>,
10 _request_id: Option<String>,
11}
12impl BatchDeleteRecipeVersionOutput {
13 pub fn name(&self) -> &str {
15 use std::ops::Deref;
16 self.name.deref()
17 }
18 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 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#[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 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54 self.name = input;
55 self
56 }
57 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
59 &self.name
60 }
61 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 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 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 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}