aws_sdk_imagebuilder/types/
_component_summary.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A high-level summary of a component.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ComponentSummary {
7    /// <p>The Amazon Resource Name (ARN) of the component.</p>
8    pub arn: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the component.</p>
10    pub name: ::std::option::Option<::std::string::String>,
11    /// <p>The version of the component.</p>
12    pub version: ::std::option::Option<::std::string::String>,
13    /// <p>The operating system platform of the component.</p>
14    pub platform: ::std::option::Option<crate::types::Platform>,
15    /// <p>The operating system (OS) version that the component supports. If the OS information is available, Image Builder performs a prefix match against the base image OS version during image recipe creation.</p>
16    pub supported_os_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
17    /// <p>Describes the current status of the component.</p>
18    pub state: ::std::option::Option<crate::types::ComponentState>,
19    /// <p>The component type specifies whether Image Builder uses the component to build the image or only to test it.</p>
20    pub r#type: ::std::option::Option<crate::types::ComponentType>,
21    /// <p>The owner of the component.</p>
22    pub owner: ::std::option::Option<::std::string::String>,
23    /// <p>The description of the component.</p>
24    pub description: ::std::option::Option<::std::string::String>,
25    /// <p>The change description for the current version of the component.</p>
26    pub change_description: ::std::option::Option<::std::string::String>,
27    /// <p>The original creation date of the component.</p>
28    pub date_created: ::std::option::Option<::std::string::String>,
29    /// <p>The tags that apply to the component.</p>
30    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
31    /// <p>Contains the name of the publisher if this is a third-party component. Otherwise, this property is empty.</p>
32    pub publisher: ::std::option::Option<::std::string::String>,
33    /// <p>Indicates whether component source is hidden from view in the console, and from component detail results for API, CLI, or SDK operations.</p>
34    pub obfuscate: bool,
35}
36impl ComponentSummary {
37    /// <p>The Amazon Resource Name (ARN) of the component.</p>
38    pub fn arn(&self) -> ::std::option::Option<&str> {
39        self.arn.as_deref()
40    }
41    /// <p>The name of the component.</p>
42    pub fn name(&self) -> ::std::option::Option<&str> {
43        self.name.as_deref()
44    }
45    /// <p>The version of the component.</p>
46    pub fn version(&self) -> ::std::option::Option<&str> {
47        self.version.as_deref()
48    }
49    /// <p>The operating system platform of the component.</p>
50    pub fn platform(&self) -> ::std::option::Option<&crate::types::Platform> {
51        self.platform.as_ref()
52    }
53    /// <p>The operating system (OS) version that the component supports. If the OS information is available, Image Builder performs a prefix match against the base image OS version during image recipe creation.</p>
54    ///
55    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.supported_os_versions.is_none()`.
56    pub fn supported_os_versions(&self) -> &[::std::string::String] {
57        self.supported_os_versions.as_deref().unwrap_or_default()
58    }
59    /// <p>Describes the current status of the component.</p>
60    pub fn state(&self) -> ::std::option::Option<&crate::types::ComponentState> {
61        self.state.as_ref()
62    }
63    /// <p>The component type specifies whether Image Builder uses the component to build the image or only to test it.</p>
64    pub fn r#type(&self) -> ::std::option::Option<&crate::types::ComponentType> {
65        self.r#type.as_ref()
66    }
67    /// <p>The owner of the component.</p>
68    pub fn owner(&self) -> ::std::option::Option<&str> {
69        self.owner.as_deref()
70    }
71    /// <p>The description of the component.</p>
72    pub fn description(&self) -> ::std::option::Option<&str> {
73        self.description.as_deref()
74    }
75    /// <p>The change description for the current version of the component.</p>
76    pub fn change_description(&self) -> ::std::option::Option<&str> {
77        self.change_description.as_deref()
78    }
79    /// <p>The original creation date of the component.</p>
80    pub fn date_created(&self) -> ::std::option::Option<&str> {
81        self.date_created.as_deref()
82    }
83    /// <p>The tags that apply to the component.</p>
84    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
85        self.tags.as_ref()
86    }
87    /// <p>Contains the name of the publisher if this is a third-party component. Otherwise, this property is empty.</p>
88    pub fn publisher(&self) -> ::std::option::Option<&str> {
89        self.publisher.as_deref()
90    }
91    /// <p>Indicates whether component source is hidden from view in the console, and from component detail results for API, CLI, or SDK operations.</p>
92    pub fn obfuscate(&self) -> bool {
93        self.obfuscate
94    }
95}
96impl ComponentSummary {
97    /// Creates a new builder-style object to manufacture [`ComponentSummary`](crate::types::ComponentSummary).
98    pub fn builder() -> crate::types::builders::ComponentSummaryBuilder {
99        crate::types::builders::ComponentSummaryBuilder::default()
100    }
101}
102
103/// A builder for [`ComponentSummary`](crate::types::ComponentSummary).
104#[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    /// <p>The Amazon Resource Name (ARN) of the component.</p>
124    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    /// <p>The Amazon Resource Name (ARN) of the component.</p>
129    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.arn = input;
131        self
132    }
133    /// <p>The Amazon Resource Name (ARN) of the component.</p>
134    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
135        &self.arn
136    }
137    /// <p>The name of the component.</p>
138    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    /// <p>The name of the component.</p>
143    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.name = input;
145        self
146    }
147    /// <p>The name of the component.</p>
148    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
149        &self.name
150    }
151    /// <p>The version of the component.</p>
152    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    /// <p>The version of the component.</p>
157    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.version = input;
159        self
160    }
161    /// <p>The version of the component.</p>
162    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
163        &self.version
164    }
165    /// <p>The operating system platform of the component.</p>
166    pub fn platform(mut self, input: crate::types::Platform) -> Self {
167        self.platform = ::std::option::Option::Some(input);
168        self
169    }
170    /// <p>The operating system platform of the component.</p>
171    pub fn set_platform(mut self, input: ::std::option::Option<crate::types::Platform>) -> Self {
172        self.platform = input;
173        self
174    }
175    /// <p>The operating system platform of the component.</p>
176    pub fn get_platform(&self) -> &::std::option::Option<crate::types::Platform> {
177        &self.platform
178    }
179    /// Appends an item to `supported_os_versions`.
180    ///
181    /// To override the contents of this collection use [`set_supported_os_versions`](Self::set_supported_os_versions).
182    ///
183    /// <p>The operating system (OS) version that the component supports. If the OS information is available, Image Builder performs a prefix match against the base image OS version during image recipe creation.</p>
184    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    /// <p>The operating system (OS) version that the component supports. If the OS information is available, Image Builder performs a prefix match against the base image OS version during image recipe creation.</p>
191    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    /// <p>The operating system (OS) version that the component supports. If the OS information is available, Image Builder performs a prefix match against the base image OS version during image recipe creation.</p>
196    pub fn get_supported_os_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
197        &self.supported_os_versions
198    }
199    /// <p>Describes the current status of the component.</p>
200    pub fn state(mut self, input: crate::types::ComponentState) -> Self {
201        self.state = ::std::option::Option::Some(input);
202        self
203    }
204    /// <p>Describes the current status of the component.</p>
205    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ComponentState>) -> Self {
206        self.state = input;
207        self
208    }
209    /// <p>Describes the current status of the component.</p>
210    pub fn get_state(&self) -> &::std::option::Option<crate::types::ComponentState> {
211        &self.state
212    }
213    /// <p>The component type specifies whether Image Builder uses the component to build the image or only to test it.</p>
214    pub fn r#type(mut self, input: crate::types::ComponentType) -> Self {
215        self.r#type = ::std::option::Option::Some(input);
216        self
217    }
218    /// <p>The component type specifies whether Image Builder uses the component to build the image or only to test it.</p>
219    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ComponentType>) -> Self {
220        self.r#type = input;
221        self
222    }
223    /// <p>The component type specifies whether Image Builder uses the component to build the image or only to test it.</p>
224    pub fn get_type(&self) -> &::std::option::Option<crate::types::ComponentType> {
225        &self.r#type
226    }
227    /// <p>The owner of the component.</p>
228    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    /// <p>The owner of the component.</p>
233    pub fn set_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234        self.owner = input;
235        self
236    }
237    /// <p>The owner of the component.</p>
238    pub fn get_owner(&self) -> &::std::option::Option<::std::string::String> {
239        &self.owner
240    }
241    /// <p>The description of the component.</p>
242    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    /// <p>The description of the component.</p>
247    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
248        self.description = input;
249        self
250    }
251    /// <p>The description of the component.</p>
252    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
253        &self.description
254    }
255    /// <p>The change description for the current version of the component.</p>
256    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    /// <p>The change description for the current version of the component.</p>
261    pub fn set_change_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
262        self.change_description = input;
263        self
264    }
265    /// <p>The change description for the current version of the component.</p>
266    pub fn get_change_description(&self) -> &::std::option::Option<::std::string::String> {
267        &self.change_description
268    }
269    /// <p>The original creation date of the component.</p>
270    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    /// <p>The original creation date of the component.</p>
275    pub fn set_date_created(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
276        self.date_created = input;
277        self
278    }
279    /// <p>The original creation date of the component.</p>
280    pub fn get_date_created(&self) -> &::std::option::Option<::std::string::String> {
281        &self.date_created
282    }
283    /// Adds a key-value pair to `tags`.
284    ///
285    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
286    ///
287    /// <p>The tags that apply to the component.</p>
288    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    /// <p>The tags that apply to the component.</p>
295    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    /// <p>The tags that apply to the component.</p>
300    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
301        &self.tags
302    }
303    /// <p>Contains the name of the publisher if this is a third-party component. Otherwise, this property is empty.</p>
304    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    /// <p>Contains the name of the publisher if this is a third-party component. Otherwise, this property is empty.</p>
309    pub fn set_publisher(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
310        self.publisher = input;
311        self
312    }
313    /// <p>Contains the name of the publisher if this is a third-party component. Otherwise, this property is empty.</p>
314    pub fn get_publisher(&self) -> &::std::option::Option<::std::string::String> {
315        &self.publisher
316    }
317    /// <p>Indicates whether component source is hidden from view in the console, and from component detail results for API, CLI, or SDK operations.</p>
318    pub fn obfuscate(mut self, input: bool) -> Self {
319        self.obfuscate = ::std::option::Option::Some(input);
320        self
321    }
322    /// <p>Indicates whether component source is hidden from view in the console, and from component detail results for API, CLI, or SDK operations.</p>
323    pub fn set_obfuscate(mut self, input: ::std::option::Option<bool>) -> Self {
324        self.obfuscate = input;
325        self
326    }
327    /// <p>Indicates whether component source is hidden from view in the console, and from component detail results for API, CLI, or SDK operations.</p>
328    pub fn get_obfuscate(&self) -> &::std::option::Option<bool> {
329        &self.obfuscate
330    }
331    /// Consumes the builder and constructs a [`ComponentSummary`](crate::types::ComponentSummary).
332    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}