| | 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 VirtualMachineScaleSetNetworkConfigurationDnsSettings : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 8 | 18 | | writer.WriteStartObject(); |
| 8 | 19 | | if (DnsServers != null) |
| | 20 | | { |
| 8 | 21 | | writer.WritePropertyName("dnsServers"); |
| 8 | 22 | | writer.WriteStartArray(); |
| 48 | 23 | | foreach (var item in DnsServers) |
| | 24 | | { |
| 16 | 25 | | writer.WriteStringValue(item); |
| | 26 | | } |
| 8 | 27 | | writer.WriteEndArray(); |
| | 28 | | } |
| 8 | 29 | | writer.WriteEndObject(); |
| 8 | 30 | | } |
| | 31 | |
|
| | 32 | | internal static VirtualMachineScaleSetNetworkConfigurationDnsSettings DeserializeVirtualMachineScaleSetNetworkCo |
| | 33 | | { |
| 536 | 34 | | IList<string> dnsServers = default; |
| 2144 | 35 | | foreach (var property in element.EnumerateObject()) |
| | 36 | | { |
| 536 | 37 | | if (property.NameEquals("dnsServers")) |
| | 38 | | { |
| 536 | 39 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 40 | | { |
| | 41 | | continue; |
| | 42 | | } |
| 536 | 43 | | List<string> array = new List<string>(); |
| 1120 | 44 | | foreach (var item in property.Value.EnumerateArray()) |
| | 45 | | { |
| 24 | 46 | | if (item.ValueKind == JsonValueKind.Null) |
| | 47 | | { |
| 0 | 48 | | array.Add(null); |
| | 49 | | } |
| | 50 | | else |
| | 51 | | { |
| 24 | 52 | | array.Add(item.GetString()); |
| | 53 | | } |
| | 54 | | } |
| 536 | 55 | | dnsServers = array; |
| | 56 | | continue; |
| | 57 | | } |
| | 58 | | } |
| 536 | 59 | | return new VirtualMachineScaleSetNetworkConfigurationDnsSettings(dnsServers); |
| | 60 | | } |
| | 61 | | } |
| | 62 | | } |