azure-lite-rs 0.1.1

Lightweight HTTP client for Azure APIs
Documentation
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
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
//! Types for the Azure Networking API (v1).
//!
//! Auto-generated from the Azure ARM REST Specification.
//! **Do not edit manually** — modify the manifest and re-run codegen.

use serde::{Deserialize, Serialize};
use std::collections::HashMap;

/// AddressSpace contains an array of IP address ranges.
///
/// **Azure API**: `networking.v1.AddressSpace`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//AddressSpace>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AddressSpace {
    /// A list of address blocks reserved for this virtual network in CIDR notation
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub address_prefixes: Vec<String>,
}

impl AddressSpace {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            address_prefixes: vec![],
        }
    }
}

/// DhcpOptions contains an array of DNS servers available to VMs.
///
/// **Azure API**: `networking.v1.DhcpOptions`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//DhcpOptions>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DhcpOptions {
    /// The list of DNS servers IP addresses
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub dns_servers: Vec<String>,
}

impl DhcpOptions {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            dns_servers: vec![],
        }
    }
}

/// Properties of the subnet.
///
/// **Azure API**: `networking.v1.SubnetPropertiesFormat`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//SubnetPropertiesFormat>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SubnetPropertiesFormat {
    /// The address prefix for the subnet
    #[serde(skip_serializing_if = "Option::is_none")]
    pub address_prefix: Option<String>,

    /// List of address prefixes for the subnet
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub address_prefixes: Vec<String>,

    /// The provisioning state of the subnet resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provisioning_state: Option<String>,

    /// Enable or Disable apply network policies on private endpoint in the subnet
    #[serde(skip_serializing_if = "Option::is_none")]
    pub private_endpoint_network_policies: Option<String>,

    /// Enable or Disable apply network policies on private link service in the subnet
    #[serde(skip_serializing_if = "Option::is_none")]
    pub private_link_service_network_policies: Option<String>,

    /// The reference to the NetworkSecurityGroup resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub network_security_group: Option<SubResource>,
}

impl SubnetPropertiesFormat {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            address_prefix: Some("test-address_prefix".into()),
            address_prefixes: vec![],
            provisioning_state: Some("test-provisioning_state".into()),
            private_endpoint_network_policies: Some(
                "test-private_endpoint_network_policies".into(),
            ),
            private_link_service_network_policies: Some(
                "test-private_link_service_network_policies".into(),
            ),
            network_security_group: Some(SubResource::fixture()),
        }
    }
}

/// Subnet in a virtual network resource.
///
/// **Azure API**: `networking.v1.Subnet`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//Subnet>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Subnet {
    /// Resource ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// The name of the resource that is unique within a resource group
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Resource type
    #[serde(rename = "type")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,

    /// A unique read-only string that changes whenever the resource is updated
    #[serde(skip_serializing_if = "Option::is_none")]
    pub etag: Option<String>,

    /// Properties of the subnet
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<SubnetPropertiesFormat>,
}

impl Subnet {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-subnet".into()),
            r#type: Some("test-type".into()),
            etag: Some("test-etag".into()),
            properties: Some(SubnetPropertiesFormat::fixture()),
        }
    }
}

/// Reference to another sub resource.
///
/// **Azure API**: `networking.v1.SubResource`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//SubResource>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SubResource {
    /// Resource ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
}

impl SubResource {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
        }
    }
}

/// Properties of the virtual network.
///
/// **Azure API**: `networking.v1.VirtualNetworkPropertiesFormat`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//VirtualNetworkPropertiesFormat>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VirtualNetworkPropertiesFormat {
    /// The provisioning state of the virtual network resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provisioning_state: Option<String>,

    /// The AddressSpace that contains an array of IP address ranges
    #[serde(skip_serializing_if = "Option::is_none")]
    pub address_space: Option<AddressSpace>,

    /// The dhcpOptions that contains an array of DNS servers
    #[serde(skip_serializing_if = "Option::is_none")]
    pub dhcp_options: Option<DhcpOptions>,

    /// A list of subnets in a Virtual Network
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub subnets: Vec<Subnet>,

    /// A list of peerings in a Virtual Network
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub virtual_network_peerings: Vec<VirtualNetworkPeering>,

    /// Indicates if DDoS protection is enabled for all the protected resources in the virtual
    /// network
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enable_ddos_protection: Option<bool>,

    /// Indicates if VM protection is enabled for all the subnets in the virtual network
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enable_vm_protection: Option<bool>,
}

