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