| | 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.Network.Models |
| | 13 | | { |
| | 14 | | public partial class NetworkInterfaceDnsSettings : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 72 | 18 | | writer.WriteStartObject(); |
| 72 | 19 | | if (DnsServers != null) |
| | 20 | | { |
| 72 | 21 | | writer.WritePropertyName("dnsServers"); |
| 72 | 22 | | writer.WriteStartArray(); |
| 208 | 23 | | foreach (var item in DnsServers) |
| | 24 | | { |
| 32 | 25 | | writer.WriteStringValue(item); |
| | 26 | | } |
| 72 | 27 | | writer.WriteEndArray(); |
| | 28 | | } |
| 72 | 29 | | if (AppliedDnsServers != null) |
| | 30 | | { |
| 56 | 31 | | writer.WritePropertyName("appliedDnsServers"); |
| 56 | 32 | | writer.WriteStartArray(); |
| 0 | 33 | | foreach (var item in AppliedDnsServers) |
| | 34 | | { |
| 0 | 35 | | writer.WriteStringValue(item); |
| | 36 | | } |
| 56 | 37 | | writer.WriteEndArray(); |
| | 38 | | } |
| 72 | 39 | | if (InternalDnsNameLabel != null) |
| | 40 | | { |
| 16 | 41 | | writer.WritePropertyName("internalDnsNameLabel"); |
| 16 | 42 | | writer.WriteStringValue(InternalDnsNameLabel); |
| | 43 | | } |
| 72 | 44 | | if (InternalFqdn != null) |
| | 45 | | { |
| 0 | 46 | | writer.WritePropertyName("internalFqdn"); |
| 0 | 47 | | writer.WriteStringValue(InternalFqdn); |
| | 48 | | } |
| 72 | 49 | | if (InternalDomainNameSuffix != null) |
| | 50 | | { |
| 56 | 51 | | writer.WritePropertyName("internalDomainNameSuffix"); |
| 56 | 52 | | writer.WriteStringValue(InternalDomainNameSuffix); |
| | 53 | | } |
| 72 | 54 | | writer.WriteEndObject(); |
| 72 | 55 | | } |
| | 56 | |
|
| | 57 | | internal static NetworkInterfaceDnsSettings DeserializeNetworkInterfaceDnsSettings(JsonElement element) |
| | 58 | | { |
| 252 | 59 | | IList<string> dnsServers = default; |
| 252 | 60 | | IList<string> appliedDnsServers = default; |
| 252 | 61 | | string internalDnsNameLabel = default; |
| 252 | 62 | | string internalFqdn = default; |
| 252 | 63 | | string internalDomainNameSuffix = default; |
| 2064 | 64 | | foreach (var property in element.EnumerateObject()) |
| | 65 | | { |
| 780 | 66 | | if (property.NameEquals("dnsServers")) |
| | 67 | | { |
| 252 | 68 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 69 | | { |
| | 70 | | continue; |
| | 71 | | } |
| 252 | 72 | | List<string> array = new List<string>(); |
| 616 | 73 | | foreach (var item in property.Value.EnumerateArray()) |
| | 74 | | { |
| 56 | 75 | | if (item.ValueKind == JsonValueKind.Null) |
| | 76 | | { |
| 0 | 77 | | array.Add(null); |
| | 78 | | } |
| | 79 | | else |
| | 80 | | { |
| 56 | 81 | | array.Add(item.GetString()); |
| | 82 | | } |
| | 83 | | } |
| 252 | 84 | | dnsServers = array; |
| 252 | 85 | | continue; |
| | 86 | | } |
| 528 | 87 | | if (property.NameEquals("appliedDnsServers")) |
| | 88 | | { |
| 252 | 89 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 90 | | { |
| | 91 | | continue; |
| | 92 | | } |
| 252 | 93 | | List<string> array = new List<string>(); |
| 536 | 94 | | foreach (var item in property.Value.EnumerateArray()) |
| | 95 | | { |
| 16 | 96 | | if (item.ValueKind == JsonValueKind.Null) |
| | 97 | | { |
| 0 | 98 | | array.Add(null); |
| | 99 | | } |
| | 100 | | else |
| | 101 | | { |
| 16 | 102 | | array.Add(item.GetString()); |
| | 103 | | } |
| | 104 | | } |
| 252 | 105 | | appliedDnsServers = array; |
| 252 | 106 | | continue; |
| | 107 | | } |
| 276 | 108 | | if (property.NameEquals("internalDnsNameLabel")) |
| | 109 | | { |
| 16 | 110 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 111 | | { |
| | 112 | | continue; |
| | 113 | | } |
| 16 | 114 | | internalDnsNameLabel = property.Value.GetString(); |
| 16 | 115 | | continue; |
| | 116 | | } |
| 260 | 117 | | if (property.NameEquals("internalFqdn")) |
| | 118 | | { |
| 16 | 119 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 120 | | { |
| | 121 | | continue; |
| | 122 | | } |
| 16 | 123 | | internalFqdn = property.Value.GetString(); |
| 16 | 124 | | continue; |
| | 125 | | } |
| 244 | 126 | | if (property.NameEquals("internalDomainNameSuffix")) |
| | 127 | | { |
| 244 | 128 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 129 | | { |
| | 130 | | continue; |
| | 131 | | } |
| 244 | 132 | | internalDomainNameSuffix = property.Value.GetString(); |
| | 133 | | continue; |
| | 134 | | } |
| | 135 | | } |
| 252 | 136 | | return new NetworkInterfaceDnsSettings(dnsServers, appliedDnsServers, internalDnsNameLabel, internalFqdn, in |
| | 137 | | } |
| | 138 | | } |
| | 139 | | } |