impl VirtualNetworkPropertiesFormat {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            provisioning_state: Some("test-provisioning_state".into()),
            address_space: Some(AddressSpace::fixture()),
            dhcp_options: Some(DhcpOptions::fixture()),
            subnets: vec![],
            virtual_network_peerings: vec![],
            enable_ddos_protection: Some(false),
            enable_vm_protection: Some(false),
        }
    }
}

/// Peerings in a virtual network resource.
///
/// **Azure API**: `networking.v1.VirtualNetworkPeering`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//VirtualNetworkPeering>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VirtualNetworkPeering {
    /// Resource ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// The name of the resource that is unique within a resource group
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Properties of the virtual network peering
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<VirtualNetworkPeeringPropertiesFormat>,
}

impl VirtualNetworkPeering {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-virtual_network_peering".into()),
            properties: Some(VirtualNetworkPeeringPropertiesFormat::fixture()),
        }
    }
}

/// Properties of the virtual network peering.
///
/// **Azure API**: `networking.v1.VirtualNetworkPeeringPropertiesFormat`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//VirtualNetworkPeeringPropertiesFormat>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VirtualNetworkPeeringPropertiesFormat {
    /// Whether the VMs in the local virtual network space would be able to access the VMs in
    /// remote virtual network space
    #[serde(skip_serializing_if = "Option::is_none")]
    pub allow_virtual_network_access: Option<bool>,

    /// Whether the forwarded traffic from the VMs in the local virtual network will be
    /// allowed/disallowed in remote virtual network
    #[serde(skip_serializing_if = "Option::is_none")]
    pub allow_forwarded_traffic: Option<bool>,

    /// The status of the virtual network peering
    #[serde(skip_serializing_if = "Option::is_none")]
    pub peering_state: Option<String>,

    /// The provisioning state of the virtual network peering resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provisioning_state: Option<String>,

    /// The reference to the remote virtual network
    #[serde(skip_serializing_if = "Option::is_none")]
    pub remote_virtual_network: Option<SubResource>,
}

impl VirtualNetworkPeeringPropertiesFormat {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            allow_virtual_network_access: Some(false),
            allow_forwarded_traffic: Some(false),
            peering_state: Some("test-peering_state".into()),
            provisioning_state: Some("test-provisioning_state".into()),
            remote_virtual_network: Some(SubResource::fixture()),
        }
    }
}

/// Virtual Network resource.
///
/// **Azure API**: `networking.v1.VirtualNetwork`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//VirtualNetwork>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VirtualNetwork {
    /// Resource ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// Resource name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Resource type
    #[serde(rename = "type")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,

    /// Resource location
    #[serde(skip_serializing_if = "Option::is_none")]
    pub location: Option<String>,

    /// Resource tags
    #[serde(default)]
    #[serde(skip_serializing_if = "HashMap::is_empty")]
    pub tags: HashMap<String, String>,

    /// A unique read-only string that changes whenever the resource is updated
    #[serde(skip_serializing_if = "Option::is_none")]
    pub etag: Option<String>,

    /// Properties of the virtual network
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<VirtualNetworkPropertiesFormat>,
}

impl VirtualNetwork {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-virtual_network".into()),
            r#type: Some("test-type".into()),
            location: Some("test-location".into()),
            tags: Default::default(),
            etag: Some("test-etag".into()),
            properties: Some(VirtualNetworkPropertiesFormat::fixture()),
        }
    }
}

/// Response for the ListVirtualNetworks API service call.
///
/// **Azure API**: `networking.v1.VirtualNetworkListResult`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//VirtualNetworkListResult>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VirtualNetworkListResult {
    /// A list of VirtualNetwork resources in a resource group
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub value: Vec<VirtualNetwork>,

    /// The URL to get the next set of results
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_link: Option<String>,
}

