aws_sdk_imagebuilder/types/
_component_summary.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ComponentSummary {
7 pub arn: ::std::option::Option<::std::string::String>,
9 pub name: ::std::option::Option<::std::string::String>,
11 pub version: ::std::option::Option<::std::string::String>,
13 pub platform: ::std::option::Option<crate::types::Platform>,
15 pub supported_os_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
17 pub state: ::std::option::Option<crate::types::ComponentState>,
19 pub r#type: ::std::option::Option<crate::types::ComponentType>,
21 pub owner: ::std::option::Option<::std::string::String>,
23 pub description: ::std::option::Option<::std::string::String>,
25 pub change_description: ::std::option::Option<::std::string::String>,
27 pub date_created: ::std::option::Option<::std::string::String>,
29 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
31 pub publisher: ::std::option::Option<::std::string::String>,
33 pub obfuscate: bool,
35}
36impl ComponentSummary {
37 pub fn arn(&self) -> ::std::option::Option<&str> {
39 self.arn.as_deref()
40 }
41 pub fn name(&self) -> ::std::option::Option<&str> {
43 self.name.as_deref()
44 }
45 pub fn version(&self) -> ::std::option::Option<&str> {
47 self.version.as_deref()
48 }
49 pub fn platform(&self) -> ::std::option::Option<&crate::types::Platform> {
51 self.platform.as_ref()
52 }
53 pub fn supported_os_versions(&self) -> &[::std::string::String] {
57 self.supported_os_versions.as_deref().unwrap_or_default()
58 }
59 pub fn state(&self) -> ::std::option::Option<&crate::types::ComponentState> {
61 self.state.as_ref()
62 }
63 pub fn r#type(&self) -> ::std::option::Option<&crate::types::ComponentType> {
65 self.r#type.as_ref()
66 }
67 pub fn owner(&self) -> ::std::option::Option<&str> {
69 self.owner.as_deref()
70 }
71 pub fn description(&self) -> ::std::option::Option<&str> {
73 self.description.as_deref()
74 }
75 pub fn change_description(&self) -> ::std::option::Option<&str> {
77 self.change_description.as_deref()
78 }
79 pub fn date_created(&self) -> ::std::option::Option<&str> {
81 self.date_created.as_deref()
82 }
83 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
85 self.tags.as_ref()
86 }
87 pub fn publisher(&self) -> ::std::option::Option<&str> {
89 self.publisher.as_deref()
90 }
91 pub fn obfuscate(&self) -> bool {
93 self.obfuscate
94 }
95}
96impl ComponentSummary {
97 pub fn builder() -> crate::types::builders::ComponentSummaryBuilder {
99 crate::types::builders::ComponentSummaryBuilder::default()
100 }
101}
102
103#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
105#[non_exhaustive]
106pub struct ComponentSummaryBuilder {
107 pub(crate) arn: ::std::option::Option<::std::string::String>,
108 pub(crate) name: ::std::option::Option<::std::string::String>,
109 pub(crate) version: ::std::option::Option<::std::string::String>,
110 pub(crate) platform: ::std::option::Option<crate::types::Platform>,
111 pub(crate) supported_os_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
112 pub(crate) state: ::std::option::Option<crate::types::ComponentState>,
113 pub(crate) r#type: ::std::option::Option<crate::types::ComponentType>,
114 pub(crate) owner: ::std::option::Option<::std::string::String>,
115 pub(crate) description: ::std::option::Option<::std::string::String>,
116 pub(crate) change_description: ::std::option::Option<::std::string::String>,
117 pub(crate) date_created: ::std::option::Option<::std::string::String>,
118 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
119 pub(crate) publisher: ::std::option::Option<::std::string::String>,
120 pub(crate) obfuscate: ::std::option::Option<bool>,
121}
122impl ComponentSummaryBuilder {
123 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125 self.arn = ::std::option::Option::Some(input.into());
126 self
127 }
128 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130 self.arn = input;
131 self
132 }
133 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
135 &self.arn
136 }
137 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139 self.name = ::std::option::Option::Some(input.into());
140 self
141 }
142 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144 self.name = input;
145 self
146 }
147 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
149 &self.name
150 }
151 pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153 self.version = ::std::option::Option::Some(input.into());
154 self
155 }
156 pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158 self.version = input;
159 self
160 }
161 pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
163 &self.version
164 }
165 pub fn platform(mut self, input: crate::types::Platform) -> Self {
167 self.platform = ::std::option::Option::Some(input);
168 self
169 }
170 pub fn set_platform(mut self, input: ::std::option::Option<crate::types::Platform>) -> Self {
172 self.platform = input;
173 self
174 }
175 pub fn get_platform(&self) -> &::std::option::Option<crate::types::Platform> {
177 &self.platform
178 }
179 pub fn supported_os_versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185 let mut v = self.supported_os_versions.unwrap_or_default();
186 v.push(input.into());
187 self.supported_os_versions = ::std::option::Option::Some(v);
188 self
189 }
190 pub fn set_supported_os_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
192 self.supported_os_versions = input;
193 self
194 }
195 pub fn get_supported_os_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
197 &self.supported_os_versions
198 }
199 pub fn state(mut self, input: crate::types::ComponentState) -> Self {
201 self.state = ::std::option::Option::Some(input);
202 self
203 }
204 pub fn set_state(mut self, input: ::std::option::Option<crate::types::ComponentState>) -> Self {
206 self.state = input;
207 self
208 }
209 pub fn get_state(&self) -> &::std::option::Option<crate::types::ComponentState> {
211 &self.state
212 }
213 pub fn r#type(mut self, input: crate::types::ComponentType) -> Self {
215 self.r#type = ::std::option::Option::Some(input);
216 self
217 }
218 pub fn set_type(mut self, input: ::std::option::Option<crate::types::ComponentType>) -> Self {
220 self.r#type = input;
221 self
222 }
223 pub fn get_type(&self) -> &::std::option::Option<crate::types::ComponentType> {
225 &self.r#type
226 }
227 pub fn owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229 self.owner = ::std::option::Option::Some(input.into());
230 self
231 }
232 pub fn set_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234 self.owner = input;
235 self
236 }
237 pub fn get_owner(&self) -> &::std::option::Option<::std::string::String> {
239 &self.owner
240 }
241 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
243 self.description = ::std::option::Option::Some(input.into());
244 self
245 }
246 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
248 self.description = input;
249 self
250 }
251 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
253 &self.description
254 }
255 pub fn change_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
257 self.change_description = ::std::option::Option::Some(input.into());
258 self
259 }
260 pub fn set_change_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
262 self.change_description = input;
263 self
264 }
265 pub fn get_change_description(&self) -> &::std::option::Option<::std::string::String> {
267 &self.change_description
268 }
269 pub fn date_created(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
271 self.date_created = ::std::option::Option::Some(input.into());
272 self
273 }
274 pub fn set_date_created(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
276 self.date_created = input;
277 self
278 }
279 pub fn get_date_created(&self) -> &::std::option::Option<::std::string::String> {
281 &self.date_created
282 }
283 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
289 let mut hash_map = self.tags.unwrap_or_default();
290 hash_map.insert(k.into(), v.into());
291 self.tags = ::std::option::Option::Some(hash_map);
292 self
293 }
294 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
296 self.tags = input;
297 self
298 }
299 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
301 &self.tags
302 }
303 pub fn publisher(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
305 self.publisher = ::std::option::Option::Some(input.into());
306 self
307 }
308 pub fn set_publisher(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
310 self.publisher = input;
311 self
312 }
313 pub fn get_publisher(&self) -> &::std::option::Option<::std::string::String> {
315 &self.publisher
316 }
317 pub fn obfuscate(mut self, input: bool) -> Self {
319 self.obfuscate = ::std::option::Option::Some(input);
320 self
321 }
322 pub fn set_obfuscate(mut self, input: ::std::option::Option<bool>) -> Self {
324 self.obfuscate = input;
325 self
326 }
327 pub fn get_obfuscate(&self) -> &::std::option::Option<bool> {
329 &self.obfuscate
330 }
331 pub fn build(self) -> crate::types::ComponentSummary {
333 crate::types::ComponentSummary {
334 arn: self.arn,
335 name: self.name,
336 version: self.version,
337 platform: self.platform,
338 supported_os_versions: self.supported_os_versions,
339 state: self.state,
340 r#type: self.r#type,
341 owner: self.owner,
342 description: self.description,
343 change_description: self.change_description,
344 date_created: self.date_created,
345 tags: self.tags,
346 publisher: self.publisher,
347 obfuscate: self.obfuscate.unwrap_or_default(),
348 }
349 }
350}