#[non_exhaustive]
pub enum MaximumExecutionFrequency {
    OneHour,
    SixHours,
    ThreeHours,
    TwelveHours,
    TwentyFourHours,
    Unknown(UnknownVariantValue),
}
Expand description

When writing a match expression against MaximumExecutionFrequency, 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 maximumexecutionfrequency = unimplemented!();
match maximumexecutionfrequency {
    MaximumExecutionFrequency::OneHour => { /* ... */ },
    MaximumExecutionFrequency::SixHours => { /* ... */ },
    MaximumExecutionFrequency::ThreeHours => { /* ... */ },
    MaximumExecutionFrequency::TwelveHours => { /* ... */ },
    MaximumExecutionFrequency::TwentyFourHours => { /* ... */ },
    other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
    _ => { /* ... */ },
}

The above code demonstrates that when maximumexecutionfrequency represents NewFeature, the execution path will lead to the second last match arm, even though the enum does not contain a variant MaximumExecutionFrequency::NewFeature in the current version of SDK. The reason is that the variable other, created by the @ operator, is bound to MaximumExecutionFrequency::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 MaximumExecutionFrequency::NewFeature is defined. Specifically, when maximumexecutionfrequency represents NewFeature, the execution path will hit the second last match arm as before by virtue of calling as_str on MaximumExecutionFrequency::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.
§

OneHour

§

SixHours

§

ThreeHours

§

TwelveHours

§

TwentyFourHours

§

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 3055)
3054
3055
3056
    fn as_ref(&self) -> &str {
        self.as_str()
    }