impl VirtualNetworkListResult {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            value: vec![],
            next_link: Some("test-next_link".into()),
        }
    }
}

/// Request body for creating or updating a virtual network.
///
/// **Azure API**: `networking.v1.VirtualNetworkCreateRequest`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//VirtualNetworkCreateRequest>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VirtualNetworkCreateRequest {
    /// Resource location
    pub location: String,

    /// Resource tags
    #[serde(default)]
    #[serde(skip_serializing_if = "HashMap::is_empty")]
    pub tags: HashMap<String, String>,

    /// Properties of the virtual network
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<VirtualNetworkPropertiesFormat>,
}

impl VirtualNetworkCreateRequest {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            location: "test-location".into(),
            tags: Default::default(),
            properties: Some(VirtualNetworkPropertiesFormat::fixture()),
        }
    }
}

/// Response for ListSubnets API service call.
///
/// **Azure API**: `networking.v1.SubnetListResult`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//SubnetListResult>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SubnetListResult {
    /// The subnets in a virtual network
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub value: Vec<Subnet>,

    /// The URL to get the next set of results
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_link: Option<String>,
}

impl SubnetListResult {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            value: vec![],
            next_link: Some("test-next_link".into()),
        }
    }
}

/// Security rule resource.
///
/// **Azure API**: `networking.v1.SecurityRulePropertiesFormat`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//SecurityRulePropertiesFormat>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SecurityRulePropertiesFormat {
    /// A description for this rule
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,

    /// Network protocol this rule applies to (Tcp, Udp, Icmp, Esp, Ah, *)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub protocol: Option<String>,

    /// The source port or range
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source_port_range: Option<String>,

    /// The destination port or range
    #[serde(skip_serializing_if = "Option::is_none")]
    pub destination_port_range: Option<String>,

    /// The CIDR or source IP range
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source_address_prefix: Option<String>,

    /// The destination address prefix
    #[serde(skip_serializing_if = "Option::is_none")]
    pub destination_address_prefix: Option<String>,

    /// The source port ranges
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub source_port_ranges: Vec<String>,

    /// The destination port ranges
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub destination_port_ranges: Vec<String>,

    /// The CIDR or source IP ranges
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub source_address_prefixes: Vec<String>,

    /// The destination address prefixes
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub destination_address_prefixes: Vec<String>,

    /// The network traffic is allowed or denied (Allow, Deny)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub access: Option<String>,

    /// The priority of the rule (100–4096)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub priority: Option<i32>,

    /// The direction of the rule (Inbound, Outbound)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub direction: Option<String>,

    /// The provisioning state of the security rule resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provisioning_state: Option<String>,
}

impl SecurityRulePropertiesFormat {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            description: Some("test-description".into()),
            protocol: Some("test-protocol".into()),
            source_port_range: Some("test-source_port_range".into()),
            destination_port_range: Some("test-destination_port_range".into()),
            source_address_prefix: Some("test-source_address_prefix".into()),
            destination_address_prefix: Some("test-destination_address_prefix".into()),
            source_port_ranges: vec![],
            destination_port_ranges: vec![],
            source_address_prefixes: vec![],
            destination_address_prefixes: vec![],
            access: Some("test-access".into()),
            priority: Some(100),
            direction: Some("test-direction".into()),
            provisioning_state: Some("test-provisioning_state".into()),
        }
    }
}

/// Network security rule.
///
/// **Azure API**: `networking.v1.SecurityRule`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//SecurityRule>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SecurityRule {
    /// Resource ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// The name of the resource that is unique within a resource group
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Resource type
    #[serde(rename = "type")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,

    /// A unique read-only string that changes whenever the resource is updated
    #[serde(skip_serializing_if = "Option::is_none")]
    pub etag: Option<String>,

    /// Properties of the security rule
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<SecurityRulePropertiesFormat>,
}

impl SecurityRule {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-security_rule".into()),
            r#type: Some("test-type".into()),
            etag: Some("test-etag".into()),
            properties: Some(SecurityRulePropertiesFormat::fixture()),
        }
    }
}

