#[non_exhaustive]
pub enum AgentStatusState {
    Disabled,
    Enabled,
    Unknown(UnknownVariantValue),
}
Expand description

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

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

Disabled

§

Enabled

§

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 4333)
4332
4333
4334
    fn as_ref(&self) -> &str {
        self.as_str()
    }
More examples
Hide additional examples
src/json_ser.rs (line 190)
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
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
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
1532
1533
1534
1535
1536
1537
1538
1539
pub fn serialize_structure_crate_input_create_agent_status_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateAgentStatusInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_31) = &input.description {
        object.key("Description").string(var_31.as_str());
    }
    if let Some(var_32) = &input.display_order {
        object.key("DisplayOrder").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_32).into()),
        );
    }
    if let Some(var_33) = &input.name {
        object.key("Name").string(var_33.as_str());
    }
    if let Some(var_34) = &input.state {
        object.key("State").string(var_34.as_str());
    }
    if let Some(var_35) = &input.tags {
        #[allow(unused_mut)]
        let mut object_36 = object.key("Tags").start_object();
        for (key_37, value_38) in var_35 {
            {
                object_36.key(key_37.as_str()).string(value_38.as_str());
            }
        }
        object_36.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_contact_flow_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateContactFlowInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_39) = &input.content {
        object.key("Content").string(var_39.as_str());
    }
    if let Some(var_40) = &input.description {
        object.key("Description").string(var_40.as_str());
    }
    if let Some(var_41) = &input.name {
        object.key("Name").string(var_41.as_str());
    }
    if let Some(var_42) = &input.tags {
        #[allow(unused_mut)]
        let mut object_43 = object.key("Tags").start_object();
        for (key_44, value_45) in var_42 {
            {
                object_43.key(key_44.as_str()).string(value_45.as_str());
            }
        }
        object_43.finish();
    }
    if let Some(var_46) = &input.r#type {
        object.key("Type").string(var_46.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_contact_flow_module_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateContactFlowModuleInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_47) = &input.client_token {
        object.key("ClientToken").string(var_47.as_str());
    }
    if let Some(var_48) = &input.content {
        object.key("Content").string(var_48.as_str());
    }
    if let Some(var_49) = &input.description {
        object.key("Description").string(var_49.as_str());
    }
    if let Some(var_50) = &input.name {
        object.key("Name").string(var_50.as_str());
    }
    if let Some(var_51) = &input.tags {
        #[allow(unused_mut)]
        let mut object_52 = object.key("Tags").start_object();
        for (key_53, value_54) in var_51 {
            {
                object_52.key(key_53.as_str()).string(value_54.as_str());
            }
        }
        object_52.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_hours_of_operation_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateHoursOfOperationInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_55) = &input.config {
        let mut array_56 = object.key("Config").start_array();
        for item_57 in var_55 {
            {
                #[allow(unused_mut)]
                let mut object_58 = array_56.value().start_object();
                crate::json_ser::serialize_structure_crate_model_hours_of_operation_config(
                    &mut object_58,
                    item_57,
                )?;
                object_58.finish();
            }
        }
        array_56.finish();
    }
    if let Some(var_59) = &input.description {
        object.key("Description").string(var_59.as_str());
    }
    if let Some(var_60) = &input.name {
        object.key("Name").string(var_60.as_str());
    }
    if let Some(var_61) = &input.tags {
        #[allow(unused_mut)]
        let mut object_62 = object.key("Tags").start_object();
        for (key_63, value_64) in var_61 {
            {
                object_62.key(key_63.as_str()).string(value_64.as_str());
            }
        }
        object_62.finish();
    }
    if let Some(var_65) = &input.time_zone {
        object.key("TimeZone").string(var_65.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_instance_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateInstanceInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_66) = &input.client_token {
        object.key("ClientToken").string(var_66.as_str());
    }
    if let Some(var_67) = &input.directory_id {
        object.key("DirectoryId").string(var_67.as_str());
    }
    if let Some(var_68) = &input.identity_management_type {
        object.key("IdentityManagementType").string(var_68.as_str());
    }
    if let Some(var_69) = &input.inbound_calls_enabled {
        object.key("InboundCallsEnabled").boolean(*var_69);
    }
    if let Some(var_70) = &input.instance_alias {
        object.key("InstanceAlias").string(var_70.as_str());
    }
    if let Some(var_71) = &input.outbound_calls_enabled {
        object.key("OutboundCallsEnabled").boolean(*var_71);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_integration_association_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateIntegrationAssociationInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_72) = &input.integration_arn {
        object.key("IntegrationArn").string(var_72.as_str());
    }
    if let Some(var_73) = &input.integration_type {
        object.key("IntegrationType").string(var_73.as_str());
    }
    if let Some(var_74) = &input.source_application_name {
        object.key("SourceApplicationName").string(var_74.as_str());
    }
    if let Some(var_75) = &input.source_application_url {
        object.key("SourceApplicationUrl").string(var_75.as_str());
    }
    if let Some(var_76) = &input.source_type {
        object.key("SourceType").string(var_76.as_str());
    }
    if let Some(var_77) = &input.tags {
        #[allow(unused_mut)]
        let mut object_78 = object.key("Tags").start_object();
        for (key_79, value_80) in var_77 {
            {
                object_78.key(key_79.as_str()).string(value_80.as_str());
            }
        }
        object_78.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_queue_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateQueueInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_81) = &input.description {
        object.key("Description").string(var_81.as_str());
    }
    if let Some(var_82) = &input.hours_of_operation_id {
        object.key("HoursOfOperationId").string(var_82.as_str());
    }
    if let Some(var_83) = &input.max_contacts {
        object.key("MaxContacts").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_83).into()),
        );
    }
    if let Some(var_84) = &input.name {
        object.key("Name").string(var_84.as_str());
    }
    if let Some(var_85) = &input.outbound_caller_config {
        #[allow(unused_mut)]
        let mut object_86 = object.key("OutboundCallerConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_outbound_caller_config(
            &mut object_86,
            var_85,
        )?;
        object_86.finish();
    }
    if let Some(var_87) = &input.quick_connect_ids {
        let mut array_88 = object.key("QuickConnectIds").start_array();
        for item_89 in var_87 {
            {
                array_88.value().string(item_89.as_str());
            }
        }
        array_88.finish();
    }
    if let Some(var_90) = &input.tags {
        #[allow(unused_mut)]
        let mut object_91 = object.key("Tags").start_object();
        for (key_92, value_93) in var_90 {
            {
                object_91.key(key_92.as_str()).string(value_93.as_str());
            }
        }
        object_91.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_quick_connect_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateQuickConnectInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_94) = &input.description {
        object.key("Description").string(var_94.as_str());
    }
    if let Some(var_95) = &input.name {
        object.key("Name").string(var_95.as_str());
    }
    if let Some(var_96) = &input.quick_connect_config {
        #[allow(unused_mut)]
        let mut object_97 = object.key("QuickConnectConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_quick_connect_config(
            &mut object_97,
            var_96,
        )?;
        object_97.finish();
    }
    if let Some(var_98) = &input.tags {
        #[allow(unused_mut)]
        let mut object_99 = object.key("Tags").start_object();
        for (key_100, value_101) in var_98 {
            {
                object_99.key(key_100.as_str()).string(value_101.as_str());
            }
        }
        object_99.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_routing_profile_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateRoutingProfileInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_102) = &input.default_outbound_queue_id {
        object
            .key("DefaultOutboundQueueId")
            .string(var_102.as_str());
    }
    if let Some(var_103) = &input.description {
        object.key("Description").string(var_103.as_str());
    }
    if let Some(var_104) = &input.media_concurrencies {
        let mut array_105 = object.key("MediaConcurrencies").start_array();
        for item_106 in var_104 {
            {
                #[allow(unused_mut)]
                let mut object_107 = array_105.value().start_object();
                crate::json_ser::serialize_structure_crate_model_media_concurrency(
                    &mut object_107,
                    item_106,
                )?;
                object_107.finish();
            }
        }
        array_105.finish();
    }
    if let Some(var_108) = &input.name {
        object.key("Name").string(var_108.as_str());
    }
    if let Some(var_109) = &input.queue_configs {
        let mut array_110 = object.key("QueueConfigs").start_array();
        for item_111 in var_109 {
            {
                #[allow(unused_mut)]
                let mut object_112 = array_110.value().start_object();
                crate::json_ser::serialize_structure_crate_model_routing_profile_queue_config(
                    &mut object_112,
                    item_111,
                )?;
                object_112.finish();
            }
        }
        array_110.finish();
    }
    if let Some(var_113) = &input.tags {
        #[allow(unused_mut)]
        let mut object_114 = object.key("Tags").start_object();
        for (key_115, value_116) in var_113 {
            {
                object_114.key(key_115.as_str()).string(value_116.as_str());
            }
        }
        object_114.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_security_profile_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateSecurityProfileInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_117) = &input.description {
        object.key("Description").string(var_117.as_str());
    }
    if let Some(var_118) = &input.permissions {
        let mut array_119 = object.key("Permissions").start_array();
        for item_120 in var_118 {
            {
                array_119.value().string(item_120.as_str());
            }
        }
        array_119.finish();
    }
    if let Some(var_121) = &input.security_profile_name {
        object.key("SecurityProfileName").string(var_121.as_str());
    }
    if let Some(var_122) = &input.tags {
        #[allow(unused_mut)]
        let mut object_123 = object.key("Tags").start_object();
        for (key_124, value_125) in var_122 {
            {
                object_123.key(key_124.as_str()).string(value_125.as_str());
            }
        }
        object_123.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_task_template_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateTaskTemplateInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_126) = &input.client_token {
        object.key("ClientToken").string(var_126.as_str());
    }
    if let Some(var_127) = &input.constraints {
        #[allow(unused_mut)]
        let mut object_128 = object.key("Constraints").start_object();
        crate::json_ser::serialize_structure_crate_model_task_template_constraints(
            &mut object_128,
            var_127,
        )?;
        object_128.finish();
    }
    if let Some(var_129) = &input.contact_flow_id {
        object.key("ContactFlowId").string(var_129.as_str());
    }
    if let Some(var_130) = &input.defaults {
        #[allow(unused_mut)]
        let mut object_131 = object.key("Defaults").start_object();
        crate::json_ser::serialize_structure_crate_model_task_template_defaults(
            &mut object_131,
            var_130,
        )?;
        object_131.finish();
    }
    if let Some(var_132) = &input.description {
        object.key("Description").string(var_132.as_str());
    }
    if let Some(var_133) = &input.fields {
        let mut array_134 = object.key("Fields").start_array();
        for item_135 in var_133 {
            {
                #[allow(unused_mut)]
                let mut object_136 = array_134.value().start_object();
                crate::json_ser::serialize_structure_crate_model_task_template_field(
                    &mut object_136,
                    item_135,
                )?;
                object_136.finish();
            }
        }
        array_134.finish();
    }
    if let Some(var_137) = &input.name {
        object.key("Name").string(var_137.as_str());
    }
    if let Some(var_138) = &input.status {
        object.key("Status").string(var_138.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_use_case_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateUseCaseInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_139) = &input.tags {
        #[allow(unused_mut)]
        let mut object_140 = object.key("Tags").start_object();
        for (key_141, value_142) in var_139 {
            {
                object_140.key(key_141.as_str()).string(value_142.as_str());
            }
        }
        object_140.finish();
    }
    if let Some(var_143) = &input.use_case_type {
        object.key("UseCaseType").string(var_143.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateUserInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_144) = &input.directory_user_id {
        object.key("DirectoryUserId").string(var_144.as_str());
    }
    if let Some(var_145) = &input.hierarchy_group_id {
        object.key("HierarchyGroupId").string(var_145.as_str());
    }
    if let Some(var_146) = &input.identity_info {
        #[allow(unused_mut)]
        let mut object_147 = object.key("IdentityInfo").start_object();
        crate::json_ser::serialize_structure_crate_model_user_identity_info(
            &mut object_147,
            var_146,
        )?;
        object_147.finish();
    }
    if let Some(var_148) = &input.password {
        object.key("Password").string(var_148.as_str());
    }
    if let Some(var_149) = &input.phone_config {
        #[allow(unused_mut)]
        let mut object_150 = object.key("PhoneConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_user_phone_config(
            &mut object_150,
            var_149,
        )?;
        object_150.finish();
    }
    if let Some(var_151) = &input.routing_profile_id {
        object.key("RoutingProfileId").string(var_151.as_str());
    }
    if let Some(var_152) = &input.security_profile_ids {
        let mut array_153 = object.key("SecurityProfileIds").start_array();
        for item_154 in var_152 {
            {
                array_153.value().string(item_154.as_str());
            }
        }
        array_153.finish();
    }
    if let Some(var_155) = &input.tags {
        #[allow(unused_mut)]
        let mut object_156 = object.key("Tags").start_object();
        for (key_157, value_158) in var_155 {
            {
                object_156.key(key_157.as_str()).string(value_158.as_str());
            }
        }
        object_156.finish();
    }
    if let Some(var_159) = &input.username {
        object.key("Username").string(var_159.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_user_hierarchy_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateUserHierarchyGroupInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_160) = &input.name {
        object.key("Name").string(var_160.as_str());
    }
    if let Some(var_161) = &input.parent_group_id {
        object.key("ParentGroupId").string(var_161.as_str());
    }
    if let Some(var_162) = &input.tags {
        #[allow(unused_mut)]
        let mut object_163 = object.key("Tags").start_object();
        for (key_164, value_165) in var_162 {
            {
                object_163.key(key_164.as_str()).string(value_165.as_str());
            }
        }
        object_163.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_vocabulary_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateVocabularyInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_166) = &input.client_token {
        object.key("ClientToken").string(var_166.as_str());
    }
    if let Some(var_167) = &input.content {
        object.key("Content").string(var_167.as_str());
    }
    if let Some(var_168) = &input.language_code {
        object.key("LanguageCode").string(var_168.as_str());
    }
    if let Some(var_169) = &input.tags {
        #[allow(unused_mut)]
        let mut object_170 = object.key("Tags").start_object();
        for (key_171, value_172) in var_169 {
            {
                object_170.key(key_171.as_str()).string(value_172.as_str());
            }
        }
        object_170.finish();
    }
    if let Some(var_173) = &input.vocabulary_name {
        object.key("VocabularyName").string(var_173.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_disassociate_bot_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DisassociateBotInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_174) = &input.lex_bot {
        #[allow(unused_mut)]
        let mut object_175 = object.key("LexBot").start_object();
        crate::json_ser::serialize_structure_crate_model_lex_bot(&mut object_175, var_174)?;
        object_175.finish();
    }
    if let Some(var_176) = &input.lex_v2_bot {
        #[allow(unused_mut)]
        let mut object_177 = object.key("LexV2Bot").start_object();
        crate::json_ser::serialize_structure_crate_model_lex_v2_bot(&mut object_177, var_176)?;
        object_177.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_disassociate_queue_quick_connects_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DisassociateQueueQuickConnectsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_178) = &input.quick_connect_ids {
        let mut array_179 = object.key("QuickConnectIds").start_array();
        for item_180 in var_178 {
            {
                array_179.value().string(item_180.as_str());
            }
        }
        array_179.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_disassociate_routing_profile_queues_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DisassociateRoutingProfileQueuesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_181) = &input.queue_references {
        let mut array_182 = object.key("QueueReferences").start_array();
        for item_183 in var_181 {
            {
                #[allow(unused_mut)]
                let mut object_184 = array_182.value().start_object();
                crate::json_ser::serialize_structure_crate_model_routing_profile_queue_reference(
                    &mut object_184,
                    item_183,
                )?;
                object_184.finish();
            }
        }
        array_182.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_current_metric_data_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetCurrentMetricDataInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_185) = &input.current_metrics {
        let mut array_186 = object.key("CurrentMetrics").start_array();
        for item_187 in var_185 {
            {
                #[allow(unused_mut)]
                let mut object_188 = array_186.value().start_object();
                crate::json_ser::serialize_structure_crate_model_current_metric(
                    &mut object_188,
                    item_187,
                )?;
                object_188.finish();
            }
        }
        array_186.finish();
    }
    if let Some(var_189) = &input.filters {
        #[allow(unused_mut)]
        let mut object_190 = object.key("Filters").start_object();
        crate::json_ser::serialize_structure_crate_model_filters(&mut object_190, var_189)?;
        object_190.finish();
    }
    if let Some(var_191) = &input.groupings {
        let mut array_192 = object.key("Groupings").start_array();
        for item_193 in var_191 {
            {
                array_192.value().string(item_193.as_str());
            }
        }
        array_192.finish();
    }
    if let Some(var_194) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_194).into()),
        );
    }
    if let Some(var_195) = &input.next_token {
        object.key("NextToken").string(var_195.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_current_user_data_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetCurrentUserDataInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_196) = &input.filters {
        #[allow(unused_mut)]
        let mut object_197 = object.key("Filters").start_object();
        crate::json_ser::serialize_structure_crate_model_user_data_filters(
            &mut object_197,
            var_196,
        )?;
        object_197.finish();
    }
    if let Some(var_198) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_198).into()),
        );
    }
    if let Some(var_199) = &input.next_token {
        object.key("NextToken").string(var_199.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_metric_data_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetMetricDataInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_200) = &input.end_time {
        object
            .key("EndTime")
            .date_time(var_200, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    if let Some(var_201) = &input.filters {
        #[allow(unused_mut)]
        let mut object_202 = object.key("Filters").start_object();
        crate::json_ser::serialize_structure_crate_model_filters(&mut object_202, var_201)?;
        object_202.finish();
    }
    if let Some(var_203) = &input.groupings {
        let mut array_204 = object.key("Groupings").start_array();
        for item_205 in var_203 {
            {
                array_204.value().string(item_205.as_str());
            }
        }
        array_204.finish();
    }
    if let Some(var_206) = &input.historical_metrics {
        let mut array_207 = object.key("HistoricalMetrics").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_historical_metric(
                    &mut object_209,
                    item_208,
                )?;
                object_209.finish();
            }
        }
        array_207.finish();
    }
    if let Some(var_210) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_210).into()),
        );
    }
    if let Some(var_211) = &input.next_token {
        object.key("NextToken").string(var_211.as_str());
    }
    if let Some(var_212) = &input.start_time {
        object
            .key("StartTime")
            .date_time(var_212, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_default_vocabularies_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListDefaultVocabulariesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_213) = &input.language_code {
        object.key("LanguageCode").string(var_213.as_str());
    }
    if input.max_results != 0 {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.max_results).into()),
        );
    }
    if let Some(var_214) = &input.next_token {
        object.key("NextToken").string(var_214.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_phone_numbers_v2_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListPhoneNumbersV2Input,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_215) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_215).into()),
        );
    }
    if let Some(var_216) = &input.next_token {
        object.key("NextToken").string(var_216.as_str());
    }
    if let Some(var_217) = &input.phone_number_country_codes {
        let mut array_218 = object.key("PhoneNumberCountryCodes").start_array();
        for item_219 in var_217 {
            {
                array_218.value().string(item_219.as_str());
            }
        }
        array_218.finish();
    }
    if let Some(var_220) = &input.phone_number_prefix {
        object.key("PhoneNumberPrefix").string(var_220.as_str());
    }
    if let Some(var_221) = &input.phone_number_types {
        let mut array_222 = object.key("PhoneNumberTypes").start_array();
        for item_223 in var_221 {
            {
                array_222.value().string(item_223.as_str());
            }
        }
        array_222.finish();
    }
    if let Some(var_224) = &input.target_arn {
        object.key("TargetArn").string(var_224.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_put_user_status_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::PutUserStatusInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_225) = &input.agent_status_id {
        object.key("AgentStatusId").string(var_225.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_resume_contact_recording_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ResumeContactRecordingInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_226) = &input.contact_id {
        object.key("ContactId").string(var_226.as_str());
    }
    if let Some(var_227) = &input.initial_contact_id {
        object.key("InitialContactId").string(var_227.as_str());
    }
    if let Some(var_228) = &input.instance_id {
        object.key("InstanceId").string(var_228.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_search_available_phone_numbers_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SearchAvailablePhoneNumbersInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_229) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_229).into()),
        );
    }
    if let Some(var_230) = &input.next_token {
        object.key("NextToken").string(var_230.as_str());
    }
    if let Some(var_231) = &input.phone_number_country_code {
        object
            .key("PhoneNumberCountryCode")
            .string(var_231.as_str());
    }
    if let Some(var_232) = &input.phone_number_prefix {
        object.key("PhoneNumberPrefix").string(var_232.as_str());
    }
    if let Some(var_233) = &input.phone_number_type {
        object.key("PhoneNumberType").string(var_233.as_str());
    }
    if let Some(var_234) = &input.target_arn {
        object.key("TargetArn").string(var_234.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_search_queues_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SearchQueuesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_235) = &input.instance_id {
        object.key("InstanceId").string(var_235.as_str());
    }
    if let Some(var_236) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_236).into()),
        );
    }
    if let Some(var_237) = &input.next_token {
        object.key("NextToken").string(var_237.as_str());
    }
    if let Some(var_238) = &input.search_criteria {
        #[allow(unused_mut)]
        let mut object_239 = object.key("SearchCriteria").start_object();
        crate::json_ser::serialize_structure_crate_model_queue_search_criteria(
            &mut object_239,
            var_238,
        )?;
        object_239.finish();
    }
    if let Some(var_240) = &input.search_filter {
        #[allow(unused_mut)]
        let mut object_241 = object.key("SearchFilter").start_object();
        crate::json_ser::serialize_structure_crate_model_queue_search_filter(
            &mut object_241,
            var_240,
        )?;
        object_241.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_search_routing_profiles_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SearchRoutingProfilesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_242) = &input.instance_id {
        object.key("InstanceId").string(var_242.as_str());
    }
    if let Some(var_243) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_243).into()),
        );
    }
    if let Some(var_244) = &input.next_token {
        object.key("NextToken").string(var_244.as_str());
    }
    if let Some(var_245) = &input.search_criteria {
        #[allow(unused_mut)]
        let mut object_246 = object.key("SearchCriteria").start_object();
        crate::json_ser::serialize_structure_crate_model_routing_profile_search_criteria(
            &mut object_246,
            var_245,
        )?;
        object_246.finish();
    }
    if let Some(var_247) = &input.search_filter {
        #[allow(unused_mut)]
        let mut object_248 = object.key("SearchFilter").start_object();
        crate::json_ser::serialize_structure_crate_model_routing_profile_search_filter(
            &mut object_248,
            var_247,
        )?;
        object_248.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_search_security_profiles_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SearchSecurityProfilesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_249) = &input.instance_id {
        object.key("InstanceId").string(var_249.as_str());
    }
    if let Some(var_250) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_250).into()),
        );
    }
    if let Some(var_251) = &input.next_token {
        object.key("NextToken").string(var_251.as_str());
    }
    if let Some(var_252) = &input.search_criteria {
        #[allow(unused_mut)]
        let mut object_253 = object.key("SearchCriteria").start_object();
        crate::json_ser::serialize_structure_crate_model_security_profile_search_criteria(
            &mut object_253,
            var_252,
        )?;
        object_253.finish();
    }
    if let Some(var_254) = &input.search_filter {
        #[allow(unused_mut)]
        let mut object_255 = object.key("SearchFilter").start_object();
        crate::json_ser::serialize_structure_crate_model_security_profiles_search_filter(
            &mut object_255,
            var_254,
        )?;
        object_255.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_search_users_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SearchUsersInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_256) = &input.instance_id {
        object.key("InstanceId").string(var_256.as_str());
    }
    if let Some(var_257) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_257).into()),
        );
    }
    if let Some(var_258) = &input.next_token {
        object.key("NextToken").string(var_258.as_str());
    }
    if let Some(var_259) = &input.search_criteria {
        #[allow(unused_mut)]
        let mut object_260 = object.key("SearchCriteria").start_object();
        crate::json_ser::serialize_structure_crate_model_user_search_criteria(
            &mut object_260,
            var_259,
        )?;
        object_260.finish();
    }
    if let Some(var_261) = &input.search_filter {
        #[allow(unused_mut)]
        let mut object_262 = object.key("SearchFilter").start_object();
        crate::json_ser::serialize_structure_crate_model_user_search_filter(
            &mut object_262,
            var_261,
        )?;
        object_262.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_search_vocabularies_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SearchVocabulariesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_263) = &input.language_code {
        object.key("LanguageCode").string(var_263.as_str());
    }
    if input.max_results != 0 {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.max_results).into()),
        );
    }
    if let Some(var_264) = &input.name_starts_with {
        object.key("NameStartsWith").string(var_264.as_str());
    }
    if let Some(var_265) = &input.next_token {
        object.key("NextToken").string(var_265.as_str());
    }
    if let Some(var_266) = &input.state {
        object.key("State").string(var_266.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_chat_contact_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartChatContactInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_267) = &input.attributes {
        #[allow(unused_mut)]
        let mut object_268 = object.key("Attributes").start_object();
        for (key_269, value_270) in var_267 {
            {
                object_268.key(key_269.as_str()).string(value_270.as_str());
            }
        }
        object_268.finish();
    }
    if let Some(var_271) = &input.chat_duration_in_minutes {
        object.key("ChatDurationInMinutes").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_271).into()),
        );
    }
    if let Some(var_272) = &input.client_token {
        object.key("ClientToken").string(var_272.as_str());
    }
    if let Some(var_273) = &input.contact_flow_id {
        object.key("ContactFlowId").string(var_273.as_str());
    }
    if let Some(var_274) = &input.initial_message {
        #[allow(unused_mut)]
        let mut object_275 = object.key("InitialMessage").start_object();
        crate::json_ser::serialize_structure_crate_model_chat_message(&mut object_275, var_274)?;
        object_275.finish();
    }
    if let Some(var_276) = &input.instance_id {
        object.key("InstanceId").string(var_276.as_str());
    }
    if let Some(var_277) = &input.participant_details {
        #[allow(unused_mut)]
        let mut object_278 = object.key("ParticipantDetails").start_object();
        crate::json_ser::serialize_structure_crate_model_participant_details(
            &mut object_278,
            var_277,
        )?;
        object_278.finish();
    }
    if let Some(var_279) = &input.supported_messaging_content_types {
        let mut array_280 = object.key("SupportedMessagingContentTypes").start_array();
        for item_281 in var_279 {
            {
                array_280.value().string(item_281.as_str());
            }
        }
        array_280.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_contact_recording_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartContactRecordingInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_282) = &input.contact_id {
        object.key("ContactId").string(var_282.as_str());
    }
    if let Some(var_283) = &input.initial_contact_id {
        object.key("InitialContactId").string(var_283.as_str());
    }
    if let Some(var_284) = &input.instance_id {
        object.key("InstanceId").string(var_284.as_str());
    }
    if let Some(var_285) = &input.voice_recording_configuration {
        #[allow(unused_mut)]
        let mut object_286 = object.key("VoiceRecordingConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_voice_recording_configuration(
            &mut object_286,
            var_285,
        )?;
        object_286.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_contact_streaming_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartContactStreamingInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_287) = &input.chat_streaming_configuration {
        #[allow(unused_mut)]
        let mut object_288 = object.key("ChatStreamingConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_chat_streaming_configuration(
            &mut object_288,
            var_287,
        )?;
        object_288.finish();
    }
    if let Some(var_289) = &input.client_token {
        object.key("ClientToken").string(var_289.as_str());
    }
    if let Some(var_290) = &input.contact_id {
        object.key("ContactId").string(var_290.as_str());
    }
    if let Some(var_291) = &input.instance_id {
        object.key("InstanceId").string(var_291.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_outbound_voice_contact_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartOutboundVoiceContactInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_292) = &input.answer_machine_detection_config {
        #[allow(unused_mut)]
        let mut object_293 = object.key("AnswerMachineDetectionConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_answer_machine_detection_config(
            &mut object_293,
            var_292,
        )?;
        object_293.finish();
    }
    if let Some(var_294) = &input.attributes {
        #[allow(unused_mut)]
        let mut object_295 = object.key("Attributes").start_object();
        for (key_296, value_297) in var_294 {
            {
                object_295.key(key_296.as_str()).string(value_297.as_str());
            }
        }
        object_295.finish();
    }
    if let Some(var_298) = &input.campaign_id {
        object.key("CampaignId").string(var_298.as_str());
    }
    if let Some(var_299) = &input.client_token {
        object.key("ClientToken").string(var_299.as_str());
    }
    if let Some(var_300) = &input.contact_flow_id {
        object.key("ContactFlowId").string(var_300.as_str());
    }
    if let Some(var_301) = &input.destination_phone_number {
        object
            .key("DestinationPhoneNumber")
            .string(var_301.as_str());
    }
    if let Some(var_302) = &input.instance_id {
        object.key("InstanceId").string(var_302.as_str());
    }
    if let Some(var_303) = &input.queue_id {
        object.key("QueueId").string(var_303.as_str());
    }
    if let Some(var_304) = &input.source_phone_number {
        object.key("SourcePhoneNumber").string(var_304.as_str());
    }
    if let Some(var_305) = &input.traffic_type {
        object.key("TrafficType").string(var_305.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_task_contact_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartTaskContactInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_306) = &input.attributes {
        #[allow(unused_mut)]
        let mut object_307 = object.key("Attributes").start_object();
        for (key_308, value_309) in var_306 {
            {
                object_307.key(key_308.as_str()).string(value_309.as_str());
            }
        }
        object_307.finish();
    }
    if let Some(var_310) = &input.client_token {
        object.key("ClientToken").string(var_310.as_str());
    }
    if let Some(var_311) = &input.contact_flow_id {
        object.key("ContactFlowId").string(var_311.as_str());
    }
    if let Some(var_312) = &input.description {
        object.key("Description").string(var_312.as_str());
    }
    if let Some(var_313) = &input.instance_id {
        object.key("InstanceId").string(var_313.as_str());
    }
    if let Some(var_314) = &input.name {
        object.key("Name").string(var_314.as_str());
    }
    if let Some(var_315) = &input.previous_contact_id {
        object.key("PreviousContactId").string(var_315.as_str());
    }
    if let Some(var_316) = &input.quick_connect_id {
        object.key("QuickConnectId").string(var_316.as_str());
    }
    if let Some(var_317) = &input.references {
        #[allow(unused_mut)]
        let mut object_318 = object.key("References").start_object();
        for (key_319, value_320) in var_317 {
            {
                #[allow(unused_mut)]
                let mut object_321 = object_318.key(key_319.as_str()).start_object();
                crate::json_ser::serialize_structure_crate_model_reference(
                    &mut object_321,
                    value_320,
                )?;
                object_321.finish();
            }
        }
        object_318.finish();
    }
    if let Some(var_322) = &input.scheduled_time {
        object
            .key("ScheduledTime")
            .date_time(var_322, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    if let Some(var_323) = &input.task_template_id {
        object.key("TaskTemplateId").string(var_323.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_stop_contact_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopContactInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_324) = &input.contact_id {
        object.key("ContactId").string(var_324.as_str());
    }
    if let Some(var_325) = &input.instance_id {
        object.key("InstanceId").string(var_325.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_stop_contact_recording_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopContactRecordingInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_326) = &input.contact_id {
        object.key("ContactId").string(var_326.as_str());
    }
    if let Some(var_327) = &input.initial_contact_id {
        object.key("InitialContactId").string(var_327.as_str());
    }
    if let Some(var_328) = &input.instance_id {
        object.key("InstanceId").string(var_328.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_stop_contact_streaming_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopContactStreamingInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_329) = &input.contact_id {
        object.key("ContactId").string(var_329.as_str());
    }
    if let Some(var_330) = &input.instance_id {
        object.key("InstanceId").string(var_330.as_str());
    }
    if let Some(var_331) = &input.streaming_id {
        object.key("StreamingId").string(var_331.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_suspend_contact_recording_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SuspendContactRecordingInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_332) = &input.contact_id {
        object.key("ContactId").string(var_332.as_str());
    }
    if let Some(var_333) = &input.initial_contact_id {
        object.key("InitialContactId").string(var_333.as_str());
    }
    if let Some(var_334) = &input.instance_id {
        object.key("InstanceId").string(var_334.as_str());
    }
    Ok(())
}

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

pub fn serialize_structure_crate_input_transfer_contact_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::TransferContactInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_339) = &input.client_token {
        object.key("ClientToken").string(var_339.as_str());
    }
    if let Some(var_340) = &input.contact_flow_id {
        object.key("ContactFlowId").string(var_340.as_str());
    }
    if let Some(var_341) = &input.contact_id {
        object.key("ContactId").string(var_341.as_str());
    }
    if let Some(var_342) = &input.instance_id {
        object.key("InstanceId").string(var_342.as_str());
    }
    if let Some(var_343) = &input.queue_id {
        object.key("QueueId").string(var_343.as_str());
    }
    if let Some(var_344) = &input.user_id {
        object.key("UserId").string(var_344.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_agent_status_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateAgentStatusInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_345) = &input.description {
        object.key("Description").string(var_345.as_str());
    }
    if let Some(var_346) = &input.display_order {
        object.key("DisplayOrder").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_346).into()),
        );
    }
    if let Some(var_347) = &input.name {
        object.key("Name").string(var_347.as_str());
    }
    if input.reset_order_number {
        object
            .key("ResetOrderNumber")
            .boolean(input.reset_order_number);
    }
    if let Some(var_348) = &input.state {
        object.key("State").string(var_348.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