1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_structure_crate_input_associate_connect_peer_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AssociateConnectPeerInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_1) = &input.connect_peer_id {
        object.key("ConnectPeerId").string(var_1.as_str());
    }
    if let Some(var_2) = &input.device_id {
        object.key("DeviceId").string(var_2.as_str());
    }
    if let Some(var_3) = &input.link_id {
        object.key("LinkId").string(var_3.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_associate_customer_gateway_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AssociateCustomerGatewayInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_4) = &input.customer_gateway_arn {
        object.key("CustomerGatewayArn").string(var_4.as_str());
    }
    if let Some(var_5) = &input.device_id {
        object.key("DeviceId").string(var_5.as_str());
    }
    if let Some(var_6) = &input.link_id {
        object.key("LinkId").string(var_6.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_associate_link_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AssociateLinkInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_7) = &input.device_id {
        object.key("DeviceId").string(var_7.as_str());
    }
    if let Some(var_8) = &input.link_id {
        object.key("LinkId").string(var_8.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_associate_transit_gateway_connect_peer_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AssociateTransitGatewayConnectPeerInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_9) = &input.device_id {
        object.key("DeviceId").string(var_9.as_str());
    }
    if let Some(var_10) = &input.link_id {
        object.key("LinkId").string(var_10.as_str());
    }
    if let Some(var_11) = &input.transit_gateway_connect_peer_arn {
        object
            .key("TransitGatewayConnectPeerArn")
            .string(var_11.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_connect_attachment_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateConnectAttachmentInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_12) = &input.client_token {
        object.key("ClientToken").string(var_12.as_str());
    }
    if let Some(var_13) = &input.core_network_id {
        object.key("CoreNetworkId").string(var_13.as_str());
    }
    if let Some(var_14) = &input.edge_location {
        object.key("EdgeLocation").string(var_14.as_str());
    }
    if let Some(var_15) = &input.options {
        #[allow(unused_mut)]
        let mut object_16 = object.key("Options").start_object();
        crate::json_ser::serialize_structure_crate_model_connect_attachment_options(
            &mut object_16,
            var_15,
        )?;
        object_16.finish();
    }
    if let Some(var_17) = &input.tags {
        let mut array_18 = object.key("Tags").start_array();
        for item_19 in var_17 {
            {
                #[allow(unused_mut)]
                let mut object_20 = array_18.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_20, item_19)?;
                object_20.finish();
            }
        }
        array_18.finish();
    }
    if let Some(var_21) = &input.transport_attachment_id {
        object.key("TransportAttachmentId").string(var_21.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_22) = &input.connected_device_id {
        object.key("ConnectedDeviceId").string(var_22.as_str());
    }
    if let Some(var_23) = &input.connected_link_id {
        object.key("ConnectedLinkId").string(var_23.as_str());
    }
    if let Some(var_24) = &input.description {
        object.key("Description").string(var_24.as_str());
    }
    if let Some(var_25) = &input.device_id {
        object.key("DeviceId").string(var_25.as_str());
    }
    if let Some(var_26) = &input.link_id {
        object.key("LinkId").string(var_26.as_str());
    }
    if let Some(var_27) = &input.tags {
        let mut array_28 = object.key("Tags").start_array();
        for item_29 in var_27 {
            {
                #[allow(unused_mut)]
                let mut object_30 = array_28.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_30, item_29)?;
                object_30.finish();
            }
        }
        array_28.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_connect_peer_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateConnectPeerInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_31) = &input.bgp_options {
        #[allow(unused_mut)]
        let mut object_32 = object.key("BgpOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_bgp_options(&mut object_32, var_31)?;
        object_32.finish();
    }
    if let Some(var_33) = &input.client_token {
        object.key("ClientToken").string(var_33.as_str());
    }
    if let Some(var_34) = &input.connect_attachment_id {
        object.key("ConnectAttachmentId").string(var_34.as_str());
    }
    if let Some(var_35) = &input.core_network_address {
        object.key("CoreNetworkAddress").string(var_35.as_str());
    }
    if let Some(var_36) = &input.inside_cidr_blocks {
        let mut array_37 = object.key("InsideCidrBlocks").start_array();
        for item_38 in var_36 {
            {
                array_37.value().string(item_38.as_str());
            }
        }
        array_37.finish();
    }
    if let Some(var_39) = &input.peer_address {
        object.key("PeerAddress").string(var_39.as_str());
    }
    if let Some(var_40) = &input.tags {
        let mut array_41 = object.key("Tags").start_array();
        for item_42 in var_40 {
            {
                #[allow(unused_mut)]
                let mut object_43 = array_41.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_43, item_42)?;
                object_43.finish();
            }
        }
        array_41.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_core_network_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateCoreNetworkInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_44) = &input.client_token {
        object.key("ClientToken").string(var_44.as_str());
    }
    if let Some(var_45) = &input.description {
        object.key("Description").string(var_45.as_str());
    }
    if let Some(var_46) = &input.global_network_id {
        object.key("GlobalNetworkId").string(var_46.as_str());
    }
    if let Some(var_47) = &input.policy_document {
        object.key("PolicyDocument").string(var_47.as_str());
    }
    if let Some(var_48) = &input.tags {
        let mut array_49 = object.key("Tags").start_array();
        for item_50 in var_48 {
            {
                #[allow(unused_mut)]
                let mut object_51 = array_49.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_51, item_50)?;
                object_51.finish();
            }
        }
        array_49.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_device_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateDeviceInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_52) = &input.aws_location {
        #[allow(unused_mut)]
        let mut object_53 = object.key("AWSLocation").start_object();
        crate::json_ser::serialize_structure_crate_model_aws_location(&mut object_53, var_52)?;
        object_53.finish();
    }
    if let Some(var_54) = &input.description {
        object.key("Description").string(var_54.as_str());
    }
    if let Some(var_55) = &input.location {
        #[allow(unused_mut)]
        let mut object_56 = object.key("Location").start_object();
        crate::json_ser::serialize_structure_crate_model_location(&mut object_56, var_55)?;
        object_56.finish();
    }
    if let Some(var_57) = &input.model {
        object.key("Model").string(var_57.as_str());
    }
    if let Some(var_58) = &input.serial_number {
        object.key("SerialNumber").string(var_58.as_str());
    }
    if let Some(var_59) = &input.site_id {
        object.key("SiteId").string(var_59.as_str());
    }
    if let Some(var_60) = &input.tags {
        let mut array_61 = object.key("Tags").start_array();
        for item_62 in var_60 {
            {
                #[allow(unused_mut)]
                let mut object_63 = array_61.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_63, item_62)?;
                object_63.finish();
            }
        }
        array_61.finish();
    }
    if let Some(var_64) = &input.r#type {
        object.key("Type").string(var_64.as_str());
    }
    if let Some(var_65) = &input.vendor {
        object.key("Vendor").string(var_65.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_global_network_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateGlobalNetworkInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_66) = &input.description {
        object.key("Description").string(var_66.as_str());
    }
    if let Some(var_67) = &input.tags {
        let mut array_68 = object.key("Tags").start_array();
        for item_69 in var_67 {
            {
                #[allow(unused_mut)]
                let mut object_70 = array_68.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_70, item_69)?;
                object_70.finish();
            }
        }
        array_68.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_link_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateLinkInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_71) = &input.bandwidth {
        #[allow(unused_mut)]
        let mut object_72 = object.key("Bandwidth").start_object();
        crate::json_ser::serialize_structure_crate_model_bandwidth(&mut object_72, var_71)?;
        object_72.finish();
    }
    if let Some(var_73) = &input.description {
        object.key("Description").string(var_73.as_str());
    }
    if let Some(var_74) = &input.provider {
        object.key("Provider").string(var_74.as_str());
    }
    if let Some(var_75) = &input.site_id {
        object.key("SiteId").string(var_75.as_str());
    }
    if let Some(var_76) = &input.tags {
        let mut array_77 = object.key("Tags").start_array();
        for item_78 in var_76 {
            {
                #[allow(unused_mut)]
                let mut object_79 = array_77.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_79, item_78)?;
                object_79.finish();
            }
        }
        array_77.finish();
    }
    if let Some(var_80) = &input.r#type {
        object.key("Type").string(var_80.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_site_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateSiteInput,
) -> 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.location {
        #[allow(unused_mut)]
        let mut object_83 = object.key("Location").start_object();
        crate::json_ser::serialize_structure_crate_model_location(&mut object_83, var_82)?;
        object_83.finish();
    }
    if let Some(var_84) = &input.tags {
        let mut array_85 = object.key("Tags").start_array();
        for item_86 in var_84 {
            {
                #[allow(unused_mut)]
                let mut object_87 = array_85.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_87, item_86)?;
                object_87.finish();
            }
        }
        array_85.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_site_to_site_vpn_attachment_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateSiteToSiteVpnAttachmentInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_88) = &input.client_token {
        object.key("ClientToken").string(var_88.as_str());
    }
    if let Some(var_89) = &input.core_network_id {
        object.key("CoreNetworkId").string(var_89.as_str());
    }
    if let Some(var_90) = &input.tags {
        let mut array_91 = object.key("Tags").start_array();
        for item_92 in var_90 {
            {
                #[allow(unused_mut)]
                let mut object_93 = array_91.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_93, item_92)?;
                object_93.finish();
            }
        }
        array_91.finish();
    }
    if let Some(var_94) = &input.vpn_connection_arn {
        object.key("VpnConnectionArn").string(var_94.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_transit_gateway_peering_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateTransitGatewayPeeringInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_95) = &input.client_token {
        object.key("ClientToken").string(var_95.as_str());
    }
    if let Some(var_96) = &input.core_network_id {
        object.key("CoreNetworkId").string(var_96.as_str());
    }
    if let Some(var_97) = &input.tags {
        let mut array_98 = object.key("Tags").start_array();
        for item_99 in var_97 {
            {
                #[allow(unused_mut)]
                let mut object_100 = array_98.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_100, item_99)?;
                object_100.finish();
            }
        }
        array_98.finish();
    }
    if let Some(var_101) = &input.transit_gateway_arn {
        object.key("TransitGatewayArn").string(var_101.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_transit_gateway_route_table_attachment_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateTransitGatewayRouteTableAttachmentInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_102) = &input.client_token {
        object.key("ClientToken").string(var_102.as_str());
    }
    if let Some(var_103) = &input.peering_id {
        object.key("PeeringId").string(var_103.as_str());
    }
    if let Some(var_104) = &input.tags {
        let mut array_105 = object.key("Tags").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_tag(&mut object_107, item_106)?;
                object_107.finish();
            }
        }
        array_105.finish();
    }
    if let Some(var_108) = &input.transit_gateway_route_table_arn {
        object
            .key("TransitGatewayRouteTableArn")
            .string(var_108.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_vpc_attachment_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateVpcAttachmentInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_109) = &input.client_token {
        object.key("ClientToken").string(var_109.as_str());
    }
    if let Some(var_110) = &input.core_network_id {
        object.key("CoreNetworkId").string(var_110.as_str());
    }
    if let Some(var_111) = &input.options {
        #[allow(unused_mut)]
        let mut object_112 = object.key("Options").start_object();
        crate::json_ser::serialize_structure_crate_model_vpc_options(&mut object_112, var_111)?;
        object_112.finish();
    }
    if let Some(var_113) = &input.subnet_arns {
        let mut array_114 = object.key("SubnetArns").start_array();
        for item_115 in var_113 {
            {
                array_114.value().string(item_115.as_str());
            }
        }
        array_114.finish();
    }
    if let Some(var_116) = &input.tags {
        let mut array_117 = object.key("Tags").start_array();
        for item_118 in var_116 {
            {
                #[allow(unused_mut)]
                let mut object_119 = array_117.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_119, item_118)?;
                object_119.finish();
            }
        }
        array_117.finish();
    }
    if let Some(var_120) = &input.vpc_arn {
        object.key("VpcArn").string(var_120.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_network_routes_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetNetworkRoutesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_121) = &input.destination_filters {
        #[allow(unused_mut)]
        let mut object_122 = object.key("DestinationFilters").start_object();
        for (key_123, value_124) in var_121 {
            {
                let mut array_125 = object_122.key(key_123.as_str()).start_array();
                for item_126 in value_124 {
                    {
                        array_125.value().string(item_126.as_str());
                    }
                }
                array_125.finish();
            }
        }
        object_122.finish();
    }
    if let Some(var_127) = &input.exact_cidr_matches {
        let mut array_128 = object.key("ExactCidrMatches").start_array();
        for item_129 in var_127 {
            {
                array_128.value().string(item_129.as_str());
            }
        }
        array_128.finish();
    }
    if let Some(var_130) = &input.longest_prefix_matches {
        let mut array_131 = object.key("LongestPrefixMatches").start_array();
        for item_132 in var_130 {
            {
                array_131.value().string(item_132.as_str());
            }
        }
        array_131.finish();
    }
    if let Some(var_133) = &input.prefix_list_ids {
        let mut array_134 = object.key("PrefixListIds").start_array();
        for item_135 in var_133 {
            {
                array_134.value().string(item_135.as_str());
            }
        }
        array_134.finish();
    }
    if let Some(var_136) = &input.route_table_identifier {
        #[allow(unused_mut)]
        let mut object_137 = object.key("RouteTableIdentifier").start_object();
        crate::json_ser::serialize_structure_crate_model_route_table_identifier(
            &mut object_137,
            var_136,
        )?;
        object_137.finish();
    }
    if let Some(var_138) = &input.states {
        let mut array_139 = object.key("States").start_array();
        for item_140 in var_138 {
            {
                array_139.value().string(item_140.as_str());
            }
        }
        array_139.finish();
    }
    if let Some(var_141) = &input.subnet_of_matches {
        let mut array_142 = object.key("SubnetOfMatches").start_array();
        for item_143 in var_141 {
            {
                array_142.value().string(item_143.as_str());
            }
        }
        array_142.finish();
    }
    if let Some(var_144) = &input.supernet_of_matches {
        let mut array_145 = object.key("SupernetOfMatches").start_array();
        for item_146 in var_144 {
            {
                array_145.value().string(item_146.as_str());
            }
        }
        array_145.finish();
    }
    if let Some(var_147) = &input.types {
        let mut array_148 = object.key("Types").start_array();
        for item_149 in var_147 {
            {
                array_148.value().string(item_149.as_str());
            }
        }
        array_148.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_put_core_network_policy_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::PutCoreNetworkPolicyInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_150) = &input.client_token {
        object.key("ClientToken").string(var_150.as_str());
    }
    if let Some(var_151) = &input.description {
        object.key("Description").string(var_151.as_str());
    }
    if let Some(var_152) = &input.latest_version_id {
        object.key("LatestVersionId").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_152).into()),
        );
    }
    if let Some(var_153) = &input.policy_document {
        object.key("PolicyDocument").string(var_153.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_put_resource_policy_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::PutResourcePolicyInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_154) = &input.policy_document {
        object.key("PolicyDocument").string(var_154.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_register_transit_gateway_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::RegisterTransitGatewayInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_155) = &input.transit_gateway_arn {
        object.key("TransitGatewayArn").string(var_155.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_organization_service_access_update_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartOrganizationServiceAccessUpdateInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_156) = &input.action {
        object.key("Action").string(var_156.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_route_analysis_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartRouteAnalysisInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_157) = &input.destination {
        #[allow(unused_mut)]
        let mut object_158 = object.key("Destination").start_object();
        crate::json_ser::serialize_structure_crate_model_route_analysis_endpoint_options_specification(&mut object_158, var_157)?;
        object_158.finish();
    }
    if input.include_return_path {
        object
            .key("IncludeReturnPath")
            .boolean(input.include_return_path);
    }
    if let Some(var_159) = &input.source {
        #[allow(unused_mut)]
        let mut object_160 = object.key("Source").start_object();
        crate::json_ser::serialize_structure_crate_model_route_analysis_endpoint_options_specification(&mut object_160, var_159)?;
        object_160.finish();
    }
    if input.use_middleboxes {
        object.key("UseMiddleboxes").boolean(input.use_middleboxes);
    }
    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_161) = &input.tags {
        let mut array_162 = object.key("Tags").start_array();
        for item_163 in var_161 {
            {
                #[allow(unused_mut)]
                let mut object_164 = array_162.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_164, item_163)?;
                object_164.finish();
            }
        }
        array_162.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_165) = &input.connected_link_id {
        object.key("ConnectedLinkId").string(var_165.as_str());
    }
    if let Some(var_166) = &input.description {
        object.key("Description").string(var_166.as_str());
    }
    if let Some(var_167) = &input.link_id {
        object.key("LinkId").string(var_167.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_core_network_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateCoreNetworkInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_168) = &input.description {
        object.key("Description").string(var_168.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_device_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateDeviceInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_169) = &input.aws_location {
        #[allow(unused_mut)]
        let mut object_170 = object.key("AWSLocation").start_object();
        crate::json_ser::serialize_structure_crate_model_aws_location(&mut object_170, var_169)?;
        object_170.finish();
    }
    if let Some(var_171) = &input.description {
        object.key("Description").string(var_171.as_str());
    }
    if let Some(var_172) = &input.location {
        #[allow(unused_mut)]
        let mut object_173 = object.key("Location").start_object();
        crate::json_ser::serialize_structure_crate_model_location(&mut object_173, var_172)?;
        object_173.finish();
    }
    if let Some(var_174) = &input.model {
        object.key("Model").string(var_174.as_str());
    }
    if let Some(var_175) = &input.serial_number {
        object.key("SerialNumber").string(var_175.as_str());
    }
    if let Some(var_176) = &input.site_id {
        object.key("SiteId").string(var_176.as_str());
    }
    if let Some(var_177) = &input.r#type {
        object.key("Type").string(var_177.as_str());
    }
    if let Some(var_178) = &input.vendor {
        object.key("Vendor").string(var_178.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_global_network_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateGlobalNetworkInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_179) = &input.description {
        object.key("Description").string(var_179.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_link_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateLinkInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_180) = &input.bandwidth {
        #[allow(unused_mut)]
        let mut object_181 = object.key("Bandwidth").start_object();
        crate::json_ser::serialize_structure_crate_model_bandwidth(&mut object_181, var_180)?;
        object_181.finish();
    }
    if let Some(var_182) = &input.description {
        object.key("Description").string(var_182.as_str());
    }
    if let Some(var_183) = &input.provider {
        object.key("Provider").string(var_183.as_str());
    }
    if let Some(var_184) = &input.r#type {
        object.key("Type").string(var_184.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_network_resource_metadata_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateNetworkResourceMetadataInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_185) = &input.metadata {
        #[allow(unused_mut)]
        let mut object_186 = object.key("Metadata").start_object();
        for (key_187, value_188) in var_185 {
            {
                object_186.key(key_187.as_str()).string(value_188.as_str());
            }
        }
        object_186.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_site_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateSiteInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_189) = &input.description {
        object.key("Description").string(var_189.as_str());
    }
    if let Some(var_190) = &input.location {
        #[allow(unused_mut)]
        let mut object_191 = object.key("Location").start_object();
        crate::json_ser::serialize_structure_crate_model_location(&mut object_191, var_190)?;
        object_191.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_vpc_attachment_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateVpcAttachmentInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_192) = &input.add_subnet_arns {
        let mut array_193 = object.key("AddSubnetArns").start_array();
        for item_194 in var_192 {
            {
                array_193.value().string(item_194.as_str());
            }
        }
        array_193.finish();
    }
    if let Some(var_195) = &input.options {
        #[allow(unused_mut)]
        let mut object_196 = object.key("Options").start_object();
        crate::json_ser::serialize_structure_crate_model_vpc_options(&mut object_196, var_195)?;
        object_196.finish();
    }
    if let Some(var_197) = &input.remove_subnet_arns {
        let mut array_198 = object.key("RemoveSubnetArns").start_array();
        for item_199 in var_197 {
            {
                array_198.value().string(item_199.as_str());
            }
        }
        array_198.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_connect_attachment_options(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ConnectAttachmentOptions,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_200) = &input.protocol {
        object.key("Protocol").string(var_200.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_tag(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Tag,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_201) = &input.key {
        object.key("Key").string(var_201.as_str());
    }
    if let Some(var_202) = &input.value {
        object.key("Value").string(var_202.as_str());
    }
    Ok(())
}

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

pub fn serialize_structure_crate_model_aws_location(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AwsLocation,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_204) = &input.zone {
        object.key("Zone").string(var_204.as_str());
    }
    if let Some(var_205) = &input.subnet_arn {
        object.key("SubnetArn").string(var_205.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_location(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Location,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_206) = &input.address {
        object.key("Address").string(var_206.as_str());
    }
    if let Some(var_207) = &input.latitude {
        object.key("Latitude").string(var_207.as_str());
    }
    if let Some(var_208) = &input.longitude {
        object.key("Longitude").string(var_208.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_bandwidth(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Bandwidth,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_209) = &input.upload_speed {
        object.key("UploadSpeed").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_209).into()),
        );
    }
    if let Some(var_210) = &input.download_speed {
        object.key("DownloadSpeed").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_210).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_vpc_options(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::VpcOptions,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if input.ipv6_support {
        object.key("Ipv6Support").boolean(input.ipv6_support);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_route_table_identifier(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::RouteTableIdentifier,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_211) = &input.transit_gateway_route_table_arn {
        object
            .key("TransitGatewayRouteTableArn")
            .string(var_211.as_str());
    }
    if let Some(var_212) = &input.core_network_segment_edge {
        #[allow(unused_mut)]
        let mut object_213 = object.key("CoreNetworkSegmentEdge").start_object();
        crate::json_ser::serialize_structure_crate_model_core_network_segment_edge_identifier(
            &mut object_213,
            var_212,
        )?;
        object_213.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_route_analysis_endpoint_options_specification(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::RouteAnalysisEndpointOptionsSpecification,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_214) = &input.transit_gateway_attachment_arn {
        object
            .key("TransitGatewayAttachmentArn")
            .string(var_214.as_str());
    }
    if let Some(var_215) = &input.ip_address {
        object.key("IpAddress").string(var_215.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_core_network_segment_edge_identifier(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::CoreNetworkSegmentEdgeIdentifier,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_216) = &input.core_network_id {
        object.key("CoreNetworkId").string(var_216.as_str());
    }
    if let Some(var_217) = &input.segment_name {
        object.key("SegmentName").string(var_217.as_str());
    }
    if let Some(var_218) = &input.edge_location {
        object.key("EdgeLocation").string(var_218.as_str());
    }
    Ok(())
}