#[non_exhaustive]
pub enum S3ObjectLockLegalHoldStatus {
    Off,
    On,
    Unknown(UnknownVariantValue),
}
Expand description

When writing a match expression against S3ObjectLockLegalHoldStatus, 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 s3objectlocklegalholdstatus = unimplemented!();
match s3objectlocklegalholdstatus {
    S3ObjectLockLegalHoldStatus::Off => { /* ... */ },
    S3ObjectLockLegalHoldStatus::On => { /* ... */ },
    other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
    _ => { /* ... */ },
}

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

Off

§

On

§

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 9124)
9123
9124
9125
    fn as_ref(&self) -> &str {
        self.as_str()
    }
More examples
Hide additional examples
src/xml_ser.rs (line 1009)
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
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
pub fn serialize_structure_crate_model_s3_copy_object_operation(
    input: &crate::model::S3CopyObjectOperation,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_93) = &input.target_resource {
        let mut inner_writer = scope.start_el("TargetResource").finish();
        inner_writer.data(var_93.as_str());
    }
    if let Some(var_94) = &input.canned_access_control_list {
        let mut inner_writer = scope.start_el("CannedAccessControlList").finish();
        inner_writer.data(var_94.as_str());
    }
    if let Some(var_95) = &input.access_control_grants {
        let mut inner_writer = scope.start_el("AccessControlGrants").finish();
        for list_item_96 in var_95 {
            {
                let inner_writer = inner_writer.start_el("member");
                crate::xml_ser::serialize_structure_crate_model_s3_grant(
                    list_item_96,
                    inner_writer,
                )?
            }
        }
    }
    if let Some(var_97) = &input.metadata_directive {
        let mut inner_writer = scope.start_el("MetadataDirective").finish();
        inner_writer.data(var_97.as_str());
    }
    if let Some(var_98) = &input.modified_since_constraint {
        let mut inner_writer = scope.start_el("ModifiedSinceConstraint").finish();
        inner_writer.data(
            var_98
                .fmt(aws_smithy_types::date_time::Format::DateTime)?
                .as_ref(),
        );
    }
    if let Some(var_99) = &input.new_object_metadata {
        let inner_writer = scope.start_el("NewObjectMetadata");
        crate::xml_ser::serialize_structure_crate_model_s3_object_metadata(var_99, inner_writer)?
    }
    if let Some(var_100) = &input.new_object_tagging {
        let mut inner_writer = scope.start_el("NewObjectTagging").finish();
        for list_item_101 in var_100 {
            {
                let inner_writer = inner_writer.start_el("member");
                crate::xml_ser::serialize_structure_crate_model_s3_tag(list_item_101, inner_writer)?
            }
        }
    }
    if let Some(var_102) = &input.redirect_location {
        let mut inner_writer = scope.start_el("RedirectLocation").finish();
        inner_writer.data(var_102.as_str());
    }
    if input.requester_pays {
        let mut inner_writer = scope.start_el("RequesterPays").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.requester_pays).encode());
    }
    if let Some(var_103) = &input.storage_class {
        let mut inner_writer = scope.start_el("StorageClass").finish();
        inner_writer.data(var_103.as_str());
    }
    if let Some(var_104) = &input.un_modified_since_constraint {
        let mut inner_writer = scope.start_el("UnModifiedSinceConstraint").finish();
        inner_writer.data(
            var_104
                .fmt(aws_smithy_types::date_time::Format::DateTime)?
                .as_ref(),
        );
    }
    if let Some(var_105) = &input.sse_aws_kms_key_id {
        let mut inner_writer = scope.start_el("SSEAwsKmsKeyId").finish();
        inner_writer.data(var_105.as_str());
    }
    if let Some(var_106) = &input.target_key_prefix {
        let mut inner_writer = scope.start_el("TargetKeyPrefix").finish();
        inner_writer.data(var_106.as_str());
    }
    if let Some(var_107) = &input.object_lock_legal_hold_status {
        let mut inner_writer = scope.start_el("ObjectLockLegalHoldStatus").finish();
        inner_writer.data(var_107.as_str());
    }
    if let Some(var_108) = &input.object_lock_mode {
        let mut inner_writer = scope.start_el("ObjectLockMode").finish();
        inner_writer.data(var_108.as_str());
    }
    if let Some(var_109) = &input.object_lock_retain_until_date {
        let mut inner_writer = scope.start_el("ObjectLockRetainUntilDate").finish();
        inner_writer.data(
            var_109
                .fmt(aws_smithy_types::date_time::Format::DateTime)?
                .as_ref(),
        );
    }
    if input.bucket_key_enabled {
        let mut inner_writer = scope.start_el("BucketKeyEnabled").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.bucket_key_enabled).encode());
    }
    if let Some(var_110) = &input.checksum_algorithm {
        let mut inner_writer = scope.start_el("ChecksumAlgorithm").finish();
        inner_writer.data(var_110.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_s3_set_object_acl_operation(
    input: &crate::model::S3SetObjectAclOperation,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_111) = &input.access_control_policy {
        let inner_writer = scope.start_el("AccessControlPolicy");
        crate::xml_ser::serialize_structure_crate_model_s3_access_control_policy(
            var_111,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_s3_set_object_tagging_operation(
    input: &crate::model::S3SetObjectTaggingOperation,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_112) = &input.tag_set {
        let mut inner_writer = scope.start_el("TagSet").finish();
        for list_item_113 in var_112 {
            {
                let inner_writer = inner_writer.start_el("member");
                crate::xml_ser::serialize_structure_crate_model_s3_tag(list_item_113, inner_writer)?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_s3_initiate_restore_object_operation(
    input: &crate::model::S3InitiateRestoreObjectOperation,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_114) = &input.expiration_in_days {
        let mut inner_writer = scope.start_el("ExpirationInDays").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(*var_114).encode());
    }
    if let Some(var_115) = &input.glacier_job_tier {
        let mut inner_writer = scope.start_el("GlacierJobTier").finish();
        inner_writer.data(var_115.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_s3_set_object_legal_hold_operation(
    input: &crate::model::S3SetObjectLegalHoldOperation,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_116) = &input.legal_hold {
        let inner_writer = scope.start_el("LegalHold");
        crate::xml_ser::serialize_structure_crate_model_s3_object_lock_legal_hold(
            var_116,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_s3_set_object_retention_operation(
    input: &crate::model::S3SetObjectRetentionOperation,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_117) = &input.bypass_governance_retention {
        let mut inner_writer = scope.start_el("BypassGovernanceRetention").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(*var_117).encode());
    }
    if let Some(var_118) = &input.retention {
        let inner_writer = scope.start_el("Retention");
        crate::xml_ser::serialize_structure_crate_model_s3_retention(var_118, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_region(
    input: &crate::model::Region,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_119) = &input.bucket {
        let mut inner_writer = scope.start_el("Bucket").finish();
        inner_writer.data(var_119.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_lifecycle_rule(
    input: &crate::model::LifecycleRule,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_120) = &input.expiration {
        let inner_writer = scope.start_el("Expiration");
        crate::xml_ser::serialize_structure_crate_model_lifecycle_expiration(var_120, inner_writer)?
    }
    if let Some(var_121) = &input.id {
        let mut inner_writer = scope.start_el("ID").finish();
        inner_writer.data(var_121.as_str());
    }
    if let Some(var_122) = &input.filter {
        let inner_writer = scope.start_el("Filter");
        crate::xml_ser::serialize_structure_crate_model_lifecycle_rule_filter(
            var_122,
            inner_writer,
        )?
    }
    if let Some(var_123) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_123.as_str());
    }
    if let Some(var_124) = &input.transitions {
        let mut inner_writer = scope.start_el("Transitions").finish();
        for list_item_125 in var_124 {
            {
                let inner_writer = inner_writer.start_el("Transition");
                crate::xml_ser::serialize_structure_crate_model_transition(
                    list_item_125,
                    inner_writer,
                )?
            }
        }
    }
    if let Some(var_126) = &input.noncurrent_version_transitions {
        let mut inner_writer = scope.start_el("NoncurrentVersionTransitions").finish();
        for list_item_127 in var_126 {
            {
                let inner_writer = inner_writer.start_el("NoncurrentVersionTransition");
                crate::xml_ser::serialize_structure_crate_model_noncurrent_version_transition(
                    list_item_127,
                    inner_writer,
                )?
            }
        }
    }
    if let Some(var_128) = &input.noncurrent_version_expiration {
        let inner_writer = scope.start_el("NoncurrentVersionExpiration");
        crate::xml_ser::serialize_structure_crate_model_noncurrent_version_expiration(
            var_128,
            inner_writer,
        )?
    }
    if let Some(var_129) = &input.abort_incomplete_multipart_upload {
        let inner_writer = scope.start_el("AbortIncompleteMultipartUpload");
        crate::xml_ser::serialize_structure_crate_model_abort_incomplete_multipart_upload(
            var_129,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_account_level(
    input: &crate::model::AccountLevel,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_130) = &input.activity_metrics {
        let inner_writer = scope.start_el("ActivityMetrics");
        crate::xml_ser::serialize_structure_crate_model_activity_metrics(var_130, inner_writer)?
    }
    if let Some(var_131) = &input.bucket_level {
        let inner_writer = scope.start_el("BucketLevel");
        crate::xml_ser::serialize_structure_crate_model_bucket_level(var_131, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_include(
    input: &crate::model::Include,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_132) = &input.buckets {
        let mut inner_writer = scope.start_el("Buckets").finish();
        for list_item_133 in var_132 {
            {
                let mut inner_writer = inner_writer.start_el("Arn").finish();
                inner_writer.data(list_item_133.as_str());
            }
        }
    }
    if let Some(var_134) = &input.regions {
        let mut inner_writer = scope.start_el("Regions").finish();
        for list_item_135 in var_134 {
            {
                let mut inner_writer = inner_writer.start_el("Region").finish();
                inner_writer.data(list_item_135.as_str());
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_exclude(
    input: &crate::model::Exclude,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_136) = &input.buckets {
        let mut inner_writer = scope.start_el("Buckets").finish();
        for list_item_137 in var_136 {
            {
                let mut inner_writer = inner_writer.start_el("Arn").finish();
                inner_writer.data(list_item_137.as_str());
            }
        }
    }
    if let Some(var_138) = &input.regions {
        let mut inner_writer = scope.start_el("Regions").finish();
        for list_item_139 in var_138 {
            {
                let mut inner_writer = inner_writer.start_el("Region").finish();
                inner_writer.data(list_item_139.as_str());
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_storage_lens_data_export(
    input: &crate::model::StorageLensDataExport,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_140) = &input.s3_bucket_destination {
        let inner_writer = scope.start_el("S3BucketDestination");
        crate::xml_ser::serialize_structure_crate_model_s3_bucket_destination(
            var_140,
            inner_writer,
        )?
    }
    if let Some(var_141) = &input.cloud_watch_metrics {
        let inner_writer = scope.start_el("CloudWatchMetrics");
        crate::xml_ser::serialize_structure_crate_model_cloud_watch_metrics(var_141, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_storage_lens_aws_org(
    input: &crate::model::StorageLensAwsOrg,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_142) = &input.arn {
        let mut inner_writer = scope.start_el("Arn").finish();
        inner_writer.data(var_142.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_union_crate_model_object_lambda_content_transformation(
    input: &crate::model::ObjectLambdaContentTransformation,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    let mut scope_writer = writer.finish();
    match input {
        crate::model::ObjectLambdaContentTransformation::AwsLambda(inner) => {
            let inner_writer = scope_writer.start_el("AwsLambda");
            crate::xml_ser::serialize_structure_crate_model_aws_lambda_transformation(
                inner,
                inner_writer,
            )?
        }
        crate::model::ObjectLambdaContentTransformation::Unknown => {
            return Err(
                aws_smithy_http::operation::error::SerializationError::unknown_variant(
                    "ObjectLambdaContentTransformation",
                ),
            )
        }
    }
    Ok(())
}

pub fn serialize_structure_crate_model_s3_manifest_output_location(
    input: &crate::model::S3ManifestOutputLocation,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_143) = &input.expected_manifest_bucket_owner {
        let mut inner_writer = scope.start_el("ExpectedManifestBucketOwner").finish();
        inner_writer.data(var_143.as_str());
    }
    if let Some(var_144) = &input.bucket {
        let mut inner_writer = scope.start_el("Bucket").finish();
        inner_writer.data(var_144.as_str());
    }
    if let Some(var_145) = &input.manifest_prefix {
        let mut inner_writer = scope.start_el("ManifestPrefix").finish();
        inner_writer.data(var_145.as_str());
    }
    if let Some(var_146) = &input.manifest_encryption {
        let inner_writer = scope.start_el("ManifestEncryption");
        crate::xml_ser::serialize_structure_crate_model_generated_manifest_encryption(
            var_146,
            inner_writer,
        )?
    }
    if let Some(var_147) = &input.manifest_format {
        let mut inner_writer = scope.start_el("ManifestFormat").finish();
        inner_writer.data(var_147.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_job_manifest_generator_filter(
    input: &crate::model::JobManifestGeneratorFilter,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_148) = &input.eligible_for_replication {
        let mut inner_writer = scope.start_el("EligibleForReplication").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(*var_148).encode());
    }
    if let Some(var_149) = &input.created_after {
        let mut inner_writer = scope.start_el("CreatedAfter").finish();
        inner_writer.data(
            var_149
                .fmt(aws_smithy_types::date_time::Format::DateTime)?
                .as_ref(),
        );
    }
    if let Some(var_150) = &input.created_before {
        let mut inner_writer = scope.start_el("CreatedBefore").finish();
        inner_writer.data(
            var_150
                .fmt(aws_smithy_types::date_time::Format::DateTime)?
                .as_ref(),
        );
    }
    if let Some(var_151) = &input.object_replication_statuses {
        let mut inner_writer = scope.start_el("ObjectReplicationStatuses").finish();
        for list_item_152 in var_151 {
            {
                let mut inner_writer = inner_writer.start_el("member").finish();
                inner_writer.data(list_item_152.as_str());
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_s3_grant(
    input: &crate::model::S3Grant,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_153) = &input.grantee {
        let inner_writer = scope.start_el("Grantee");
        crate::xml_ser::serialize_structure_crate_model_s3_grantee(var_153, inner_writer)?
    }
    if let Some(var_154) = &input.permission {
        let mut inner_writer = scope.start_el("Permission").finish();
        inner_writer.data(var_154.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_s3_object_metadata(
    input: &crate::model::S3ObjectMetadata,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_155) = &input.cache_control {
        let mut inner_writer = scope.start_el("CacheControl").finish();
        inner_writer.data(var_155.as_str());
    }
    if let Some(var_156) = &input.content_disposition {
        let mut inner_writer = scope.start_el("ContentDisposition").finish();
        inner_writer.data(var_156.as_str());
    }
    if let Some(var_157) = &input.content_encoding {
        let mut inner_writer = scope.start_el("ContentEncoding").finish();
        inner_writer.data(var_157.as_str());
    }
    if let Some(var_158) = &input.content_language {
        let mut inner_writer = scope.start_el("ContentLanguage").finish();
        inner_writer.data(var_158.as_str());
    }
    if let Some(var_159) = &input.user_metadata {
        let mut inner_writer = scope.start_el("UserMetadata").finish();
        for (key_160, value_161) in var_159 {
            let mut entry = inner_writer.start_el("entry").finish();
            {
                let mut inner_writer = entry.start_el("key").finish();
                inner_writer.data(key_160.as_str());
            }
            {
                let mut inner_writer = entry.start_el("value").finish();
                inner_writer.data(value_161.as_str());
            }
        }
    }
    if let Some(var_162) = &input.content_length {
        let mut inner_writer = scope.start_el("ContentLength").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(*var_162).encode());
    }
    if let Some(var_163) = &input.content_md5 {
        let mut inner_writer = scope.start_el("ContentMD5").finish();
        inner_writer.data(var_163.as_str());
    }
    if let Some(var_164) = &input.content_type {
        let mut inner_writer = scope.start_el("ContentType").finish();
        inner_writer.data(var_164.as_str());
    }
    if let Some(var_165) = &input.http_expires_date {
        let mut inner_writer = scope.start_el("HttpExpiresDate").finish();
        inner_writer.data(
            var_165
                .fmt(aws_smithy_types::date_time::Format::DateTime)?
                .as_ref(),
        );
    }
    if input.requester_charged {
        let mut inner_writer = scope.start_el("RequesterCharged").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.requester_charged).encode());
    }
    if let Some(var_166) = &input.sse_algorithm {
        let mut inner_writer = scope.start_el("SSEAlgorithm").finish();
        inner_writer.data(var_166.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_s3_access_control_policy(
    input: &crate::model::S3AccessControlPolicy,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_167) = &input.access_control_list {
        let inner_writer = scope.start_el("AccessControlList");
        crate::xml_ser::serialize_structure_crate_model_s3_access_control_list(
            var_167,
            inner_writer,
        )?
    }
    if let Some(var_168) = &input.canned_access_control_list {
        let mut inner_writer = scope.start_el("CannedAccessControlList").finish();
        inner_writer.data(var_168.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_s3_object_lock_legal_hold(
    input: &crate::model::S3ObjectLockLegalHold,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_169) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_169.as_str());
    }
    scope.finish();
    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