1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// <p>Information collected from managed nodes based on your inventory policy document</p>
|
4 + | #[non_exhaustive]
|
5 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 + | pub struct InventoryItem {
|
7 + | /// <p>The name of the inventory type. Default inventory item type names start with <code>AWS</code>. Custom inventory type names will start with Custom. Default inventory item types include the following: <code>AWS:AWSComponent</code>, <code>AWS:Application</code>, <code>AWS:InstanceInformation</code>, <code>AWS:Network</code>, and <code>AWS:WindowsUpdate</code>.</p>
|
8 + | pub type_name: ::std::string::String,
|
9 + | /// <p>The schema version for the inventory item.</p>
|
10 + | pub schema_version: ::std::string::String,
|
11 + | /// <p>The time the inventory information was collected.</p>
|
12 + | pub capture_time: ::std::string::String,
|
13 + | /// <p>MD5 hash of the inventory item type contents. The content hash is used to determine whether to update inventory information. The PutInventory API doesn't update the inventory item type contents if the MD5 hash hasn't changed since last update.</p>
|
14 + | pub content_hash: ::std::option::Option<::std::string::String>,
|
15 + | /// <p>The inventory data of the inventory type.</p>
|
16 + | pub content: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
|
17 + | /// <p>A map of associated properties for a specified inventory type. For example, with this attribute, you can specify the <code>ExecutionId</code>, <code>ExecutionType</code>, <code>ComplianceType</code> properties of the <code>AWS:ComplianceItem</code> type.</p>
|
18 + | pub context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
|
19 + | }
|
20 + | impl InventoryItem {
|
21 + | /// <p>The name of the inventory type. Default inventory item type names start with <code>AWS</code>. Custom inventory type names will start with Custom. Default inventory item types include the following: <code>AWS:AWSComponent</code>, <code>AWS:Application</code>, <code>AWS:InstanceInformation</code>, <code>AWS:Network</code>, and <code>AWS:WindowsUpdate</code>.</p>
|
22 + | pub fn type_name(&self) -> &str {
|
23 + | use std::ops::Deref;
|
24 + | self.type_name.deref()
|
25 + | }
|
26 + | /// <p>The schema version for the inventory item.</p>
|
27 + | pub fn schema_version(&self) -> &str {
|
28 + | use std::ops::Deref;
|
29 + | self.schema_version.deref()
|
30 + | }
|
31 + | /// <p>The time the inventory information was collected.</p>
|
32 + | pub fn capture_time(&self) -> &str {
|
33 + | use std::ops::Deref;
|
34 + | self.capture_time.deref()
|
35 + | }
|
36 + | /// <p>MD5 hash of the inventory item type contents. The content hash is used to determine whether to update inventory information. The PutInventory API doesn't update the inventory item type contents if the MD5 hash hasn't changed since last update.</p>
|
37 + | pub fn content_hash(&self) -> ::std::option::Option<&str> {
|
38 + | self.content_hash.as_deref()
|
39 + | }
|
40 + | /// <p>The inventory data of the inventory type.</p>
|
41 + | ///
|
42 + | /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.content.is_none()`.
|
43 + | pub fn content(&self) -> &[::std::collections::HashMap<::std::string::String, ::std::string::String>] {
|
44 + | self.content.as_deref().unwrap_or_default()
|
45 + | }
|
46 + | /// <p>A map of associated properties for a specified inventory type. For example, with this attribute, you can specify the <code>ExecutionId</code>, <code>ExecutionType</code>, <code>ComplianceType</code> properties of the <code>AWS:ComplianceItem</code> type.</p>
|
47 + | pub fn context(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
|
48 + | self.context.as_ref()
|
49 + | }
|
50 + | }
|
51 + | static INVENTORYITEM_MEMBER_TYPE_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
52 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem$TypeName", "com.amazonaws.ssm", "InventoryItem"),
|
53 + | ::aws_smithy_schema::ShapeType::String,
|
54 + | "TypeName",
|
55 + | 0,
|
56 + | );
|
57 + | static INVENTORYITEM_MEMBER_SCHEMA_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
58 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem$SchemaVersion", "com.amazonaws.ssm", "InventoryItem"),
|
59 + | ::aws_smithy_schema::ShapeType::String,
|
60 + | "SchemaVersion",
|
61 + | 1,
|
62 + | );
|
63 + | static INVENTORYITEM_MEMBER_CAPTURE_TIME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
64 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem$CaptureTime", "com.amazonaws.ssm", "InventoryItem"),
|
65 + | ::aws_smithy_schema::ShapeType::String,
|
66 + | "CaptureTime",
|
67 + | 2,
|
68 + | );
|
69 + | static INVENTORYITEM_MEMBER_CONTENT_HASH: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
70 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem$ContentHash", "com.amazonaws.ssm", "InventoryItem"),
|
71 + | ::aws_smithy_schema::ShapeType::String,
|
72 + | "ContentHash",
|
73 + | 3,
|
74 + | );
|
75 + | static INVENTORYITEM_MEMBER_CONTENT_MEMBER_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
76 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItemEntry$key", "com.amazonaws.ssm", "InventoryItemEntry"),
|
77 + | ::aws_smithy_schema::ShapeType::String,
|
78 + | "key",
|
79 + | 0,
|
80 + | );
|
81 + | static INVENTORYITEM_MEMBER_CONTENT_MEMBER_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
82 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItemEntry$value", "com.amazonaws.ssm", "InventoryItemEntry"),
|
83 + | ::aws_smithy_schema::ShapeType::String,
|
84 + | "value",
|
85 + | 1,
|
86 + | );
|
87 + | static INVENTORYITEM_MEMBER_CONTENT_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
88 + | ::aws_smithy_schema::ShapeId::from_parts(
|
89 + | "com.amazonaws.ssm#InventoryItemEntryList$member",
|
90 + | "com.amazonaws.ssm",
|
91 + | "InventoryItemEntryList",
|
92 + | ),
|
93 + | ::aws_smithy_schema::ShapeType::Map,
|
94 + | "member",
|
95 + | 0,
|
96 + | )
|
97 + | .with_map_members(&INVENTORYITEM_MEMBER_CONTENT_MEMBER_KEY, &INVENTORYITEM_MEMBER_CONTENT_MEMBER_VALUE);
|
98 + | static INVENTORYITEM_MEMBER_CONTENT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
99 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem$Content", "com.amazonaws.ssm", "InventoryItem"),
|
100 + | ::aws_smithy_schema::ShapeType::List,
|
101 + | "Content",
|
102 + | 4,
|
103 + | )
|
104 + | .with_list_member(&INVENTORYITEM_MEMBER_CONTENT_MEMBER);
|
105 + | static INVENTORYITEM_MEMBER_CONTEXT_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
106 + | ::aws_smithy_schema::ShapeId::from_parts(
|
107 + | "com.amazonaws.ssm#InventoryItemContentContext$key",
|
108 + | "com.amazonaws.ssm",
|
109 + | "InventoryItemContentContext",
|
110 + | ),
|
111 + | ::aws_smithy_schema::ShapeType::String,
|
112 + | "key",
|
113 + | 0,
|
114 + | );
|
115 + | static INVENTORYITEM_MEMBER_CONTEXT_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
116 + | ::aws_smithy_schema::ShapeId::from_parts(
|
117 + | "com.amazonaws.ssm#InventoryItemContentContext$value",
|
118 + | "com.amazonaws.ssm",
|
119 + | "InventoryItemContentContext",
|
120 + | ),
|
121 + | ::aws_smithy_schema::ShapeType::String,
|
122 + | "value",
|
123 + | 1,
|
124 + | );
|
125 + | static INVENTORYITEM_MEMBER_CONTEXT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
126 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem$Context", "com.amazonaws.ssm", "InventoryItem"),
|
127 + | ::aws_smithy_schema::ShapeType::Map,
|
128 + | "Context",
|
129 + | 5,
|
130 + | )
|
131 + | .with_map_members(&INVENTORYITEM_MEMBER_CONTEXT_KEY, &INVENTORYITEM_MEMBER_CONTEXT_VALUE);
|
132 + | static INVENTORYITEM_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
|
133 + | ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem", "com.amazonaws.ssm", "InventoryItem"),
|
134 + | ::aws_smithy_schema::ShapeType::Structure,
|
135 + | &[
|
136 + | &INVENTORYITEM_MEMBER_TYPE_NAME,
|
137 + | &INVENTORYITEM_MEMBER_SCHEMA_VERSION,
|
138 + | &INVENTORYITEM_MEMBER_CAPTURE_TIME,
|
139 + | &INVENTORYITEM_MEMBER_CONTENT_HASH,
|
140 + | &INVENTORYITEM_MEMBER_CONTENT,
|
141 + | &INVENTORYITEM_MEMBER_CONTEXT,
|
142 + | ],
|
143 + | );
|
144 + | impl InventoryItem {
|
145 + | /// The schema for this shape.
|
146 + | pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &INVENTORYITEM_SCHEMA;
|
147 + | }
|
148 + | impl ::aws_smithy_schema::serde::SerializableStruct for InventoryItem {
|
149 + | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
150 + | fn serialize_members(
|
151 + | &self,
|
152 + | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
153 + | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
154 + | {
|
155 + | let val = &self.type_name;
|
156 + | ser.write_string(&INVENTORYITEM_MEMBER_TYPE_NAME, val)?;
|
157 + | }
|
158 + | {
|
159 + | let val = &self.schema_version;
|
160 + | ser.write_string(&INVENTORYITEM_MEMBER_SCHEMA_VERSION, val)?;
|
161 + | }
|
162 + | {
|
163 + | let val = &self.capture_time;
|
164 + | ser.write_string(&INVENTORYITEM_MEMBER_CAPTURE_TIME, val)?;
|
165 + | }
|
166 + | if let Some(ref val) = self.content_hash {
|
167 + | ser.write_string(&INVENTORYITEM_MEMBER_CONTENT_HASH, val)?;
|
168 + | }
|
169 + | if let Some(ref val) = self.content {
|
170 + | ser.write_list(
|
171 + | &INVENTORYITEM_MEMBER_CONTENT,
|
172 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
173 + | for item in val {
|
174 + | ser.write_map(
|
175 + | &INVENTORYITEM_MEMBER_CONTENT_MEMBER,
|
176 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
177 + | for (key, value) in item {
|
178 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
179 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
|
180 + | }
|
181 + | Ok(())
|
182 + | },
|
183 + | )?;
|
184 + | }
|
185 + | Ok(())
|
186 + | },
|
187 + | )?;
|
188 + | }
|
189 + | if let Some(ref val) = self.context {
|
190 + | ser.write_map(
|
191 + | &INVENTORYITEM_MEMBER_CONTEXT,
|
192 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
193 + | for (key, value) in val {
|
194 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
195 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
|
196 + | }
|
197 + | Ok(())
|
198 + | },
|
199 + | )?;
|
200 + | }
|
201 + | Ok(())
|
202 + | }
|
203 + | }
|
204 + | impl InventoryItem {
|
205 + | /// Deserializes this structure from a [`ShapeDeserializer`].
|
206 + | pub fn deserialize(
|
207 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
208 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
209 + | #[allow(unused_variables, unused_mut)]
|
210 + | let mut builder = Self::builder();
|
211 + | #[allow(
|
212 + | unused_variables,
|
213 + | unreachable_code,
|
214 + | clippy::single_match,
|
215 + | clippy::match_single_binding,
|
216 + | clippy::diverging_sub_expression
|
217 + | )]
|
218 + | deserializer.read_struct(&INVENTORYITEM_SCHEMA, &mut |member, deser| {
|
219 + | match member.member_index() {
|
220 + | Some(0) => {
|
221 + | builder.type_name = Some(deser.read_string(member)?);
|
222 + | }
|
223 + | Some(1) => {
|
224 + | builder.schema_version = Some(deser.read_string(member)?);
|
225 + | }
|
226 + | Some(2) => {
|
227 + | builder.capture_time = Some(deser.read_string(member)?);
|
228 + | }
|
229 + | Some(3) => {
|
230 + | if deser.is_null() {
|
231 + | deser.read_null()?;
|
232 + | } else {
|
233 + | builder.content_hash = Some(deser.read_string(member)?);
|
234 + | }
|
235 + | }
|
236 + | Some(4) => {
|
237 + | if deser.is_null() {
|
238 + | deser.read_null()?;
|
239 + | } else {
|
240 + | builder.content = Some({
|
241 + | let mut container = Vec::new();
|
242 + | deser.read_list(member, &mut |deser| {
|
243 + | container.push({
|
244 + | let mut map = ::std::collections::HashMap::new();
|
245 + | deser.read_map(&INVENTORYITEM_MEMBER_CONTENT_MEMBER, &mut |key, deser| {
|
246 + | let value = deser.read_string(&::aws_smithy_schema::prelude::STRING)?;
|
247 + | map.insert(key, value);
|
248 + | Ok(())
|
249 + | })?;
|
250 + | map
|
251 + | });
|
252 + | Ok(())
|
253 + | })?;
|
254 + | container
|
255 + | });
|
256 + | }
|
257 + | }
|
258 + | Some(5) => {
|
259 + | if deser.is_null() {
|
260 + | deser.read_null()?;
|
261 + | } else {
|
262 + | builder.context = Some(deser.read_string_string_map(member)?);
|
263 + | }
|
264 + | }
|
265 + | _ => {}
|
266 + | }
|
267 + | Ok(())
|
268 + | })?;
|
269 + | builder.type_name = builder.type_name.or(Some(String::new()));
|
270 + | builder.schema_version = builder.schema_version.or(Some(String::new()));
|
271 + | builder.capture_time = builder.capture_time.or(Some(String::new()));
|
272 + | builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
|
273 + | }
|
274 + | }
|
275 + | impl InventoryItem {
|
276 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
277 + | pub fn deserialize_with_response(
|
278 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
279 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
280 + | _status: u16,
|
281 + | _body: &[u8],
|
282 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
283 + | Self::deserialize(deserializer)
|
284 + | }
|
285 + | }
|
286 + | impl InventoryItem {
|
287 + | /// Creates a new builder-style object to manufacture [`InventoryItem`](crate::types::InventoryItem).
|
288 + | pub fn builder() -> crate::types::builders::InventoryItemBuilder {
|
289 + | crate::types::builders::InventoryItemBuilder::default()
|
290 + | }
|
291 + | }
|
292 + |
|
293 + | /// A builder for [`InventoryItem`](crate::types::InventoryItem).
|
294 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
295 + | #[non_exhaustive]
|
296 + | pub struct InventoryItemBuilder {
|
297 + | pub(crate) type_name: ::std::option::Option<::std::string::String>,
|
298 + | pub(crate) schema_version: ::std::option::Option<::std::string::String>,
|
299 + | pub(crate) capture_time: ::std::option::Option<::std::string::String>,
|
300 + | pub(crate) content_hash: ::std::option::Option<::std::string::String>,
|
301 + | pub(crate) content: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
|
302 + | pub(crate) context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
|
303 + | }
|
304 + | impl InventoryItemBuilder {
|
305 + | /// <p>The name of the inventory type. Default inventory item type names start with <code>AWS</code>. Custom inventory type names will start with Custom. Default inventory item types include the following: <code>AWS:AWSComponent</code>, <code>AWS:Application</code>, <code>AWS:InstanceInformation</code>, <code>AWS:Network</code>, and <code>AWS:WindowsUpdate</code>.</p>
|
306 + | /// This field is required.
|
307 + | pub fn type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
308 + | self.type_name = ::std::option::Option::Some(input.into());
|
309 + | self
|
310 + | }
|
311 + | /// <p>The name of the inventory type. Default inventory item type names start with <code>AWS</code>. Custom inventory type names will start with Custom. Default inventory item types include the following: <code>AWS:AWSComponent</code>, <code>AWS:Application</code>, <code>AWS:InstanceInformation</code>, <code>AWS:Network</code>, and <code>AWS:WindowsUpdate</code>.</p>
|
312 + | pub fn set_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
313 + | self.type_name = input;
|
314 + | self
|
315 + | }
|
316 + | /// <p>The name of the inventory type. Default inventory item type names start with <code>AWS</code>. Custom inventory type names will start with Custom. Default inventory item types include the following: <code>AWS:AWSComponent</code>, <code>AWS:Application</code>, <code>AWS:InstanceInformation</code>, <code>AWS:Network</code>, and <code>AWS:WindowsUpdate</code>.</p>
|
317 + | pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> {
|
318 + | &self.type_name
|
319 + | }
|
320 + | /// <p>The schema version for the inventory item.</p>
|
321 + | /// This field is required.
|
322 + | pub fn schema_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
323 + | self.schema_version = ::std::option::Option::Some(input.into());
|
324 + | self
|
325 + | }
|
326 + | /// <p>The schema version for the inventory item.</p>
|
327 + | pub fn set_schema_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
328 + | self.schema_version = input;
|
329 + | self
|
330 + | }
|
331 + | /// <p>The schema version for the inventory item.</p>
|
332 + | pub fn get_schema_version(&self) -> &::std::option::Option<::std::string::String> {
|
333 + | &self.schema_version
|
334 + | }
|
335 + | /// <p>The time the inventory information was collected.</p>
|
336 + | /// This field is required.
|
337 + | pub fn capture_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
338 + | self.capture_time = ::std::option::Option::Some(input.into());
|
339 + | self
|
340 + | }
|
341 + | /// <p>The time the inventory information was collected.</p>
|
342 + | pub fn set_capture_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
343 + | self.capture_time = input;
|
344 + | self
|
345 + | }
|
346 + | /// <p>The time the inventory information was collected.</p>
|
347 + | pub fn get_capture_time(&self) -> &::std::option::Option<::std::string::String> {
|
348 + | &self.capture_time
|
349 + | }
|
350 + | /// <p>MD5 hash of the inventory item type contents. The content hash is used to determine whether to update inventory information. The PutInventory API doesn't update the inventory item type contents if the MD5 hash hasn't changed since last update.</p>
|
351 + | pub fn content_hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
352 + | self.content_hash = ::std::option::Option::Some(input.into());
|
353 + | self
|
354 + | }
|
355 + | /// <p>MD5 hash of the inventory item type contents. The content hash is used to determine whether to update inventory information. The PutInventory API doesn't update the inventory item type contents if the MD5 hash hasn't changed since last update.</p>
|
356 + | pub fn set_content_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
357 + | self.content_hash = input;
|
358 + | self
|
359 + | }
|
360 + | /// <p>MD5 hash of the inventory item type contents. The content hash is used to determine whether to update inventory information. The PutInventory API doesn't update the inventory item type contents if the MD5 hash hasn't changed since last update.</p>
|
361 + | pub fn get_content_hash(&self) -> &::std::option::Option<::std::string::String> {
|
362 + | &self.content_hash
|
363 + | }
|
364 + | /// Appends an item to `content`.
|
365 + | ///
|
366 + | /// To override the contents of this collection use [`set_content`](Self::set_content).
|
367 + | ///
|
368 + | /// <p>The inventory data of the inventory type.</p>
|
369 + | pub fn content(mut self, input: ::std::collections::HashMap<::std::string::String, ::std::string::String>) -> Self {
|
370 + | let mut v = self.content.unwrap_or_default();
|
371 + | v.push(input);
|
372 + | self.content = ::std::option::Option::Some(v);
|
373 + | self
|
374 + | }
|
375 + | /// <p>The inventory data of the inventory type.</p>
|
376 + | pub fn set_content(
|
377 + | mut self,
|
378 + | input: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
|
379 + | ) -> Self {
|
380 + | self.content = input;
|
381 + | self
|
382 + | }
|
383 + | /// <p>The inventory data of the inventory type.</p>
|
384 + | pub fn get_content(&self) -> &::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>> {
|
385 + | &self.content
|
386 + | }
|
387 + | /// Adds a key-value pair to `context`.
|
388 + | ///
|
389 + | /// To override the contents of this collection use [`set_context`](Self::set_context).
|
390 + | ///
|
391 + | /// <p>A map of associated properties for a specified inventory type. For example, with this attribute, you can specify the <code>ExecutionId</code>, <code>ExecutionType</code>, <code>ComplianceType</code> properties of the <code>AWS:ComplianceItem</code> type.</p>
|
392 + | pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
|
393 + | let mut hash_map = self.context.unwrap_or_default();
|
394 + | hash_map.insert(k.into(), v.into());
|
395 + | self.context = ::std::option::Option::Some(hash_map);
|
396 + | self
|
397 + | }
|
398 + | /// <p>A map of associated properties for a specified inventory type. For example, with this attribute, you can specify the <code>ExecutionId</code>, <code>ExecutionType</code>, <code>ComplianceType</code> properties of the <code>AWS:ComplianceItem</code> type.</p>
|
399 + | pub fn set_context(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
|
400 + | self.context = input;
|
401 + | self
|
402 + | }
|
403 + | /// <p>A map of associated properties for a specified inventory type. For example, with this attribute, you can specify the <code>ExecutionId</code>, <code>ExecutionType</code>, <code>ComplianceType</code> properties of the <code>AWS:ComplianceItem</code> type.</p>
|
404 + | pub fn get_context(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
|
405 + | &self.context
|
406 + | }
|
407 + | /// Consumes the builder and constructs a [`InventoryItem`](crate::types::InventoryItem).
|
408 + | /// This method will fail if any of the following fields are not set:
|
409 + | /// - [`type_name`](crate::types::builders::InventoryItemBuilder::type_name)
|
410 + | /// - [`schema_version`](crate::types::builders::InventoryItemBuilder::schema_version)
|
411 + | /// - [`capture_time`](crate::types::builders::InventoryItemBuilder::capture_time)
|
412 + | pub fn build(self) -> ::std::result::Result<crate::types::InventoryItem, ::aws_smithy_types::error::operation::BuildError> {
|
413 + | ::std::result::Result::Ok(crate::types::InventoryItem {
|
414 + | type_name: self.type_name.ok_or_else(|| {
|
415 + | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
416 + | "type_name",
|
417 + | "type_name was not specified but it is required when building InventoryItem",
|
418 + | )
|
419 + | })?,
|
420 + | schema_version: self.schema_version.ok_or_else(|| {
|
421 + | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
422 + | "schema_version",
|
423 + | "schema_version was not specified but it is required when building InventoryItem",
|
424 + | )
|
425 + | })?,
|
426 + | capture_time: self.capture_time.ok_or_else(|| {
|
427 + | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
428 + | "capture_time",
|
429 + | "capture_time was not specified but it is required when building InventoryItem",
|
430 + | )
|
431 + | })?,
|
432 + | content_hash: self.content_hash,
|
433 + | content: self.content,
|
434 + | context: self.context,
|
435 + | })
|
436 + | }
|
437 + | }
|