1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DeleteInventoryInput {
/// <p>The name of the custom inventory type for which you want to delete either all previously collected data or the inventory type itself.</p>
pub type_name: ::std::option::Option<::std::string::String>,
/// <p>Use the <code>SchemaDeleteOption</code> to delete a custom inventory type (schema). If you don't choose this option, the system only deletes existing inventory data associated with the custom inventory type. Choose one of the following options:</p>
/// <p>DisableSchema: If you choose this option, the system ignores all inventory data for the specified version, and any earlier versions. To enable this schema again, you must call the <code>PutInventory</code> operation for a version greater than the disabled version.</p>
/// <p>DeleteSchema: This option deletes the specified custom type from the Inventory service. You can recreate the schema later, if you want.</p>
pub schema_delete_option: ::std::option::Option<crate::types::InventorySchemaDeleteOption>,
/// <p>Use this option to view a summary of the deletion request without deleting any data or the data type. This option is useful when you only want to understand what will be deleted. Once you validate that the data to be deleted is what you intend to delete, you can run the same command without specifying the <code>DryRun</code> option.</p>
pub dry_run: ::std::option::Option<bool>,
/// <p>User-provided idempotency token.</p>
pub client_token: ::std::option::Option<::std::string::String>,
}
impl DeleteInventoryInput {
/// <p>The name of the custom inventory type for which you want to delete either all previously collected data or the inventory type itself.</p>
pub fn type_name(&self) -> ::std::option::Option<&str> {
self.type_name.as_deref()
}
/// <p>Use the <code>SchemaDeleteOption</code> to delete a custom inventory type (schema). If you don't choose this option, the system only deletes existing inventory data associated with the custom inventory type. Choose one of the following options:</p>
/// <p>DisableSchema: If you choose this option, the system ignores all inventory data for the specified version, and any earlier versions. To enable this schema again, you must call the <code>PutInventory</code> operation for a version greater than the disabled version.</p>
/// <p>DeleteSchema: This option deletes the specified custom type from the Inventory service. You can recreate the schema later, if you want.</p>
pub fn schema_delete_option(&self) -> ::std::option::Option<&crate::types::InventorySchemaDeleteOption> {
self.schema_delete_option.as_ref()
}
/// <p>Use this option to view a summary of the deletion request without deleting any data or the data type. This option is useful when you only want to understand what will be deleted. Once you validate that the data to be deleted is what you intend to delete, you can run the same command without specifying the <code>DryRun</code> option.</p>
pub fn dry_run(&self) -> ::std::option::Option<bool> {
self.dry_run
}
/// <p>User-provided idempotency token.</p>
pub fn client_token(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
}
static DELETEINVENTORYINPUT_MEMBER_TYPE_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#DeleteInventoryInput$TypeName",
"com.amazonaws.ssm.synthetic",
"DeleteInventoryInput",
),
::aws_smithy_schema::ShapeType::String,
"TypeName",
0,
);
static DELETEINVENTORYINPUT_MEMBER_SCHEMA_DELETE_OPTION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#DeleteInventoryInput$SchemaDeleteOption",
"com.amazonaws.ssm.synthetic",
"DeleteInventoryInput",
),
::aws_smithy_schema::ShapeType::String,
"SchemaDeleteOption",
1,
);
static DELETEINVENTORYINPUT_MEMBER_DRY_RUN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#DeleteInventoryInput$DryRun",
"com.amazonaws.ssm.synthetic",
"DeleteInventoryInput",
),
::aws_smithy_schema::ShapeType::Boolean,
"DryRun",
2,
);
static DELETEINVENTORYINPUT_MEMBER_CLIENT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#DeleteInventoryInput$ClientToken",
"com.amazonaws.ssm.synthetic",
"DeleteInventoryInput",
),
::aws_smithy_schema::ShapeType::String,
"ClientToken",
3,
);
static DELETEINVENTORYINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#DeleteInventoryInput",
"com.amazonaws.ssm.synthetic",
"DeleteInventoryInput",
),
::aws_smithy_schema::ShapeType::Structure,
&[
&DELETEINVENTORYINPUT_MEMBER_TYPE_NAME,
&DELETEINVENTORYINPUT_MEMBER_SCHEMA_DELETE_OPTION,
&DELETEINVENTORYINPUT_MEMBER_DRY_RUN,
&DELETEINVENTORYINPUT_MEMBER_CLIENT_TOKEN,
],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("DeleteInventoryRequest");
impl DeleteInventoryInput {
/// The schema for this shape.
pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DELETEINVENTORYINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for DeleteInventoryInput {
fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
Self::SCHEMA
}
#[allow(unused_variables, clippy::diverging_sub_expression)]
fn serialize_members(
&self,
ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
if let Some(ref val) = self.type_name {
ser.write_string(&DELETEINVENTORYINPUT_MEMBER_TYPE_NAME, val)?;
}
if let Some(ref val) = self.schema_delete_option {
ser.write_string(&DELETEINVENTORYINPUT_MEMBER_SCHEMA_DELETE_OPTION, val.as_str())?;
}
if let Some(ref val) = self.dry_run {
ser.write_boolean(&DELETEINVENTORYINPUT_MEMBER_DRY_RUN, *val)?;
}
if let Some(ref val) = self.client_token {
ser.write_string(&DELETEINVENTORYINPUT_MEMBER_CLIENT_TOKEN, val)?;
}
Ok(())
}
}
impl crate::operation::delete_inventory::builders::DeleteInventoryInputBuilder {
#[allow(
unused_variables,
unreachable_code,
clippy::single_match,
clippy::match_single_binding,
clippy::diverging_sub_expression
)]
pub(crate) fn deserialize_members(
&mut self,
deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
deserializer.read_struct(&DELETEINVENTORYINPUT_SCHEMA, &mut |member, deser| {
match member.member_index() {
Some(0) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.type_name = Some(deser.read_string(member)?);
}
}
Some(1) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.schema_delete_option = Some(crate::types::InventorySchemaDeleteOption::from(deser.read_string(member)?.as_str()));
}
}
Some(2) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.dry_run = Some(deser.read_boolean(member)?);
}
}
Some(3) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.client_token = Some(deser.read_string(member)?);
}
}
_ => {}
}
Ok(())
})
}
}
impl DeleteInventoryInput {
/// Deserializes this structure from a [`ShapeDeserializer`].
pub fn deserialize(
deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
let mut builder = Self::builder();
builder.deserialize_members(deserializer)?;
builder.type_name = builder.type_name.or(Some(String::new()));
builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
}
}
impl DeleteInventoryInput {
/// Creates a new builder-style object to manufacture [`DeleteInventoryInput`](crate::operation::delete_inventory::DeleteInventoryInput).
pub fn builder() -> crate::operation::delete_inventory::builders::DeleteInventoryInputBuilder {
crate::operation::delete_inventory::builders::DeleteInventoryInputBuilder::default()
}
}
/// A builder for [`DeleteInventoryInput`](crate::operation::delete_inventory::DeleteInventoryInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DeleteInventoryInputBuilder {
pub(crate) type_name: ::std::option::Option<::std::string::String>,
pub(crate) schema_delete_option: ::std::option::Option<crate::types::InventorySchemaDeleteOption>,
pub(crate) dry_run: ::std::option::Option<bool>,
pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl DeleteInventoryInputBuilder {
/// <p>The name of the custom inventory type for which you want to delete either all previously collected data or the inventory type itself.</p>
/// This field is required.
pub fn type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.type_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the custom inventory type for which you want to delete either all previously collected data or the inventory type itself.</p>
pub fn set_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.type_name = input;
self
}
/// <p>The name of the custom inventory type for which you want to delete either all previously collected data or the inventory type itself.</p>
pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> {
&self.type_name
}
/// <p>Use the <code>SchemaDeleteOption</code> to delete a custom inventory type (schema). If you don't choose this option, the system only deletes existing inventory data associated with the custom inventory type. Choose one of the following options:</p>
/// <p>DisableSchema: If you choose this option, the system ignores all inventory data for the specified version, and any earlier versions. To enable this schema again, you must call the <code>PutInventory</code> operation for a version greater than the disabled version.</p>
/// <p>DeleteSchema: This option deletes the specified custom type from the Inventory service. You can recreate the schema later, if you want.</p>
pub fn schema_delete_option(mut self, input: crate::types::InventorySchemaDeleteOption) -> Self {
self.schema_delete_option = ::std::option::Option::Some(input);
self
}
/// <p>Use the <code>SchemaDeleteOption</code> to delete a custom inventory type (schema). If you don't choose this option, the system only deletes existing inventory data associated with the custom inventory type. Choose one of the following options:</p>
/// <p>DisableSchema: If you choose this option, the system ignores all inventory data for the specified version, and any earlier versions. To enable this schema again, you must call the <code>PutInventory</code> operation for a version greater than the disabled version.</p>
/// <p>DeleteSchema: This option deletes the specified custom type from the Inventory service. You can recreate the schema later, if you want.</p>
pub fn set_schema_delete_option(mut self, input: ::std::option::Option<crate::types::InventorySchemaDeleteOption>) -> Self {
self.schema_delete_option = input;
self
}
/// <p>Use the <code>SchemaDeleteOption</code> to delete a custom inventory type (schema). If you don't choose this option, the system only deletes existing inventory data associated with the custom inventory type. Choose one of the following options:</p>
/// <p>DisableSchema: If you choose this option, the system ignores all inventory data for the specified version, and any earlier versions. To enable this schema again, you must call the <code>PutInventory</code> operation for a version greater than the disabled version.</p>
/// <p>DeleteSchema: This option deletes the specified custom type from the Inventory service. You can recreate the schema later, if you want.</p>
pub fn get_schema_delete_option(&self) -> &::std::option::Option<crate::types::InventorySchemaDeleteOption> {
&self.schema_delete_option
}
/// <p>Use this option to view a summary of the deletion request without deleting any data or the data type. This option is useful when you only want to understand what will be deleted. Once you validate that the data to be deleted is what you intend to delete, you can run the same command without specifying the <code>DryRun</code> option.</p>
pub fn dry_run(mut self, input: bool) -> Self {
self.dry_run = ::std::option::Option::Some(input);
self
}
/// <p>Use this option to view a summary of the deletion request without deleting any data or the data type. This option is useful when you only want to understand what will be deleted. Once you validate that the data to be deleted is what you intend to delete, you can run the same command without specifying the <code>DryRun</code> option.</p>
pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
self.dry_run = input;
self
}
/// <p>Use this option to view a summary of the deletion request without deleting any data or the data type. This option is useful when you only want to understand what will be deleted. Once you validate that the data to be deleted is what you intend to delete, you can run the same command without specifying the <code>DryRun</code> option.</p>
pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
&self.dry_run
}
/// <p>User-provided idempotency token.</p>
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_token = ::std::option::Option::Some(input.into());
self
}
/// <p>User-provided idempotency token.</p>
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
/// <p>User-provided idempotency token.</p>
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
/// Consumes the builder and constructs a [`DeleteInventoryInput`](crate::operation::delete_inventory::DeleteInventoryInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::delete_inventory::DeleteInventoryInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::delete_inventory::DeleteInventoryInput {
type_name: self.type_name,
schema_delete_option: self.schema_delete_option,
dry_run: self.dry_run,
client_token: self.client_token,
})
}
}