#[non_exhaustive]
pub enum ResourceType {
    AutoScalingGroup,
    EbsVolume,
    Ec2Instance,
    LambdaFunction,
    NotApplicable,
    Unknown(UnknownVariantValue),
}
Expand description

When writing a match expression against ResourceType, it is important to ensure your code is forward-compatible. That is, if a match arm handles a case for a feature that is supported by the service but has not been represented as an enum variant in a current version of SDK, your code should continue to work when you upgrade SDK to a future version in which the enum does include a variant for that feature.

Here is an example of how you can make a match expression forward-compatible:

# let resourcetype = unimplemented!();
match resourcetype {
    ResourceType::AutoScalingGroup => { /* ... */ },
    ResourceType::EbsVolume => { /* ... */ },
    ResourceType::Ec2Instance => { /* ... */ },
    ResourceType::LambdaFunction => { /* ... */ },
    ResourceType::NotApplicable => { /* ... */ },
    other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
    _ => { /* ... */ },
}

The above code demonstrates that when resourcetype represents NewFeature, the execution path will lead to the second last match arm, even though the enum does not contain a variant ResourceType::NewFeature in the current version of SDK. The reason is that the variable other, created by the @ operator, is bound to ResourceType::Unknown(UnknownVariantValue("NewFeature".to_owned())) and calling as_str on it yields "NewFeature". This match expression is forward-compatible when executed with a newer version of SDK where the variant ResourceType::NewFeature is defined. Specifically, when resourcetype represents NewFeature, the execution path will hit the second last match arm as before by virtue of calling as_str on ResourceType::NewFeature also yielding "NewFeature".

Explicitly matching on the Unknown variant should be avoided for two reasons:

  • The inner data UnknownVariantValue is opaque, and no further information can be extracted.
  • It might inadvertently shadow other intended match arms.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

AutoScalingGroup

§

EbsVolume

§

Ec2Instance

§

LambdaFunction

§

NotApplicable

§

Unknown(UnknownVariantValue)

Unknown contains new variants that have been added since this code was generated.

Implementations§

Returns the &str value of the enum member.

Examples found in repository?
src/model.rs (line 611)
610
611
612
    fn as_ref(&self) -> &str {
        self.as_str()
    }
