aws-sdk-fis 0.24.0

AWS SDK for AWS Fault Injection Simulator
Documentation
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_structure_crate_input_create_experiment_template_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateExperimentTemplateInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_1) = &input.actions {
        #[allow(unused_mut)]
        let mut object_2 = object.key("actions").start_object();
        for (key_3, value_4) in var_1 {
            {
                #[allow(unused_mut)]
                let mut object_5 = object_2.key(key_3.as_str()).start_object();
                crate::json_ser::serialize_structure_crate_model_create_experiment_template_action_input(&mut object_5, value_4)?;
                object_5.finish();
            }
        }
        object_2.finish();
    }
    if let Some(var_6) = &input.client_token {
        object.key("clientToken").string(var_6.as_str());
    }
    if let Some(var_7) = &input.description {
        object.key("description").string(var_7.as_str());
    }
    if let Some(var_8) = &input.log_configuration {
        #[allow(unused_mut)]
        let mut object_9 = object.key("logConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_create_experiment_template_log_configuration_input(&mut object_9, var_8)?;
        object_9.finish();
    }
    if let Some(var_10) = &input.role_arn {
        object.key("roleArn").string(var_10.as_str());
    }
    if let Some(var_11) = &input.stop_conditions {
        let mut array_12 = object.key("stopConditions").start_array();
        for item_13 in var_11 {
            {
                #[allow(unused_mut)]
                let mut object_14 = array_12.value().start_object();
                crate::json_ser::serialize_structure_crate_model_create_experiment_template_stop_condition_input(&mut object_14, item_13)?;
                object_14.finish();
            }
        }
        array_12.finish();
    }
    if let Some(var_15) = &input.tags {
        #[allow(unused_mut)]
        let mut object_16 = object.key("tags").start_object();
        for (key_17, value_18) in var_15 {
            {
                object_16.key(key_17.as_str()).string(value_18.as_str());
            }
        }
        object_16.finish();
    }
    if let Some(var_19) = &input.targets {
        #[allow(unused_mut)]
        let mut object_20 = object.key("targets").start_object();
        for (key_21, value_22) in var_19 {
            {
                #[allow(unused_mut)]
                let mut object_23 = object_20.key(key_21.as_str()).start_object();
                crate::json_ser::serialize_structure_crate_model_create_experiment_template_target_input(&mut object_23, value_22)?;
                object_23.finish();
            }
        }
        object_20.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_experiment_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartExperimentInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_24) = &input.client_token {
        object.key("clientToken").string(var_24.as_str());
    }
    if let Some(var_25) = &input.experiment_template_id {
        object.key("experimentTemplateId").string(var_25.as_str());
    }
    if let Some(var_26) = &input.tags {
        #[allow(unused_mut)]
        let mut object_27 = object.key("tags").start_object();
        for (key_28, value_29) in var_26 {
            {
                object_27.key(key_28.as_str()).string(value_29.as_str());
            }
        }
        object_27.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_tag_resource_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::TagResourceInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_30) = &input.tags {
        #[allow(unused_mut)]
        let mut object_31 = object.key("tags").start_object();
        for (key_32, value_33) in var_30 {
            {
                object_31.key(key_32.as_str()).string(value_33.as_str());
            }
        }
        object_31.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_experiment_template_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateExperimentTemplateInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_34) = &input.actions {
        #[allow(unused_mut)]
        let mut object_35 = object.key("actions").start_object();
        for (key_36, value_37) in var_34 {
            {
                #[allow(unused_mut)]
                let mut object_38 = object_35.key(key_36.as_str()).start_object();
                crate::json_ser::serialize_structure_crate_model_update_experiment_template_action_input_item(&mut object_38, value_37)?;
                object_38.finish();
            }
        }
        object_35.finish();
    }
    if let Some(var_39) = &input.description {
        object.key("description").string(var_39.as_str());
    }
    if let Some(var_40) = &input.log_configuration {
        #[allow(unused_mut)]
        let mut object_41 = object.key("logConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_update_experiment_template_log_configuration_input(&mut object_41, var_40)?;
        object_41.finish();
    }
    if let Some(var_42) = &input.role_arn {
        object.key("roleArn").string(var_42.as_str());
    }
    if let Some(var_43) = &input.stop_conditions {
        let mut array_44 = object.key("stopConditions").start_array();
        for item_45 in var_43 {
            {
                #[allow(unused_mut)]
                let mut object_46 = array_44.value().start_object();
                crate::json_ser::serialize_structure_crate_model_update_experiment_template_stop_condition_input(&mut object_46, item_45)?;
                object_46.finish();
            }
        }
        array_44.finish();
    }
    if let Some(var_47) = &input.targets {
        #[allow(unused_mut)]
        let mut object_48 = object.key("targets").start_object();
        for (key_49, value_50) in var_47 {
            {
                #[allow(unused_mut)]
                let mut object_51 = object_48.key(key_49.as_str()).start_object();
                crate::json_ser::serialize_structure_crate_model_update_experiment_template_target_input(&mut object_51, value_50)?;
                object_51.finish();
            }
        }
        object_48.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_create_experiment_template_action_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::CreateExperimentTemplateActionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_52) = &input.action_id {
        object.key("actionId").string(var_52.as_str());
    }
    if let Some(var_53) = &input.description {
        object.key("description").string(var_53.as_str());
    }
    if let Some(var_54) = &input.parameters {
        #[allow(unused_mut)]
        let mut object_55 = object.key("parameters").start_object();
        for (key_56, value_57) in var_54 {
            {
                object_55.key(key_56.as_str()).string(value_57.as_str());
            }
        }
        object_55.finish();
    }
    if let Some(var_58) = &input.targets {
        #[allow(unused_mut)]
        let mut object_59 = object.key("targets").start_object();
        for (key_60, value_61) in var_58 {
            {
                object_59.key(key_60.as_str()).string(value_61.as_str());
            }
        }
        object_59.finish();
    }
    if let Some(var_62) = &input.start_after {
        let mut array_63 = object.key("startAfter").start_array();
        for item_64 in var_62 {
            {
                array_63.value().string(item_64.as_str());
            }
        }
        array_63.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_create_experiment_template_log_configuration_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::CreateExperimentTemplateLogConfigurationInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_65) = &input.cloud_watch_logs_configuration {
        #[allow(unused_mut)]
        let mut object_66 = object.key("cloudWatchLogsConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_experiment_template_cloud_watch_logs_log_configuration_input(&mut object_66, var_65)?;
        object_66.finish();
    }
    if let Some(var_67) = &input.s3_configuration {
        #[allow(unused_mut)]
        let mut object_68 = object.key("s3Configuration").start_object();
        crate::json_ser::serialize_structure_crate_model_experiment_template_s3_log_configuration_input(&mut object_68, var_67)?;
        object_68.finish();
    }
    if let Some(var_69) = &input.log_schema_version {
        object.key("logSchemaVersion").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_69).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_create_experiment_template_stop_condition_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::CreateExperimentTemplateStopConditionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_70) = &input.source {
        object.key("source").string(var_70.as_str());
    }
    if let Some(var_71) = &input.value {
        object.key("value").string(var_71.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_create_experiment_template_target_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::CreateExperimentTemplateTargetInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_72) = &input.resource_type {
        object.key("resourceType").string(var_72.as_str());
    }
    if let Some(var_73) = &input.resource_arns {
        let mut array_74 = object.key("resourceArns").start_array();
        for item_75 in var_73 {
            {
                array_74.value().string(item_75.as_str());
            }
        }
        array_74.finish();
    }
    if let Some(var_76) = &input.resource_tags {
        #[allow(unused_mut)]
        let mut object_77 = object.key("resourceTags").start_object();
        for (key_78, value_79) in var_76 {
            {
                object_77.key(key_78.as_str()).string(value_79.as_str());
            }
        }
        object_77.finish();
    }
    if let Some(var_80) = &input.filters {
        let mut array_81 = object.key("filters").start_array();
        for item_82 in var_80 {
            {
                #[allow(unused_mut)]
                let mut object_83 = array_81.value().start_object();
                crate::json_ser::serialize_structure_crate_model_experiment_template_target_input_filter(&mut object_83, item_82)?;
                object_83.finish();
            }
        }
        array_81.finish();
    }
    if let Some(var_84) = &input.selection_mode {
        object.key("selectionMode").string(var_84.as_str());
    }
    if let Some(var_85) = &input.parameters {
        #[allow(unused_mut)]
        let mut object_86 = object.key("parameters").start_object();
        for (key_87, value_88) in var_85 {
            {
                object_86.key(key_87.as_str()).string(value_88.as_str());
            }
        }
        object_86.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_update_experiment_template_action_input_item(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::UpdateExperimentTemplateActionInputItem,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_89) = &input.action_id {
        object.key("actionId").string(var_89.as_str());
    }
    if let Some(var_90) = &input.description {
        object.key("description").string(var_90.as_str());
    }
    if let Some(var_91) = &input.parameters {
        #[allow(unused_mut)]
        let mut object_92 = object.key("parameters").start_object();
        for (key_93, value_94) in var_91 {
            {
                object_92.key(key_93.as_str()).string(value_94.as_str());
            }
        }
        object_92.finish();
    }
    if let Some(var_95) = &input.targets {
        #[allow(unused_mut)]
        let mut object_96 = object.key("targets").start_object();
        for (key_97, value_98) in var_95 {
            {
                object_96.key(key_97.as_str()).string(value_98.as_str());
            }
        }
        object_96.finish();
    }
    if let Some(var_99) = &input.start_after {
        let mut array_100 = object.key("startAfter").start_array();
        for item_101 in var_99 {
            {
                array_100.value().string(item_101.as_str());
            }
        }
        array_100.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_update_experiment_template_log_configuration_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::UpdateExperimentTemplateLogConfigurationInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_102) = &input.cloud_watch_logs_configuration {
        #[allow(unused_mut)]
        let mut object_103 = object.key("cloudWatchLogsConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_experiment_template_cloud_watch_logs_log_configuration_input(&mut object_103, var_102)?;
        object_103.finish();
    }
    if let Some(var_104) = &input.s3_configuration {
        #[allow(unused_mut)]
        let mut object_105 = object.key("s3Configuration").start_object();
        crate::json_ser::serialize_structure_crate_model_experiment_template_s3_log_configuration_input(&mut object_105, var_104)?;
        object_105.finish();
    }
    if let Some(var_106) = &input.log_schema_version {
        object.key("logSchemaVersion").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_106).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_update_experiment_template_stop_condition_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::UpdateExperimentTemplateStopConditionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_107) = &input.source {
        object.key("source").string(var_107.as_str());
    }
    if let Some(var_108) = &input.value {
        object.key("value").string(var_108.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_update_experiment_template_target_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::UpdateExperimentTemplateTargetInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_109) = &input.resource_type {
        object.key("resourceType").string(var_109.as_str());
    }
    if let Some(var_110) = &input.resource_arns {
        let mut array_111 = object.key("resourceArns").start_array();
        for item_112 in var_110 {
            {
                array_111.value().string(item_112.as_str());
            }
        }
        array_111.finish();
    }
    if let Some(var_113) = &input.resource_tags {
        #[allow(unused_mut)]
        let mut object_114 = object.key("resourceTags").start_object();
        for (key_115, value_116) in var_113 {
            {
                object_114.key(key_115.as_str()).string(value_116.as_str());
            }
        }
        object_114.finish();
    }
    if let Some(var_117) = &input.filters {
        let mut array_118 = object.key("filters").start_array();
        for item_119 in var_117 {
            {
                #[allow(unused_mut)]
                let mut object_120 = array_118.value().start_object();
                crate::json_ser::serialize_structure_crate_model_experiment_template_target_input_filter(&mut object_120, item_119)?;
                object_120.finish();
            }
        }
        array_118.finish();
    }
    if let Some(var_121) = &input.selection_mode {
        object.key("selectionMode").string(var_121.as_str());
    }
    if let Some(var_122) = &input.parameters {
        #[allow(unused_mut)]
        let mut object_123 = object.key("parameters").start_object();
        for (key_124, value_125) in var_122 {
            {
                object_123.key(key_124.as_str()).string(value_125.as_str());
            }
        }
        object_123.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_experiment_template_cloud_watch_logs_log_configuration_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ExperimentTemplateCloudWatchLogsLogConfigurationInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_126) = &input.log_group_arn {
        object.key("logGroupArn").string(var_126.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_experiment_template_s3_log_configuration_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ExperimentTemplateS3LogConfigurationInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_127) = &input.bucket_name {
        object.key("bucketName").string(var_127.as_str());
    }
    if let Some(var_128) = &input.prefix {
        object.key("prefix").string(var_128.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_experiment_template_target_input_filter(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ExperimentTemplateTargetInputFilter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_129) = &input.path {
        object.key("path").string(var_129.as_str());
    }
    if let Some(var_130) = &input.values {
        let mut array_131 = object.key("values").start_array();
        for item_132 in var_130 {
            {
                array_131.value().string(item_132.as_str());
            }
        }
        array_131.finish();
    }
    Ok(())
}