/// Response for ListSecurityRule API service call.
///
/// **Azure API**: `networking.v1.SecurityRuleListResult`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//SecurityRuleListResult>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SecurityRuleListResult {
    /// The security rules in a network security group
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub value: Vec<SecurityRule>,

    /// The URL to get the next set of results
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_link: Option<String>,
}

impl SecurityRuleListResult {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            value: vec![],
            next_link: Some("test-next_link".into()),
        }
    }
}

/// Network Security Group resource.
///
/// **Azure API**: `networking.v1.NetworkSecurityGroupPropertiesFormat`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//NetworkSecurityGroupPropertiesFormat>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct NetworkSecurityGroupPropertiesFormat {
    /// A collection of security rules of the network security group
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub security_rules: Vec<SecurityRule>,

    /// The default security rules of network security group
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub default_security_rules: Vec<SecurityRule>,

    /// A collection of references to network interfaces
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub network_interfaces: Vec<SubResource>,

    /// A collection of references to subnets
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub subnets: Vec<SubResource>,

    /// The provisioning state of the network security group resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provisioning_state: Option<String>,

    /// The resource GUID property of the network security group resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resource_guid: Option<String>,
}

impl NetworkSecurityGroupPropertiesFormat {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            security_rules: vec![],
            default_security_rules: vec![],
            network_interfaces: vec![],
            subnets: vec![],
            provisioning_state: Some("test-provisioning_state".into()),
            resource_guid: Some("test-resource_guid".into()),
        }
    }
}

/// NetworkSecurityGroup resource.
///
/// **Azure API**: `networking.v1.NetworkSecurityGroup`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//NetworkSecurityGroup>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct NetworkSecurityGroup {
    /// Resource ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// Resource name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Resource type
    #[serde(rename = "type")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,

    /// Resource location
    #[serde(skip_serializing_if = "Option::is_none")]
    pub location: Option<String>,

    /// Resource tags
    #[serde(default)]
    #[serde(skip_serializing_if = "HashMap::is_empty")]
    pub tags: HashMap<String, String>,

    /// A unique read-only string that changes whenever the resource is updated
    #[serde(skip_serializing_if = "Option::is_none")]
    pub etag: Option<String>,

    /// Properties of the network security group
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<NetworkSecurityGroupPropertiesFormat>,
}

impl NetworkSecurityGroup {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-network_security_group".into()),
            r#type: Some("test-type".into()),
            location: Some("test-location".into()),
            tags: Default::default(),
            etag: Some("test-etag".into()),
            properties: Some(NetworkSecurityGroupPropertiesFormat::fixture()),
        }
    }
}

/// Response for ListNetworkSecurityGroups API service call.
///
/// **Azure API**: `networking.v1.NetworkSecurityGroupListResult`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//NetworkSecurityGroupListResult>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct NetworkSecurityGroupListResult {
    /// A list of NetworkSecurityGroup resources
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub value: Vec<NetworkSecurityGroup>,

    /// The URL to get the next set of results
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_link: Option<String>,
}

impl NetworkSecurityGroupListResult {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            value: vec![],
            next_link: Some("test-next_link".into()),
        }
    }
}

/// Request body for creating or updating a network security group.
///
/// **Azure API**: `networking.v1.NetworkSecurityGroupCreateRequest`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//NetworkSecurityGroupCreateRequest>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct NetworkSecurityGroupCreateRequest {
    /// Resource location
    pub location: String,

    /// Resource tags
    #[serde(default)]
    #[serde(skip_serializing_if = "HashMap::is_empty")]
    pub tags: HashMap<String, String>,

    /// Properties of the network security group
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<NetworkSecurityGroupPropertiesFormat>,
}

impl NetworkSecurityGroupCreateRequest {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            location: "test-location".into(),
            tags: Default::default(),
            properties: Some(NetworkSecurityGroupPropertiesFormat::fixture()),
        }
    }
}

/// Frontend IP address of the load balancer.
///
/// **Azure API**: `networking.v1.FrontendIPConfiguration`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//FrontendIPConfiguration>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct FrontendIPConfiguration {
    /// Resource ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// The name of the resource that is unique within a resource group
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Properties of the frontend IP configuration
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<FrontendIPConfigurationPropertiesFormat>,
}