More examples
Hide additional examples
src/json_ser.rs (line 7)
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
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
pub fn serialize_structure_crate_input_delete_recommendation_preferences_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteRecommendationPreferencesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_1) = &input.resource_type {
        object.key("resourceType").string(var_1.as_str());
    }
    if let Some(var_2) = &input.scope {
        #[allow(unused_mut)]
        let mut object_3 = object.key("scope").start_object();
        crate::json_ser::serialize_structure_crate_model_scope(&mut object_3, var_2)?;
        object_3.finish();
    }
    if let Some(var_4) = &input.recommendation_preference_names {
        let mut array_5 = object.key("recommendationPreferenceNames").start_array();
        for item_6 in var_4 {
            {
                array_5.value().string(item_6.as_str());
            }
        }
        array_5.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_recommendation_export_jobs_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeRecommendationExportJobsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_7) = &input.job_ids {
        let mut array_8 = object.key("jobIds").start_array();
        for item_9 in var_7 {
            {
                array_8.value().string(item_9.as_str());
            }
        }
        array_8.finish();
    }
    if let Some(var_10) = &input.filters {
        let mut array_11 = object.key("filters").start_array();
        for item_12 in var_10 {
            {
                #[allow(unused_mut)]
                let mut object_13 = array_11.value().start_object();
                crate::json_ser::serialize_structure_crate_model_job_filter(
                    &mut object_13,
                    item_12,
                )?;
                object_13.finish();
            }
        }
        array_11.finish();
    }
    if let Some(var_14) = &input.next_token {
        object.key("nextToken").string(var_14.as_str());
    }
    if let Some(var_15) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_15).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_export_auto_scaling_group_recommendations_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ExportAutoScalingGroupRecommendationsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_16) = &input.account_ids {
        let mut array_17 = object.key("accountIds").start_array();
        for item_18 in var_16 {
            {
                array_17.value().string(item_18.as_str());
            }
        }
        array_17.finish();
    }
    if let Some(var_19) = &input.filters {
        let mut array_20 = object.key("filters").start_array();
        for item_21 in var_19 {
            {
                #[allow(unused_mut)]
                let mut object_22 = array_20.value().start_object();
                crate::json_ser::serialize_structure_crate_model_filter(&mut object_22, item_21)?;
                object_22.finish();
            }
        }
        array_20.finish();
    }
    if let Some(var_23) = &input.fields_to_export {
        let mut array_24 = object.key("fieldsToExport").start_array();
        for item_25 in var_23 {
            {
                array_24.value().string(item_25.as_str());
            }
        }
        array_24.finish();
    }
    if let Some(var_26) = &input.s3_destination_config {
        #[allow(unused_mut)]
        let mut object_27 = object.key("s3DestinationConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_s3_destination_config(
            &mut object_27,
            var_26,
        )?;
        object_27.finish();
    }
    if let Some(var_28) = &input.file_format {
        object.key("fileFormat").string(var_28.as_str());
    }
    if input.include_member_accounts {
        object
            .key("includeMemberAccounts")
            .boolean(input.include_member_accounts);
    }
    if let Some(var_29) = &input.recommendation_preferences {
        #[allow(unused_mut)]
        let mut object_30 = object.key("recommendationPreferences").start_object();
        crate::json_ser::serialize_structure_crate_model_recommendation_preferences(
            &mut object_30,
            var_29,
        )?;
        object_30.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_export_ebs_volume_recommendations_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ExportEbsVolumeRecommendationsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_31) = &input.account_ids {
        let mut array_32 = object.key("accountIds").start_array();
        for item_33 in var_31 {
            {
                array_32.value().string(item_33.as_str());
            }
        }
        array_32.finish();
    }
    if let Some(var_34) = &input.filters {
        let mut array_35 = object.key("filters").start_array();
        for item_36 in var_34 {
            {
                #[allow(unused_mut)]
                let mut object_37 = array_35.value().start_object();
                crate::json_ser::serialize_structure_crate_model_ebs_filter(
                    &mut object_37,
                    item_36,
                )?;
                object_37.finish();
            }
        }
        array_35.finish();
    }
    if let Some(var_38) = &input.fields_to_export {
        let mut array_39 = object.key("fieldsToExport").start_array();
        for item_40 in var_38 {
            {
                array_39.value().string(item_40.as_str());
            }
        }
        array_39.finish();
    }
    if let Some(var_41) = &input.s3_destination_config {
        #[allow(unused_mut)]
        let mut object_42 = object.key("s3DestinationConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_s3_destination_config(
            &mut object_42,
            var_41,
        )?;
        object_42.finish();
    }
    if let Some(var_43) = &input.file_format {
        object.key("fileFormat").string(var_43.as_str());
    }
    if input.include_member_accounts {
        object
            .key("includeMemberAccounts")
            .boolean(input.include_member_accounts);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_export_ec2_instance_recommendations_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ExportEc2InstanceRecommendationsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_44) = &input.account_ids {
        let mut array_45 = object.key("accountIds").start_array();
        for item_46 in var_44 {
            {
                array_45.value().string(item_46.as_str());
            }
        }
        array_45.finish();
    }
    if let Some(var_47) = &input.filters {
        let mut array_48 = object.key("filters").start_array();
        for item_49 in var_47 {
            {
                #[allow(unused_mut)]
                let mut object_50 = array_48.value().start_object();
                crate::json_ser::serialize_structure_crate_model_filter(&mut object_50, item_49)?;
                object_50.finish();
            }
        }
        array_48.finish();
    }
    if let Some(var_51) = &input.fields_to_export {
        let mut array_52 = object.key("fieldsToExport").start_array();
        for item_53 in var_51 {
            {
                array_52.value().string(item_53.as_str());
            }
        }
        array_52.finish();
    }
    if let Some(var_54) = &input.s3_destination_config {
        #[allow(unused_mut)]
        let mut object_55 = object.key("s3DestinationConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_s3_destination_config(
            &mut object_55,
            var_54,
        )?;
        object_55.finish();
    }
    if let Some(var_56) = &input.file_format {
        object.key("fileFormat").string(var_56.as_str());
    }
    if input.include_member_accounts {
        object
            .key("includeMemberAccounts")
            .boolean(input.include_member_accounts);
    }
    if let Some(var_57) = &input.recommendation_preferences {
        #[allow(unused_mut)]
        let mut object_58 = object.key("recommendationPreferences").start_object();
        crate::json_ser::serialize_structure_crate_model_recommendation_preferences(
            &mut object_58,
            var_57,
        )?;
        object_58.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_export_lambda_function_recommendations_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ExportLambdaFunctionRecommendationsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_59) = &input.account_ids {
        let mut array_60 = object.key("accountIds").start_array();
        for item_61 in var_59 {
            {
                array_60.value().string(item_61.as_str());
            }
        }
        array_60.finish();
    }
    if let Some(var_62) = &input.filters {
        let mut array_63 = object.key("filters").start_array();
        for item_64 in var_62 {
            {
                #[allow(unused_mut)]
                let mut object_65 = array_63.value().start_object();
                crate::json_ser::serialize_structure_crate_model_lambda_function_recommendation_filter(&mut object_65, item_64)?;
                object_65.finish();
            }
        }
        array_63.finish();
    }
    if let Some(var_66) = &input.fields_to_export {
        let mut array_67 = object.key("fieldsToExport").start_array();
        for item_68 in var_66 {
            {
                array_67.value().string(item_68.as_str());
            }
        }
        array_67.finish();
    }
    if let Some(var_69) = &input.s3_destination_config {
        #[allow(unused_mut)]
        let mut object_70 = object.key("s3DestinationConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_s3_destination_config(
            &mut object_70,
            var_69,
        )?;
        object_70.finish();
    }
    if let Some(var_71) = &input.file_format {
        object.key("fileFormat").string(var_71.as_str());
    }
    if input.include_member_accounts {
        object
            .key("includeMemberAccounts")
            .boolean(input.include_member_accounts);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_auto_scaling_group_recommendations_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetAutoScalingGroupRecommendationsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_72) = &input.account_ids {
        let mut array_73 = object.key("accountIds").start_array();
        for item_74 in var_72 {
            {
                array_73.value().string(item_74.as_str());
            }
        }
        array_73.finish();
    }
    if let Some(var_75) = &input.auto_scaling_group_arns {
        let mut array_76 = object.key("autoScalingGroupArns").start_array();
        for item_77 in var_75 {
            {
                array_76.value().string(item_77.as_str());
            }
        }
        array_76.finish();
    }
    if let Some(var_78) = &input.next_token {
        object.key("nextToken").string(var_78.as_str());
    }
    if let Some(var_79) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_79).into()),
        );
    }
    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_filter(&mut object_83, item_82)?;
                object_83.finish();
            }
        }
        array_81.finish();
    }
    if let Some(var_84) = &input.recommendation_preferences {
        #[allow(unused_mut)]
        let mut object_85 = object.key("recommendationPreferences").start_object();
        crate::json_ser::serialize_structure_crate_model_recommendation_preferences(
            &mut object_85,
            var_84,
        )?;
        object_85.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_ebs_volume_recommendations_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetEbsVolumeRecommendationsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_86) = &input.volume_arns {
        let mut array_87 = object.key("volumeArns").start_array();
        for item_88 in var_86 {
            {
                array_87.value().string(item_88.as_str());
            }
        }
        array_87.finish();
    }
    if let Some(var_89) = &input.next_token {
        object.key("nextToken").string(var_89.as_str());
    }
    if let Some(var_90) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_90).into()),
        );
    }
    if let Some(var_91) = &input.filters {
        let mut array_92 = object.key("filters").start_array();
        for item_93 in var_91 {
            {
                #[allow(unused_mut)]
                let mut object_94 = array_92.value().start_object();
                crate::json_ser::serialize_structure_crate_model_ebs_filter(
                    &mut object_94,
                    item_93,
                )?;
                object_94.finish();
            }
        }
        array_92.finish();
    }
    if let Some(var_95) = &input.account_ids {
        let mut array_96 = object.key("accountIds").start_array();
        for item_97 in var_95 {
            {
                array_96.value().string(item_97.as_str());
            }
        }
        array_96.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_ec2_instance_recommendations_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetEc2InstanceRecommendationsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_98) = &input.instance_arns {
        let mut array_99 = object.key("instanceArns").start_array();
        for item_100 in var_98 {
            {
                array_99.value().string(item_100.as_str());
            }
        }
        array_99.finish();
    }
    if let Some(var_101) = &input.next_token {
        object.key("nextToken").string(var_101.as_str());
    }
    if let Some(var_102) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_102).into()),
        );
    }
    if let Some(var_103) = &input.filters {
        let mut array_104 = object.key("filters").start_array();
        for item_105 in var_103 {
            {
                #[allow(unused_mut)]
                let mut object_106 = array_104.value().start_object();
                crate::json_ser::serialize_structure_crate_model_filter(&mut object_106, item_105)?;
                object_106.finish();
            }
        }
        array_104.finish();
    }
    if let Some(var_107) = &input.account_ids {
        let mut array_108 = object.key("accountIds").start_array();
        for item_109 in var_107 {
            {
                array_108.value().string(item_109.as_str());
            }
        }
        array_108.finish();
    }
    if let Some(var_110) = &input.recommendation_preferences {
        #[allow(unused_mut)]
        let mut object_111 = object.key("recommendationPreferences").start_object();
        crate::json_ser::serialize_structure_crate_model_recommendation_preferences(
            &mut object_111,
            var_110,
        )?;
        object_111.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_ec2_recommendation_projected_metrics_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetEc2RecommendationProjectedMetricsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_112) = &input.instance_arn {
        object.key("instanceArn").string(var_112.as_str());
    }
    if let Some(var_113) = &input.stat {
        object.key("stat").string(var_113.as_str());
    }
    {
        object.key("period").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.period).into()),
        );
    }
    if let Some(var_114) = &input.start_time {
        object
            .key("startTime")
            .date_time(var_114, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    if let Some(var_115) = &input.end_time {
        object
            .key("endTime")
            .date_time(var_115, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    if let Some(var_116) = &input.recommendation_preferences {
        #[allow(unused_mut)]
        let mut object_117 = object.key("recommendationPreferences").start_object();
        crate::json_ser::serialize_structure_crate_model_recommendation_preferences(
            &mut object_117,
            var_116,
        )?;
        object_117.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_effective_recommendation_preferences_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetEffectiveRecommendationPreferencesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_118) = &input.resource_arn {
        object.key("resourceArn").string(var_118.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_enrollment_statuses_for_organization_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetEnrollmentStatusesForOrganizationInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_119) = &input.filters {
        let mut array_120 = object.key("filters").start_array();
        for item_121 in var_119 {
            {
                #[allow(unused_mut)]
                let mut object_122 = array_120.value().start_object();
                crate::json_ser::serialize_structure_crate_model_enrollment_filter(
                    &mut object_122,
                    item_121,
                )?;
                object_122.finish();
            }
        }
        array_120.finish();
    }
    if let Some(var_123) = &input.next_token {
        object.key("nextToken").string(var_123.as_str());
    }
    if let Some(var_124) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_124).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_lambda_function_recommendations_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetLambdaFunctionRecommendationsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_125) = &input.function_arns {
        let mut array_126 = object.key("functionArns").start_array();
        for item_127 in var_125 {
            {
                array_126.value().string(item_127.as_str());
            }
        }
        array_126.finish();
    }
    if let Some(var_128) = &input.account_ids {
        let mut array_129 = object.key("accountIds").start_array();
        for item_130 in var_128 {
            {
                array_129.value().string(item_130.as_str());
            }
        }
        array_129.finish();
    }
    if let Some(var_131) = &input.filters {
        let mut array_132 = object.key("filters").start_array();
        for item_133 in var_131 {
            {
                #[allow(unused_mut)]
                let mut object_134 = array_132.value().start_object();
                crate::json_ser::serialize_structure_crate_model_lambda_function_recommendation_filter(&mut object_134, item_133)?;
                object_134.finish();
            }
        }
        array_132.finish();
    }
    if let Some(var_135) = &input.next_token {
        object.key("nextToken").string(var_135.as_str());
    }
    if let Some(var_136) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_136).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_recommendation_preferences_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetRecommendationPreferencesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_137) = &input.resource_type {
        object.key("resourceType").string(var_137.as_str());
    }
    if let Some(var_138) = &input.scope {
        #[allow(unused_mut)]
        let mut object_139 = object.key("scope").start_object();
        crate::json_ser::serialize_structure_crate_model_scope(&mut object_139, var_138)?;
        object_139.finish();
    }
    if let Some(var_140) = &input.next_token {
        object.key("nextToken").string(var_140.as_str());
    }
    if let Some(var_141) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_141).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_recommendation_summaries_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetRecommendationSummariesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_142) = &input.account_ids {
        let mut array_143 = object.key("accountIds").start_array();
        for item_144 in var_142 {
            {
                array_143.value().string(item_144.as_str());
            }
        }
        array_143.finish();
    }
    if let Some(var_145) = &input.next_token {
        object.key("nextToken").string(var_145.as_str());
    }
    if let Some(var_146) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_146).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_put_recommendation_preferences_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::PutRecommendationPreferencesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_147) = &input.resource_type {
        object.key("resourceType").string(var_147.as_str());
    }
    if let Some(var_148) = &input.scope {
        #[allow(unused_mut)]
        let mut object_149 = object.key("scope").start_object();
        crate::json_ser::serialize_structure_crate_model_scope(&mut object_149, var_148)?;
        object_149.finish();
    }
    if let Some(var_150) = &input.enhanced_infrastructure_metrics {
        object
            .key("enhancedInfrastructureMetrics")
            .string(var_150.as_str());
    }
    if let Some(var_151) = &input.inferred_workload_types {
        object.key("inferredWorkloadTypes").string(var_151.as_str());
    }
    Ok(())
}

Returns all the &str values of the enum members.

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more