aws_sdk_greengrassv2/operation/get_component/
_get_component_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetComponentOutput {
6 pub recipe_output_format: crate::types::RecipeOutputFormat,
8 pub recipe: ::aws_smithy_types::Blob,
10 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12 _request_id: Option<String>,
13}
14impl GetComponentOutput {
15 pub fn recipe_output_format(&self) -> &crate::types::RecipeOutputFormat {
17 &self.recipe_output_format
18 }
19 pub fn recipe(&self) -> &::aws_smithy_types::Blob {
21 &self.recipe
22 }
23 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
25 self.tags.as_ref()
26 }
27}
28impl ::aws_types::request_id::RequestId for GetComponentOutput {
29 fn request_id(&self) -> Option<&str> {
30 self._request_id.as_deref()
31 }
32}
33impl GetComponentOutput {
34 pub fn builder() -> crate::operation::get_component::builders::GetComponentOutputBuilder {
36 crate::operation::get_component::builders::GetComponentOutputBuilder::default()
37 }
38}
39
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct GetComponentOutputBuilder {
44 pub(crate) recipe_output_format: ::std::option::Option<crate::types::RecipeOutputFormat>,
45 pub(crate) recipe: ::std::option::Option<::aws_smithy_types::Blob>,
46 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
47 _request_id: Option<String>,
48}
49impl GetComponentOutputBuilder {
50 pub fn recipe_output_format(mut self, input: crate::types::RecipeOutputFormat) -> Self {
53 self.recipe_output_format = ::std::option::Option::Some(input);
54 self
55 }
56 pub fn set_recipe_output_format(mut self, input: ::std::option::Option<crate::types::RecipeOutputFormat>) -> Self {
58 self.recipe_output_format = input;
59 self
60 }
61 pub fn get_recipe_output_format(&self) -> &::std::option::Option<crate::types::RecipeOutputFormat> {
63 &self.recipe_output_format
64 }
65 pub fn recipe(mut self, input: ::aws_smithy_types::Blob) -> Self {
68 self.recipe = ::std::option::Option::Some(input);
69 self
70 }
71 pub fn set_recipe(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
73 self.recipe = input;
74 self
75 }
76 pub fn get_recipe(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
78 &self.recipe
79 }
80 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
86 let mut hash_map = self.tags.unwrap_or_default();
87 hash_map.insert(k.into(), v.into());
88 self.tags = ::std::option::Option::Some(hash_map);
89 self
90 }
91 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
93 self.tags = input;
94 self
95 }
96 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
98 &self.tags
99 }
100 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
101 self._request_id = Some(request_id.into());
102 self
103 }
104
105 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
106 self._request_id = request_id;
107 self
108 }
109 pub fn build(
114 self,
115 ) -> ::std::result::Result<crate::operation::get_component::GetComponentOutput, ::aws_smithy_types::error::operation::BuildError> {
116 ::std::result::Result::Ok(crate::operation::get_component::GetComponentOutput {
117 recipe_output_format: self.recipe_output_format.ok_or_else(|| {
118 ::aws_smithy_types::error::operation::BuildError::missing_field(
119 "recipe_output_format",
120 "recipe_output_format was not specified but it is required when building GetComponentOutput",
121 )
122 })?,
123 recipe: self.recipe.ok_or_else(|| {
124 ::aws_smithy_types::error::operation::BuildError::missing_field(
125 "recipe",
126 "recipe was not specified but it is required when building GetComponentOutput",
127 )
128 })?,
129 tags: self.tags,
130 _request_id: self._request_id,
131 })
132 }
133}