impl FrontendIPConfiguration {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-frontend_ip_configuration".into()),
            properties: Some(FrontendIPConfigurationPropertiesFormat::fixture()),
        }
    }
}

/// Properties of Frontend IP Configuration of the load balancer.
///
/// **Azure API**: `networking.v1.FrontendIPConfigurationPropertiesFormat`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//FrontendIPConfigurationPropertiesFormat>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct FrontendIPConfigurationPropertiesFormat {
    /// The private IP address of the IP configuration
    #[serde(rename = "privateIPAddress")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub private_ip_address: Option<String>,

    /// The Private IP allocation method (Dynamic or Static)
    #[serde(rename = "privateIPAllocationMethod")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub private_ip_allocation_method: Option<String>,

    /// The reference to the subnet resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub subnet: Option<SubResource>,

    /// The reference to the Public IP resource
    #[serde(rename = "publicIPAddress")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub public_ip_address: Option<SubResource>,

    /// The provisioning state of the frontend IP configuration resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provisioning_state: Option<String>,
}

impl FrontendIPConfigurationPropertiesFormat {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            private_ip_address: Some("test-private_ip_address".into()),
            private_ip_allocation_method: Some("test-private_ip_allocation_method".into()),
            subnet: Some(SubResource::fixture()),
            public_ip_address: Some(SubResource::fixture()),
            provisioning_state: Some("test-provisioning_state".into()),
        }
    }
}

/// Pool of backend IP addresses.
///
/// **Azure API**: `networking.v1.BackendAddressPool`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//BackendAddressPool>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BackendAddressPool {
    /// Resource ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// The name of the resource that is unique within the set of backend address pools used by
    /// the load balancer
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Properties of load balancer backend address pool
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<BackendAddressPoolPropertiesFormat>,
}

impl BackendAddressPool {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-backend_address_pool".into()),
            properties: Some(BackendAddressPoolPropertiesFormat::fixture()),
        }
    }
}

/// Properties of the backend address pool.
///
/// **Azure API**: `networking.v1.BackendAddressPoolPropertiesFormat`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//BackendAddressPoolPropertiesFormat>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BackendAddressPoolPropertiesFormat {
    /// The provisioning state of the backend address pool resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provisioning_state: Option<String>,

    /// An array of backend addresses
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub load_balancer_backend_addresses: Vec<LoadBalancerBackendAddress>,
}

impl BackendAddressPoolPropertiesFormat {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            provisioning_state: Some("test-provisioning_state".into()),
            load_balancer_backend_addresses: vec![],
        }
    }
}

/// Load balancer backend addresses.
///
/// **Azure API**: `networking.v1.LoadBalancerBackendAddress`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//LoadBalancerBackendAddress>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LoadBalancerBackendAddress {
    /// Name of the backend address
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Properties of load balancer backend address
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<LoadBalancerBackendAddressPropertiesFormat>,
}

impl LoadBalancerBackendAddress {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            name: Some("test-load_balancer_backend_address".into()),
            properties: Some(LoadBalancerBackendAddressPropertiesFormat::fixture()),
        }
    }
}

/// Properties of the load balancer backend addresses.
///
/// **Azure API**: `networking.v1.LoadBalancerBackendAddressPropertiesFormat`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//LoadBalancerBackendAddressPropertiesFormat>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LoadBalancerBackendAddressPropertiesFormat {
    /// IP Address belonging to the referenced virtual network
    #[serde(skip_serializing_if = "Option::is_none")]
    pub ip_address: Option<String>,

    /// Reference to an existing virtual network
    #[serde(skip_serializing_if = "Option::is_none")]
    pub virtual_network: Option<SubResource>,
}

impl LoadBalancerBackendAddressPropertiesFormat {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            ip_address: Some("test-ip_address".into()),
            virtual_network: Some(SubResource::fixture()),
        }
    }
}

/// A load balancer probe.
///
/// **Azure API**: `networking.v1.Probe`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//Probe>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Probe {
    /// Resource ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// The name of the resource that is unique within the set of probes used by the load
    /// balancer
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Properties of load balancer probe
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<ProbePropertiesFormat>,
}

