#[non_exhaustive]
pub enum CrType {
    Ec2,
    Fargate,
    FargateSpot,
    Spot,
    Unknown(UnknownVariantValue),
}
Expand description

When writing a match expression against CrType, 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 crtype = unimplemented!();
match crtype {
    CrType::Ec2 => { /* ... */ },
    CrType::Fargate => { /* ... */ },
    CrType::FargateSpot => { /* ... */ },
    CrType::Spot => { /* ... */ },
    other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
    _ => { /* ... */ },
}

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

Ec2

§

Fargate

§

FargateSpot

§

Spot

§

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 1220)
1219
1220
1221
    fn as_ref(&self) -> &str {
        self.as_str()
    }
More examples
Hide additional examples
src/json_ser.rs (line 643)
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
pub fn serialize_structure_crate_model_compute_resource(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ComputeResource,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_148) = &input.r#type {
        object.key("type").string(var_148.as_str());
    }
    if let Some(var_149) = &input.allocation_strategy {
        object.key("allocationStrategy").string(var_149.as_str());
    }
    if let Some(var_150) = &input.minv_cpus {
        object.key("minvCpus").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_150).into()),
        );
    }
    if let Some(var_151) = &input.maxv_cpus {
        object.key("maxvCpus").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_151).into()),
        );
    }
    if let Some(var_152) = &input.desiredv_cpus {
        object.key("desiredvCpus").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_152).into()),
        );
    }
    if let Some(var_153) = &input.instance_types {
        let mut array_154 = object.key("instanceTypes").start_array();
        for item_155 in var_153 {
            {
                array_154.value().string(item_155.as_str());
            }
        }
        array_154.finish();
    }
    if let Some(var_156) = &input.image_id {
        object.key("imageId").string(var_156.as_str());
    }
    if let Some(var_157) = &input.subnets {
        let mut array_158 = object.key("subnets").start_array();
        for item_159 in var_157 {
            {
                array_158.value().string(item_159.as_str());
            }
        }
        array_158.finish();
    }
    if let Some(var_160) = &input.security_group_ids {
        let mut array_161 = object.key("securityGroupIds").start_array();
        for item_162 in var_160 {
            {
                array_161.value().string(item_162.as_str());
            }
        }
        array_161.finish();
    }
    if let Some(var_163) = &input.ec2_key_pair {
        object.key("ec2KeyPair").string(var_163.as_str());
    }
    if let Some(var_164) = &input.instance_role {
        object.key("instanceRole").string(var_164.as_str());
    }
    if let Some(var_165) = &input.tags {
        #[allow(unused_mut)]
        let mut object_166 = object.key("tags").start_object();
        for (key_167, value_168) in var_165 {
            {
                object_166.key(key_167.as_str()).string(value_168.as_str());
            }
        }
        object_166.finish();
    }
    if let Some(var_169) = &input.placement_group {
        object.key("placementGroup").string(var_169.as_str());
    }
    if let Some(var_170) = &input.bid_percentage {
        object.key("bidPercentage").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_170).into()),
        );
    }
    if let Some(var_171) = &input.spot_iam_fleet_role {
        object.key("spotIamFleetRole").string(var_171.as_str());
    }
    if let Some(var_172) = &input.launch_template {
        #[allow(unused_mut)]
        let mut object_173 = object.key("launchTemplate").start_object();
        crate::json_ser::serialize_structure_crate_model_launch_template_specification(
            &mut object_173,
            var_172,
        )?;
        object_173.finish();
    }
    if let Some(var_174) = &input.ec2_configuration {
        let mut array_175 = object.key("ec2Configuration").start_array();
        for item_176 in var_174 {
            {
                #[allow(unused_mut)]
                let mut object_177 = array_175.value().start_object();
                crate::json_ser::serialize_structure_crate_model_ec2_configuration(
                    &mut object_177,
                    item_176,
                )?;
                object_177.finish();
            }
        }
        array_175.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_compute_environment_order(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ComputeEnvironmentOrder,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_178) = &input.order {
        object.key("order").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_178).into()),
        );
    }
    if let Some(var_179) = &input.compute_environment {
        object.key("computeEnvironment").string(var_179.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_fairshare_policy(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::FairsharePolicy,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_180) = &input.share_decay_seconds {
        object.key("shareDecaySeconds").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_180).into()),
        );
    }
    if let Some(var_181) = &input.compute_reservation {
        object.key("computeReservation").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_181).into()),
        );
    }
    if let Some(var_182) = &input.share_distribution {
        let mut array_183 = object.key("shareDistribution").start_array();
        for item_184 in var_182 {
            {
                #[allow(unused_mut)]
                let mut object_185 = array_183.value().start_object();
                crate::json_ser::serialize_structure_crate_model_share_attributes(
                    &mut object_185,
                    item_184,
                )?;
                object_185.finish();
            }
        }
        array_183.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_key_values_pair(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::KeyValuesPair,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_186) = &input.name {
        object.key("name").string(var_186.as_str());
    }
    if let Some(var_187) = &input.values {
        let mut array_188 = object.key("values").start_array();
        for item_189 in var_187 {
            {
                array_188.value().string(item_189.as_str());
            }
        }
        array_188.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_container_properties(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ContainerProperties,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_190) = &input.image {
        object.key("image").string(var_190.as_str());
    }
    if let Some(var_191) = &input.vcpus {
        object.key("vcpus").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_191).into()),
        );
    }
    if let Some(var_192) = &input.memory {
        object.key("memory").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_192).into()),
        );
    }
    if let Some(var_193) = &input.command {
        let mut array_194 = object.key("command").start_array();
        for item_195 in var_193 {
            {
                array_194.value().string(item_195.as_str());
            }
        }
        array_194.finish();
    }
    if let Some(var_196) = &input.job_role_arn {
        object.key("jobRoleArn").string(var_196.as_str());
    }
    if let Some(var_197) = &input.execution_role_arn {
        object.key("executionRoleArn").string(var_197.as_str());
    }
    if let Some(var_198) = &input.volumes {
        let mut array_199 = object.key("volumes").start_array();
        for item_200 in var_198 {
            {
                #[allow(unused_mut)]
                let mut object_201 = array_199.value().start_object();
                crate::json_ser::serialize_structure_crate_model_volume(&mut object_201, item_200)?;
                object_201.finish();
            }
        }
        array_199.finish();
    }
    if let Some(var_202) = &input.environment {
        let mut array_203 = object.key("environment").start_array();
        for item_204 in var_202 {
            {
                #[allow(unused_mut)]
                let mut object_205 = array_203.value().start_object();
                crate::json_ser::serialize_structure_crate_model_key_value_pair(
                    &mut object_205,
                    item_204,
                )?;
                object_205.finish();
            }
        }
        array_203.finish();
    }
    if let Some(var_206) = &input.mount_points {
        let mut array_207 = object.key("mountPoints").start_array();
        for item_208 in var_206 {
            {
                #[allow(unused_mut)]
                let mut object_209 = array_207.value().start_object();
                crate::json_ser::serialize_structure_crate_model_mount_point(
                    &mut object_209,
                    item_208,
                )?;
                object_209.finish();
            }
        }
        array_207.finish();
    }
    if let Some(var_210) = &input.readonly_root_filesystem {
        object.key("readonlyRootFilesystem").boolean(*var_210);
    }
    if let Some(var_211) = &input.privileged {
        object.key("privileged").boolean(*var_211);
    }
    if let Some(var_212) = &input.ulimits {
        let mut array_213 = object.key("ulimits").start_array();
        for item_214 in var_212 {
            {
                #[allow(unused_mut)]
                let mut object_215 = array_213.value().start_object();
                crate::json_ser::serialize_structure_crate_model_ulimit(&mut object_215, item_214)?;
                object_215.finish();
            }
        }
        array_213.finish();
    }
    if let Some(var_216) = &input.user {
        object.key("user").string(var_216.as_str());
    }
    if let Some(var_217) = &input.instance_type {
        object.key("instanceType").string(var_217.as_str());
    }
    if let Some(var_218) = &input.resource_requirements {
        let mut array_219 = object.key("resourceRequirements").start_array();
        for item_220 in var_218 {
            {
                #[allow(unused_mut)]
                let mut object_221 = array_219.value().start_object();
                crate::json_ser::serialize_structure_crate_model_resource_requirement(
                    &mut object_221,
                    item_220,
                )?;
                object_221.finish();
            }
        }
        array_219.finish();
    }
    if let Some(var_222) = &input.linux_parameters {
        #[allow(unused_mut)]
        let mut object_223 = object.key("linuxParameters").start_object();
        crate::json_ser::serialize_structure_crate_model_linux_parameters(
            &mut object_223,
            var_222,
        )?;
        object_223.finish();
    }
    if let Some(var_224) = &input.log_configuration {
        #[allow(unused_mut)]
        let mut object_225 = object.key("logConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_log_configuration(
            &mut object_225,
            var_224,
        )?;
        object_225.finish();
    }
    if let Some(var_226) = &input.secrets {
        let mut array_227 = object.key("secrets").start_array();
        for item_228 in var_226 {
            {
                #[allow(unused_mut)]
                let mut object_229 = array_227.value().start_object();
                crate::json_ser::serialize_structure_crate_model_secret(&mut object_229, item_228)?;
                object_229.finish();
            }
        }
        array_227.finish();
    }
    if let Some(var_230) = &input.network_configuration {
        #[allow(unused_mut)]
        let mut object_231 = object.key("networkConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_network_configuration(
            &mut object_231,
            var_230,
        )?;
        object_231.finish();
    }
    if let Some(var_232) = &input.fargate_platform_configuration {
        #[allow(unused_mut)]
        let mut object_233 = object.key("fargatePlatformConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_fargate_platform_configuration(
            &mut object_233,
            var_232,
        )?;
        object_233.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_node_properties(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NodeProperties,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_234) = &input.num_nodes {
        object.key("numNodes").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_234).into()),
        );
    }
    if let Some(var_235) = &input.main_node {
        object.key("mainNode").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_235).into()),
        );
    }
    if let Some(var_236) = &input.node_range_properties {
        let mut array_237 = object.key("nodeRangeProperties").start_array();
        for item_238 in var_236 {
            {
                #[allow(unused_mut)]
                let mut object_239 = array_237.value().start_object();
                crate::json_ser::serialize_structure_crate_model_node_range_property(
                    &mut object_239,
                    item_238,
                )?;
                object_239.finish();
            }
        }
        array_237.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_retry_strategy(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::RetryStrategy,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_240) = &input.attempts {
        object.key("attempts").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_240).into()),
        );
    }
    if let Some(var_241) = &input.evaluate_on_exit {
        let mut array_242 = object.key("evaluateOnExit").start_array();
        for item_243 in var_241 {
            {
                #[allow(unused_mut)]
                let mut object_244 = array_242.value().start_object();
                crate::json_ser::serialize_structure_crate_model_evaluate_on_exit(
                    &mut object_244,
                    item_243,
                )?;
                object_244.finish();
            }
        }
        array_242.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_job_timeout(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::JobTimeout,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_245) = &input.attempt_duration_seconds {
        object.key("attemptDurationSeconds").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_245).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_array_properties(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ArrayProperties,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_246) = &input.size {
        object.key("size").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_246).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_container_overrides(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ContainerOverrides,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_247) = &input.vcpus {
        object.key("vcpus").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_247).into()),
        );
    }
    if let Some(var_248) = &input.memory {
        object.key("memory").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_248).into()),
        );
    }
    if let Some(var_249) = &input.command {
        let mut array_250 = object.key("command").start_array();
        for item_251 in var_249 {
            {
                array_250.value().string(item_251.as_str());
            }
        }
        array_250.finish();
    }
    if let Some(var_252) = &input.instance_type {
        object.key("instanceType").string(var_252.as_str());
    }
    if let Some(var_253) = &input.environment {
        let mut array_254 = object.key("environment").start_array();
        for item_255 in var_253 {
            {
                #[allow(unused_mut)]
                let mut object_256 = array_254.value().start_object();
                crate::json_ser::serialize_structure_crate_model_key_value_pair(
                    &mut object_256,
                    item_255,
                )?;
                object_256.finish();
            }
        }
        array_254.finish();
    }
    if let Some(var_257) = &input.resource_requirements {
        let mut array_258 = object.key("resourceRequirements").start_array();
        for item_259 in var_257 {
            {
                #[allow(unused_mut)]
                let mut object_260 = array_258.value().start_object();
                crate::json_ser::serialize_structure_crate_model_resource_requirement(
                    &mut object_260,
                    item_259,
                )?;
                object_260.finish();
            }
        }
        array_258.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_job_dependency(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::JobDependency,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_261) = &input.job_id {
        object.key("jobId").string(var_261.as_str());
    }
    if let Some(var_262) = &input.r#type {
        object.key("type").string(var_262.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_node_overrides(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NodeOverrides,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_263) = &input.num_nodes {
        object.key("numNodes").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_263).into()),
        );
    }
    if let Some(var_264) = &input.node_property_overrides {
        let mut array_265 = object.key("nodePropertyOverrides").start_array();
        for item_266 in var_264 {
            {
                #[allow(unused_mut)]
                let mut object_267 = array_265.value().start_object();
                crate::json_ser::serialize_structure_crate_model_node_property_override(
                    &mut object_267,
                    item_266,
                )?;
                object_267.finish();
            }
        }
        array_265.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_compute_resource_update(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ComputeResourceUpdate,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_268) = &input.minv_cpus {
        object.key("minvCpus").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_268).into()),
        );
    }
    if let Some(var_269) = &input.maxv_cpus {
        object.key("maxvCpus").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_269).into()),
        );
    }
    if let Some(var_270) = &input.desiredv_cpus {
        object.key("desiredvCpus").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_270).into()),
        );
    }
    if let Some(var_271) = &input.subnets {
        let mut array_272 = object.key("subnets").start_array();
        for item_273 in var_271 {
            {
                array_272.value().string(item_273.as_str());
            }
        }
        array_272.finish();
    }
    if let Some(var_274) = &input.security_group_ids {
        let mut array_275 = object.key("securityGroupIds").start_array();
        for item_276 in var_274 {
            {
                array_275.value().string(item_276.as_str());
            }
        }
        array_275.finish();
    }
    if let Some(var_277) = &input.allocation_strategy {
        object.key("allocationStrategy").string(var_277.as_str());
    }
    if let Some(var_278) = &input.instance_types {
        let mut array_279 = object.key("instanceTypes").start_array();
        for item_280 in var_278 {
            {
                array_279.value().string(item_280.as_str());
            }
        }
        array_279.finish();
    }
    if let Some(var_281) = &input.ec2_key_pair {
        object.key("ec2KeyPair").string(var_281.as_str());
    }
    if let Some(var_282) = &input.instance_role {
        object.key("instanceRole").string(var_282.as_str());
    }
    if let Some(var_283) = &input.tags {
        #[allow(unused_mut)]
        let mut object_284 = object.key("tags").start_object();
        for (key_285, value_286) in var_283 {
            {
                object_284.key(key_285.as_str()).string(value_286.as_str());
            }
        }
        object_284.finish();
    }
    if let Some(var_287) = &input.placement_group {
        object.key("placementGroup").string(var_287.as_str());
    }
    if let Some(var_288) = &input.bid_percentage {
        object.key("bidPercentage").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_288).into()),
        );
    }
    if let Some(var_289) = &input.launch_template {
        #[allow(unused_mut)]
        let mut object_290 = object.key("launchTemplate").start_object();
        crate::json_ser::serialize_structure_crate_model_launch_template_specification(
            &mut object_290,
            var_289,
        )?;
        object_290.finish();
    }
    if let Some(var_291) = &input.ec2_configuration {
        let mut array_292 = object.key("ec2Configuration").start_array();
        for item_293 in var_291 {
            {
                #[allow(unused_mut)]
                let mut object_294 = array_292.value().start_object();
                crate::json_ser::serialize_structure_crate_model_ec2_configuration(
                    &mut object_294,
                    item_293,
                )?;
                object_294.finish();
            }
        }
        array_292.finish();
    }
    if let Some(var_295) = &input.update_to_latest_image_version {
        object.key("updateToLatestImageVersion").boolean(*var_295);
    }
    if let Some(var_296) = &input.r#type {
        object.key("type").string(var_296.as_str());
    }
    if let Some(var_297) = &input.image_id {
        object.key("imageId").string(var_297.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