| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | // <auto-generated/> |
| | | 5 | | |
| | | 6 | | #nullable disable |
| | | 7 | | |
| | | 8 | | using System.Collections.Generic; |
| | | 9 | | using System.Text.Json; |
| | | 10 | | using Azure.Core; |
| | | 11 | | |
| | | 12 | | namespace Azure.ResourceManager.Compute.Models |
| | | 13 | | { |
| | | 14 | | public partial class VirtualMachineScaleSetIPConfiguration : IUtf8JsonSerializable |
| | | 15 | | { |
| | | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | | 17 | | { |
| | 380 | 18 | | writer.WriteStartObject(); |
| | 380 | 19 | | writer.WritePropertyName("name"); |
| | 380 | 20 | | writer.WriteStringValue(Name); |
| | 380 | 21 | | if (Id != null) |
| | | 22 | | { |
| | 0 | 23 | | writer.WritePropertyName("id"); |
| | 0 | 24 | | writer.WriteStringValue(Id); |
| | | 25 | | } |
| | 380 | 26 | | writer.WritePropertyName("properties"); |
| | 380 | 27 | | writer.WriteStartObject(); |
| | 380 | 28 | | if (Subnet != null) |
| | | 29 | | { |
| | 372 | 30 | | writer.WritePropertyName("subnet"); |
| | 372 | 31 | | writer.WriteObjectValue(Subnet); |
| | | 32 | | } |
| | 380 | 33 | | if (Primary != null) |
| | | 34 | | { |
| | 8 | 35 | | writer.WritePropertyName("primary"); |
| | 8 | 36 | | writer.WriteBooleanValue(Primary.Value); |
| | | 37 | | } |
| | 380 | 38 | | if (PublicIPAddressConfiguration != null) |
| | | 39 | | { |
| | 16 | 40 | | writer.WritePropertyName("publicIPAddressConfiguration"); |
| | 16 | 41 | | writer.WriteObjectValue(PublicIPAddressConfiguration); |
| | | 42 | | } |
| | 380 | 43 | | if (PrivateIPAddressVersion != null) |
| | | 44 | | { |
| | 16 | 45 | | writer.WritePropertyName("privateIPAddressVersion"); |
| | 16 | 46 | | writer.WriteStringValue(PrivateIPAddressVersion.Value.ToString()); |
| | | 47 | | } |
| | 380 | 48 | | if (ApplicationGatewayBackendAddressPools != null) |
| | | 49 | | { |
| | 364 | 50 | | writer.WritePropertyName("applicationGatewayBackendAddressPools"); |
| | 364 | 51 | | writer.WriteStartArray(); |
| | 744 | 52 | | foreach (var item in ApplicationGatewayBackendAddressPools) |
| | | 53 | | { |
| | 8 | 54 | | writer.WriteObjectValue(item); |
| | | 55 | | } |
| | 364 | 56 | | writer.WriteEndArray(); |
| | | 57 | | } |
| | 380 | 58 | | if (ApplicationSecurityGroups != null) |
| | | 59 | | { |
| | 0 | 60 | | writer.WritePropertyName("applicationSecurityGroups"); |
| | 0 | 61 | | writer.WriteStartArray(); |
| | 0 | 62 | | foreach (var item in ApplicationSecurityGroups) |
| | | 63 | | { |
| | 0 | 64 | | writer.WriteObjectValue(item); |
| | | 65 | | } |
| | 0 | 66 | | writer.WriteEndArray(); |
| | | 67 | | } |
| | 380 | 68 | | if (LoadBalancerBackendAddressPools != null) |
| | | 69 | | { |
| | 48 | 70 | | writer.WritePropertyName("loadBalancerBackendAddressPools"); |
| | 48 | 71 | | writer.WriteStartArray(); |
| | 192 | 72 | | foreach (var item in LoadBalancerBackendAddressPools) |
| | | 73 | | { |
| | 48 | 74 | | writer.WriteObjectValue(item); |
| | | 75 | | } |
| | 48 | 76 | | writer.WriteEndArray(); |
| | | 77 | | } |
| | 380 | 78 | | if (LoadBalancerInboundNatPools != null) |
| | | 79 | | { |
| | 0 | 80 | | writer.WritePropertyName("loadBalancerInboundNatPools"); |
| | 0 | 81 | | writer.WriteStartArray(); |
| | 0 | 82 | | foreach (var item in LoadBalancerInboundNatPools) |
| | | 83 | | { |
| | 0 | 84 | | writer.WriteObjectValue(item); |
| | | 85 | | } |
| | 0 | 86 | | writer.WriteEndArray(); |
| | | 87 | | } |
| | 380 | 88 | | writer.WriteEndObject(); |
| | 380 | 89 | | writer.WriteEndObject(); |
| | 380 | 90 | | } |
| | | 91 | | |
| | | 92 | | internal static VirtualMachineScaleSetIPConfiguration DeserializeVirtualMachineScaleSetIPConfiguration(JsonEleme |
| | | 93 | | { |
| | 560 | 94 | | string name = default; |
| | 560 | 95 | | string id = default; |
| | 560 | 96 | | ApiEntityReference subnet = default; |
| | 560 | 97 | | bool? primary = default; |
| | 560 | 98 | | VirtualMachineScaleSetPublicIPAddressConfiguration publicIPAddressConfiguration = default; |
| | 560 | 99 | | IPVersion? privateIPAddressVersion = default; |
| | 560 | 100 | | IList<SubResource> applicationGatewayBackendAddressPools = default; |
| | 560 | 101 | | IList<SubResource> applicationSecurityGroups = default; |
| | 560 | 102 | | IList<SubResource> loadBalancerBackendAddressPools = default; |
| | 560 | 103 | | IList<SubResource> loadBalancerInboundNatPools = default; |
| | 3360 | 104 | | foreach (var property in element.EnumerateObject()) |
| | | 105 | | { |
| | 1120 | 106 | | if (property.NameEquals("name")) |
| | | 107 | | { |
| | 560 | 108 | | name = property.Value.GetString(); |
| | 560 | 109 | | continue; |
| | | 110 | | } |
| | 560 | 111 | | if (property.NameEquals("id")) |
| | | 112 | | { |
| | 0 | 113 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 114 | | { |
| | | 115 | | continue; |
| | | 116 | | } |
| | 0 | 117 | | id = property.Value.GetString(); |
| | 0 | 118 | | continue; |
| | | 119 | | } |
| | 560 | 120 | | if (property.NameEquals("properties")) |
| | | 121 | | { |
| | 3520 | 122 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | | 123 | | { |
| | 1200 | 124 | | if (property0.NameEquals("subnet")) |
| | | 125 | | { |
| | 548 | 126 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 127 | | { |
| | | 128 | | continue; |
| | | 129 | | } |
| | 548 | 130 | | subnet = ApiEntityReference.DeserializeApiEntityReference(property0.Value); |
| | 548 | 131 | | continue; |
| | | 132 | | } |
| | 652 | 133 | | if (property0.NameEquals("primary")) |
| | | 134 | | { |
| | 12 | 135 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 136 | | { |
| | | 137 | | continue; |
| | | 138 | | } |
| | 12 | 139 | | primary = property0.Value.GetBoolean(); |
| | 12 | 140 | | continue; |
| | | 141 | | } |
| | 640 | 142 | | if (property0.NameEquals("publicIPAddressConfiguration")) |
| | | 143 | | { |
| | 24 | 144 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 145 | | { |
| | | 146 | | continue; |
| | | 147 | | } |
| | 24 | 148 | | publicIPAddressConfiguration = VirtualMachineScaleSetPublicIPAddressConfiguration.Deserializ |
| | 24 | 149 | | continue; |
| | | 150 | | } |
| | 616 | 151 | | if (property0.NameEquals("privateIPAddressVersion")) |
| | | 152 | | { |
| | 560 | 153 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 154 | | { |
| | | 155 | | continue; |
| | | 156 | | } |
| | 560 | 157 | | privateIPAddressVersion = new IPVersion(property0.Value.GetString()); |
| | 560 | 158 | | continue; |
| | | 159 | | } |
| | 56 | 160 | | if (property0.NameEquals("applicationGatewayBackendAddressPools")) |
| | | 161 | | { |
| | 8 | 162 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 163 | | { |
| | | 164 | | continue; |
| | | 165 | | } |
| | 8 | 166 | | List<SubResource> array = new List<SubResource>(); |
| | 32 | 167 | | foreach (var item in property0.Value.EnumerateArray()) |
| | | 168 | | { |
| | 8 | 169 | | if (item.ValueKind == JsonValueKind.Null) |
| | | 170 | | { |
| | 0 | 171 | | array.Add(null); |
| | | 172 | | } |
| | | 173 | | else |
| | | 174 | | { |
| | 8 | 175 | | array.Add(DeserializeSubResource(item)); |
| | | 176 | | } |
| | | 177 | | } |
| | 8 | 178 | | applicationGatewayBackendAddressPools = array; |
| | 8 | 179 | | continue; |
| | | 180 | | } |
| | 48 | 181 | | if (property0.NameEquals("applicationSecurityGroups")) |
| | | 182 | | { |
| | 0 | 183 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 184 | | { |
| | | 185 | | continue; |
| | | 186 | | } |
| | 0 | 187 | | List<SubResource> array = new List<SubResource>(); |
| | 0 | 188 | | foreach (var item in property0.Value.EnumerateArray()) |
| | | 189 | | { |
| | 0 | 190 | | if (item.ValueKind == JsonValueKind.Null) |
| | | 191 | | { |
| | 0 | 192 | | array.Add(null); |
| | | 193 | | } |
| | | 194 | | else |
| | | 195 | | { |
| | 0 | 196 | | array.Add(DeserializeSubResource(item)); |
| | | 197 | | } |
| | | 198 | | } |
| | 0 | 199 | | applicationSecurityGroups = array; |
| | 0 | 200 | | continue; |
| | | 201 | | } |
| | 48 | 202 | | if (property0.NameEquals("loadBalancerBackendAddressPools")) |
| | | 203 | | { |
| | 48 | 204 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 205 | | { |
| | | 206 | | continue; |
| | | 207 | | } |
| | 48 | 208 | | List<SubResource> array = new List<SubResource>(); |
| | 192 | 209 | | foreach (var item in property0.Value.EnumerateArray()) |
| | | 210 | | { |
| | 48 | 211 | | if (item.ValueKind == JsonValueKind.Null) |
| | | 212 | | { |
| | 0 | 213 | | array.Add(null); |
| | | 214 | | } |
| | | 215 | | else |
| | | 216 | | { |
| | 48 | 217 | | array.Add(DeserializeSubResource(item)); |
| | | 218 | | } |
| | | 219 | | } |
| | 48 | 220 | | loadBalancerBackendAddressPools = array; |
| | 48 | 221 | | continue; |
| | | 222 | | } |
| | 0 | 223 | | if (property0.NameEquals("loadBalancerInboundNatPools")) |
| | | 224 | | { |
| | 0 | 225 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 226 | | { |
| | | 227 | | continue; |
| | | 228 | | } |
| | 0 | 229 | | List<SubResource> array = new List<SubResource>(); |
| | 0 | 230 | | foreach (var item in property0.Value.EnumerateArray()) |
| | | 231 | | { |
| | 0 | 232 | | if (item.ValueKind == JsonValueKind.Null) |
| | | 233 | | { |
| | 0 | 234 | | array.Add(null); |
| | | 235 | | } |
| | | 236 | | else |
| | | 237 | | { |
| | 0 | 238 | | array.Add(DeserializeSubResource(item)); |
| | | 239 | | } |
| | | 240 | | } |
| | 0 | 241 | | loadBalancerInboundNatPools = array; |
| | | 242 | | continue; |
| | | 243 | | } |
| | | 244 | | } |
| | | 245 | | continue; |
| | | 246 | | } |
| | | 247 | | } |
| | 560 | 248 | | return new VirtualMachineScaleSetIPConfiguration(id, name, subnet, primary, publicIPAddressConfiguration, pr |
| | | 249 | | } |
| | | 250 | | } |
| | | 251 | | } |