impl Probe {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-probe".into()),
            properties: Some(ProbePropertiesFormat::fixture()),
        }
    }
}

/// Load balancer probe resource.
///
/// **Azure API**: `networking.v1.ProbePropertiesFormat`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//ProbePropertiesFormat>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ProbePropertiesFormat {
    /// The protocol of the end point (Http, Https, Tcp)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub protocol: Option<String>,

    /// The port for communicating the probe
    #[serde(skip_serializing_if = "Option::is_none")]
    pub port: Option<i32>,

    /// The interval, in seconds, for how frequently to probe the endpoint for health status
    #[serde(skip_serializing_if = "Option::is_none")]
    pub interval_in_seconds: Option<i32>,

    /// The number of probes where if no response, will result in stopping further traffic from
    /// being delivered to the endpoint
    #[serde(skip_serializing_if = "Option::is_none")]
    pub number_of_probes: Option<i32>,

    /// The URI used for requesting health status from the VM (Http/Https only)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub request_path: Option<String>,

    /// The provisioning state of the probe resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provisioning_state: Option<String>,
}

impl ProbePropertiesFormat {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            protocol: Some("test-protocol".into()),
            port: Some(100),
            interval_in_seconds: Some(100),
            number_of_probes: Some(100),
            request_path: Some("test-request_path".into()),
            provisioning_state: Some("test-provisioning_state".into()),
        }
    }
}

/// A load balancing rule for a load balancer.
///
/// **Azure API**: `networking.v1.LoadBalancingRule`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//LoadBalancingRule>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LoadBalancingRule {
    /// Resource ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// The name of the resource that is unique within the set of load balancing rules used by
    /// the load balancer
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Properties of load balancer load balancing rule
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<LoadBalancingRulePropertiesFormat>,
}

impl LoadBalancingRule {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-load_balancing_rule".into()),
            properties: Some(LoadBalancingRulePropertiesFormat::fixture()),
        }
    }
}

/// Properties of the load balancer.
///
/// **Azure API**: `networking.v1.LoadBalancingRulePropertiesFormat`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//LoadBalancingRulePropertiesFormat>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LoadBalancingRulePropertiesFormat {
    /// The reference to the transport protocol used by the load balancing rule (Tcp, Udp, All)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub protocol: Option<String>,

    /// The port for the external endpoint
    #[serde(skip_serializing_if = "Option::is_none")]
    pub frontend_port: Option<i32>,

    /// The port used for internal connections on the endpoint
    #[serde(skip_serializing_if = "Option::is_none")]
    pub backend_port: Option<i32>,

    /// A reference to frontend IP addresses
    #[serde(skip_serializing_if = "Option::is_none")]
    pub frontend_ip_configuration: Option<SubResource>,

    /// A reference to a pool of DIPs
    #[serde(skip_serializing_if = "Option::is_none")]
    pub backend_address_pool: Option<SubResource>,

    /// The reference to the load balancer probe used by the load balancing rule
    #[serde(skip_serializing_if = "Option::is_none")]
    pub probe: Option<SubResource>,

    /// Configures a virtual machine's endpoint for the floating IP capability required to
    /// configure a SQL AlwaysOn Availability Group
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enable_floating_ip: Option<bool>,

    /// The timeout for the TCP idle connection
    #[serde(skip_serializing_if = "Option::is_none")]
    pub idle_timeout_in_minutes: Option<i32>,

    /// The load distribution policy for this rule (Default, SourceIP, SourceIPProtocol)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub load_distribution: Option<String>,

    /// The provisioning state of the load balancing rule resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provisioning_state: Option<String>,
}

impl LoadBalancingRulePropertiesFormat {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            protocol: Some("test-protocol".into()),
            frontend_port: Some(100),
            backend_port: Some(100),
            frontend_ip_configuration: Some(SubResource::fixture()),
            backend_address_pool: Some(SubResource::fixture()),
            probe: Some(SubResource::fixture()),
            enable_floating_ip: Some(false),
            idle_timeout_in_minutes: Some(100),
            load_distribution: Some("test-load_distribution".into()),
            provisioning_state: Some("test-provisioning_state".into()),
        }
    }
}