More examples
Hide additional examples
src/json_ser.rs (line 2273)
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
pub fn serialize_structure_crate_model_config_rule(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ConfigRule,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_387) = &input.config_rule_name {
        object.key("ConfigRuleName").string(var_387.as_str());
    }
    if let Some(var_388) = &input.config_rule_arn {
        object.key("ConfigRuleArn").string(var_388.as_str());
    }
    if let Some(var_389) = &input.config_rule_id {
        object.key("ConfigRuleId").string(var_389.as_str());
    }
    if let Some(var_390) = &input.description {
        object.key("Description").string(var_390.as_str());
    }
    if let Some(var_391) = &input.scope {
        #[allow(unused_mut)]
        let mut object_392 = object.key("Scope").start_object();
        crate::json_ser::serialize_structure_crate_model_scope(&mut object_392, var_391)?;
        object_392.finish();
    }
    if let Some(var_393) = &input.source {
        #[allow(unused_mut)]
        let mut object_394 = object.key("Source").start_object();
        crate::json_ser::serialize_structure_crate_model_source(&mut object_394, var_393)?;
        object_394.finish();
    }
    if let Some(var_395) = &input.input_parameters {
        object.key("InputParameters").string(var_395.as_str());
    }
    if let Some(var_396) = &input.maximum_execution_frequency {
        object
            .key("MaximumExecutionFrequency")
            .string(var_396.as_str());
    }
    if let Some(var_397) = &input.config_rule_state {
        object.key("ConfigRuleState").string(var_397.as_str());
    }
    if let Some(var_398) = &input.created_by {
        object.key("CreatedBy").string(var_398.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_account_aggregation_source(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AccountAggregationSource,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_399) = &input.account_ids {
        let mut array_400 = object.key("AccountIds").start_array();
        for item_401 in var_399 {
            {
                array_400.value().string(item_401.as_str());
            }
        }
        array_400.finish();
    }
    if input.all_aws_regions {
        object.key("AllAwsRegions").boolean(input.all_aws_regions);
    }
    if let Some(var_402) = &input.aws_regions {
        let mut array_403 = object.key("AwsRegions").start_array();
        for item_404 in var_402 {
            {
                array_403.value().string(item_404.as_str());
            }
        }
        array_403.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_organization_aggregation_source(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::OrganizationAggregationSource,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_405) = &input.role_arn {
        object.key("RoleArn").string(var_405.as_str());
    }
    if let Some(var_406) = &input.aws_regions {
        let mut array_407 = object.key("AwsRegions").start_array();
        for item_408 in var_406 {
            {
                array_407.value().string(item_408.as_str());
            }
        }
        array_407.finish();
    }
    if input.all_aws_regions {
        object.key("AllAwsRegions").boolean(input.all_aws_regions);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_configuration_recorder(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ConfigurationRecorder,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_409) = &input.name {
        object.key("name").string(var_409.as_str());
    }
    if let Some(var_410) = &input.role_arn {
        object.key("roleARN").string(var_410.as_str());
    }
    if let Some(var_411) = &input.recording_group {
        #[allow(unused_mut)]
        let mut object_412 = object.key("recordingGroup").start_object();
        crate::json_ser::serialize_structure_crate_model_recording_group(&mut object_412, var_411)?;
        object_412.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_conformance_pack_input_parameter(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ConformancePackInputParameter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_413) = &input.parameter_name {
        object.key("ParameterName").string(var_413.as_str());
    }
    if let Some(var_414) = &input.parameter_value {
        object.key("ParameterValue").string(var_414.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_template_ssm_document_details(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::TemplateSsmDocumentDetails,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_415) = &input.document_name {
        object.key("DocumentName").string(var_415.as_str());
    }
    if let Some(var_416) = &input.document_version {
        object.key("DocumentVersion").string(var_416.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_delivery_channel(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::DeliveryChannel,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_417) = &input.name {
        object.key("name").string(var_417.as_str());
    }
    if let Some(var_418) = &input.s3_bucket_name {
        object.key("s3BucketName").string(var_418.as_str());
    }
    if let Some(var_419) = &input.s3_key_prefix {
        object.key("s3KeyPrefix").string(var_419.as_str());
    }
    if let Some(var_420) = &input.s3_kms_key_arn {
        object.key("s3KmsKeyArn").string(var_420.as_str());
    }
    if let Some(var_421) = &input.sns_topic_arn {
        object.key("snsTopicARN").string(var_421.as_str());
    }
    if let Some(var_422) = &input.config_snapshot_delivery_properties {
        #[allow(unused_mut)]
        let mut object_423 = object
            .key("configSnapshotDeliveryProperties")
            .start_object();
        crate::json_ser::serialize_structure_crate_model_config_snapshot_delivery_properties(
            &mut object_423,
            var_422,
        )?;
        object_423.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_evaluation(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Evaluation,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_424) = &input.compliance_resource_type {
        object
            .key("ComplianceResourceType")
            .string(var_424.as_str());
    }
    if let Some(var_425) = &input.compliance_resource_id {
        object.key("ComplianceResourceId").string(var_425.as_str());
    }
    if let Some(var_426) = &input.compliance_type {
        object.key("ComplianceType").string(var_426.as_str());
    }
    if let Some(var_427) = &input.annotation {
        object.key("Annotation").string(var_427.as_str());
    }
    if let Some(var_428) = &input.ordering_timestamp {
        object
            .key("OrderingTimestamp")
            .date_time(var_428, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    Ok(())
}

pub fn serialize_structure_crate_model_external_evaluation(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ExternalEvaluation,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_429) = &input.compliance_resource_type {
        object
            .key("ComplianceResourceType")
            .string(var_429.as_str());
    }
    if let Some(var_430) = &input.compliance_resource_id {
        object.key("ComplianceResourceId").string(var_430.as_str());
    }
    if let Some(var_431) = &input.compliance_type {
        object.key("ComplianceType").string(var_431.as_str());
    }
    if let Some(var_432) = &input.annotation {
        object.key("Annotation").string(var_432.as_str());
    }
    if let Some(var_433) = &input.ordering_timestamp {
        object
            .key("OrderingTimestamp")
            .date_time(var_433, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    Ok(())
}

pub fn serialize_structure_crate_model_organization_managed_rule_metadata(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::OrganizationManagedRuleMetadata,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_434) = &input.description {
        object.key("Description").string(var_434.as_str());
    }
    if let Some(var_435) = &input.rule_identifier {
        object.key("RuleIdentifier").string(var_435.as_str());
    }
    if let Some(var_436) = &input.input_parameters {
        object.key("InputParameters").string(var_436.as_str());
    }
    if let Some(var_437) = &input.maximum_execution_frequency {
        object
            .key("MaximumExecutionFrequency")
            .string(var_437.as_str());
    }
    if let Some(var_438) = &input.resource_types_scope {
        let mut array_439 = object.key("ResourceTypesScope").start_array();
        for item_440 in var_438 {
            {
                array_439.value().string(item_440.as_str());
            }
        }
        array_439.finish();
    }
    if let Some(var_441) = &input.resource_id_scope {
        object.key("ResourceIdScope").string(var_441.as_str());
    }
    if let Some(var_442) = &input.tag_key_scope {
        object.key("TagKeyScope").string(var_442.as_str());
    }
    if let Some(var_443) = &input.tag_value_scope {
        object.key("TagValueScope").string(var_443.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_organization_custom_rule_metadata(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::OrganizationCustomRuleMetadata,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_444) = &input.description {
        object.key("Description").string(var_444.as_str());
    }
    if let Some(var_445) = &input.lambda_function_arn {
        object.key("LambdaFunctionArn").string(var_445.as_str());
    }
    if let Some(var_446) = &input.organization_config_rule_trigger_types {
        let mut array_447 = object
            .key("OrganizationConfigRuleTriggerTypes")
            .start_array();
        for item_448 in var_446 {
            {
                array_447.value().string(item_448.as_str());
            }
        }
        array_447.finish();
    }
    if let Some(var_449) = &input.input_parameters {
        object.key("InputParameters").string(var_449.as_str());
    }
    if let Some(var_450) = &input.maximum_execution_frequency {
        object
            .key("MaximumExecutionFrequency")
            .string(var_450.as_str());
    }
    if let Some(var_451) = &input.resource_types_scope {
        let mut array_452 = object.key("ResourceTypesScope").start_array();
        for item_453 in var_451 {
            {
                array_452.value().string(item_453.as_str());
            }
        }
        array_452.finish();
    }
    if let Some(var_454) = &input.resource_id_scope {
        object.key("ResourceIdScope").string(var_454.as_str());
    }
    if let Some(var_455) = &input.tag_key_scope {
        object.key("TagKeyScope").string(var_455.as_str());
    }
    if let Some(var_456) = &input.tag_value_scope {
        object.key("TagValueScope").string(var_456.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_organization_custom_policy_rule_metadata(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::OrganizationCustomPolicyRuleMetadata,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_457) = &input.description {
        object.key("Description").string(var_457.as_str());
    }
    if let Some(var_458) = &input.organization_config_rule_trigger_types {
        let mut array_459 = object
            .key("OrganizationConfigRuleTriggerTypes")
            .start_array();
        for item_460 in var_458 {
            {
                array_459.value().string(item_460.as_str());
            }
        }
        array_459.finish();
    }
    if let Some(var_461) = &input.input_parameters {
        object.key("InputParameters").string(var_461.as_str());
    }
    if let Some(var_462) = &input.maximum_execution_frequency {
        object
            .key("MaximumExecutionFrequency")
            .string(var_462.as_str());
    }
    if let Some(var_463) = &input.resource_types_scope {
        let mut array_464 = object.key("ResourceTypesScope").start_array();
        for item_465 in var_463 {
            {
                array_464.value().string(item_465.as_str());
            }
        }
        array_464.finish();
    }
    if let Some(var_466) = &input.resource_id_scope {
        object.key("ResourceIdScope").string(var_466.as_str());
    }
    if let Some(var_467) = &input.tag_key_scope {
        object.key("TagKeyScope").string(var_467.as_str());
    }
    if let Some(var_468) = &input.tag_value_scope {
        object.key("TagValueScope").string(var_468.as_str());
    }
    if let Some(var_469) = &input.policy_runtime {
        object.key("PolicyRuntime").string(var_469.as_str());
    }
    if let Some(var_470) = &input.policy_text {
        object.key("PolicyText").string(var_470.as_str());
    }
    if let Some(var_471) = &input.debug_log_delivery_accounts {
        let mut array_472 = object.key("DebugLogDeliveryAccounts").start_array();
        for item_473 in var_471 {
            {
                array_472.value().string(item_473.as_str());
            }
        }
        array_472.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_remediation_configuration(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::RemediationConfiguration,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_474) = &input.config_rule_name {
        object.key("ConfigRuleName").string(var_474.as_str());
    }
    if let Some(var_475) = &input.target_type {
        object.key("TargetType").string(var_475.as_str());
    }
    if let Some(var_476) = &input.target_id {
        object.key("TargetId").string(var_476.as_str());
    }
    if let Some(var_477) = &input.target_version {
        object.key("TargetVersion").string(var_477.as_str());
    }
    if let Some(var_478) = &input.parameters {
        #[allow(unused_mut)]
        let mut object_479 = object.key("Parameters").start_object();
        for (key_480, value_481) in var_478 {
            {
                #[allow(unused_mut)]
                let mut object_482 = object_479.key(key_480.as_str()).start_object();
                crate::json_ser::serialize_structure_crate_model_remediation_parameter_value(
                    &mut object_482,
                    value_481,
                )?;
                object_482.finish();
            }
        }
        object_479.finish();
    }
    if let Some(var_483) = &input.resource_type {
        object.key("ResourceType").string(var_483.as_str());
    }
    if input.automatic {
        object.key("Automatic").boolean(input.automatic);
    }
    if let Some(var_484) = &input.execution_controls {
        #[allow(unused_mut)]
        let mut object_485 = object.key("ExecutionControls").start_object();
        crate::json_ser::serialize_structure_crate_model_execution_controls(
            &mut object_485,
            var_484,
        )?;
        object_485.finish();
    }
    if let Some(var_486) = &input.maximum_automatic_attempts {
        object.key("MaximumAutomaticAttempts").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_486).into()),
        );
    }
    if let Some(var_487) = &input.retry_attempt_seconds {
        object.key("RetryAttemptSeconds").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_487).into()),
        );
    }
    if let Some(var_488) = &input.arn {
        object.key("Arn").string(var_488.as_str());
    }
    if let Some(var_489) = &input.created_by_service {
        object.key("CreatedByService").string(var_489.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_stored_query(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::StoredQuery,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_490) = &input.query_id {
        object.key("QueryId").string(var_490.as_str());
    }
    if let Some(var_491) = &input.query_arn {
        object.key("QueryArn").string(var_491.as_str());
    }
    if let Some(var_492) = &input.query_name {
        object.key("QueryName").string(var_492.as_str());
    }
    if let Some(var_493) = &input.description {
        object.key("Description").string(var_493.as_str());
    }
    if let Some(var_494) = &input.expression {
        object.key("Expression").string(var_494.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_scope(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Scope,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_495) = &input.compliance_resource_types {
        let mut array_496 = object.key("ComplianceResourceTypes").start_array();
        for item_497 in var_495 {
            {
                array_496.value().string(item_497.as_str());
            }
        }
        array_496.finish();
    }
    if let Some(var_498) = &input.tag_key {
        object.key("TagKey").string(var_498.as_str());
    }
    if let Some(var_499) = &input.tag_value {
        object.key("TagValue").string(var_499.as_str());
    }
    if let Some(var_500) = &input.compliance_resource_id {
        object.key("ComplianceResourceId").string(var_500.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_source(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Source,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_501) = &input.owner {
        object.key("Owner").string(var_501.as_str());
    }
    if let Some(var_502) = &input.source_identifier {
        object.key("SourceIdentifier").string(var_502.as_str());
    }
    if let Some(var_503) = &input.source_details {
        let mut array_504 = object.key("SourceDetails").start_array();
        for item_505 in var_503 {
            {
                #[allow(unused_mut)]
                let mut object_506 = array_504.value().start_object();
                crate::json_ser::serialize_structure_crate_model_source_detail(
                    &mut object_506,
                    item_505,
                )?;
                object_506.finish();
            }
        }
        array_504.finish();
    }
    if let Some(var_507) = &input.custom_policy_details {
        #[allow(unused_mut)]
        let mut object_508 = object.key("CustomPolicyDetails").start_object();
        crate::json_ser::serialize_structure_crate_model_custom_policy_details(
            &mut object_508,
            var_507,
        )?;
        object_508.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_recording_group(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::RecordingGroup,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if input.all_supported {
        object.key("allSupported").boolean(input.all_supported);
    }
    if input.include_global_resource_types {
        object
            .key("includeGlobalResourceTypes")
            .boolean(input.include_global_resource_types);
    }
    if let Some(var_509) = &input.resource_types {
        let mut array_510 = object.key("resourceTypes").start_array();
        for item_511 in var_509 {
            {
                array_510.value().string(item_511.as_str());
            }
        }
        array_510.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_config_snapshot_delivery_properties(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ConfigSnapshotDeliveryProperties,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_512) = &input.delivery_frequency {
        object.key("deliveryFrequency").string(var_512.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_remediation_parameter_value(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::RemediationParameterValue,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_513) = &input.resource_value {
        #[allow(unused_mut)]
        let mut object_514 = object.key("ResourceValue").start_object();
        crate::json_ser::serialize_structure_crate_model_resource_value(&mut object_514, var_513)?;
        object_514.finish();
    }
    if let Some(var_515) = &input.static_value {
        #[allow(unused_mut)]
        let mut object_516 = object.key("StaticValue").start_object();
        crate::json_ser::serialize_structure_crate_model_static_value(&mut object_516, var_515)?;
        object_516.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_execution_controls(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ExecutionControls,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_517) = &input.ssm_controls {
        #[allow(unused_mut)]
        let mut object_518 = object.key("SsmControls").start_object();
        crate::json_ser::serialize_structure_crate_model_ssm_controls(&mut object_518, var_517)?;
        object_518.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_source_detail(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SourceDetail,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_519) = &input.event_source {
        object.key("EventSource").string(var_519.as_str());
    }
    if let Some(var_520) = &input.message_type {
        object.key("MessageType").string(var_520.as_str());
    }
    if let Some(var_521) = &input.maximum_execution_frequency {
        object
            .key("MaximumExecutionFrequency")
            .string(var_521.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