/// SKU of a load balancer.
///
/// **Azure API**: `networking.v1.LoadBalancerSku`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//LoadBalancerSku>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LoadBalancerSku {
    /// Name of a load balancer SKU (Basic, Standard, Gateway)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Tier of a load balancer SKU (Regional, Global)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tier: Option<String>,
}

impl LoadBalancerSku {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            name: Some("test-load_balancer_sku".into()),
            tier: Some("test-tier".into()),
        }
    }
}

/// Properties of the load balancer.
///
/// **Azure API**: `networking.v1.LoadBalancerPropertiesFormat`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//LoadBalancerPropertiesFormat>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LoadBalancerPropertiesFormat {
    /// Object representing the frontend IPs to be used for the load balancer
    #[serde(rename = "frontendIPConfigurations")]
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub frontend_ip_configurations: Vec<FrontendIPConfiguration>,

    /// Collection of backend address pools used by a load balancer
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub backend_address_pools: Vec<BackendAddressPool>,

    /// Collection of probe objects used in the load balancer
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub probes: Vec<Probe>,

    /// Object collection representing the load balancing rules Gets the provisioning
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub load_balancing_rules: Vec<LoadBalancingRule>,

    /// The provisioning state of the load balancer resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provisioning_state: Option<String>,

    /// The resource GUID property of the load balancer resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resource_guid: Option<String>,
}

impl LoadBalancerPropertiesFormat {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            frontend_ip_configurations: vec![],
            backend_address_pools: vec![],
            probes: vec![],
            load_balancing_rules: vec![],
            provisioning_state: Some("test-provisioning_state".into()),
            resource_guid: Some("test-resource_guid".into()),
        }
    }
}

/// LoadBalancer resource.
///
/// **Azure API**: `networking.v1.LoadBalancer`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//LoadBalancer>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LoadBalancer {
    /// Resource ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// Resource name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Resource type
    #[serde(rename = "type")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,

    /// Resource location
    #[serde(skip_serializing_if = "Option::is_none")]
    pub location: Option<String>,

    /// Resource tags
    #[serde(default)]
    #[serde(skip_serializing_if = "HashMap::is_empty")]
    pub tags: HashMap<String, String>,

    /// A unique read-only string that changes whenever the resource is updated
    #[serde(skip_serializing_if = "Option::is_none")]
    pub etag: Option<String>,

    /// The load balancer SKU
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sku: Option<LoadBalancerSku>,

    /// Properties of load balancer
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<LoadBalancerPropertiesFormat>,
}

impl LoadBalancer {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-load_balancer".into()),
            r#type: Some("test-type".into()),
            location: Some("test-location".into()),
            tags: Default::default(),
            etag: Some("test-etag".into()),
            sku: Some(LoadBalancerSku::fixture()),
            properties: Some(LoadBalancerPropertiesFormat::fixture()),
        }
    }
}

/// Response for ListLoadBalancers API service call.
///
/// **Azure API**: `networking.v1.LoadBalancerListResult`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//LoadBalancerListResult>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LoadBalancerListResult {
    /// A list of load balancers in a resource group
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub value: Vec<LoadBalancer>,

    /// The URL to get the next set of results
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_link: Option<String>,
}

impl LoadBalancerListResult {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            value: vec![],
            next_link: Some("test-next_link".into()),
        }
    }
}

/// Request body for creating or updating a load balancer.
///
/// **Azure API**: `networking.v1.LoadBalancerCreateRequest`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/virtualnetwork//LoadBalancerCreateRequest>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LoadBalancerCreateRequest {
    /// Resource location
    pub location: String,

    /// Resource tags
    #[serde(default)]
    #[serde(skip_serializing_if = "HashMap::is_empty")]
    pub tags: HashMap<String, String>,

    /// The load balancer SKU
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sku: Option<LoadBalancerSku>,

    /// Properties of load balancer
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<LoadBalancerPropertiesFormat>,
}

impl LoadBalancerCreateRequest {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            location: "test-location".into(),
            tags: Default::default(),
            sku: Some(LoadBalancerSku::fixture()),
            properties: Some(LoadBalancerPropertiesFormat::fixture()),
        }
    }
}