| | 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 VirtualMachineScaleSetUpdateNetworkConfiguration : 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 (Primary != null) |
| | 32 | | { |
| 0 | 33 | | writer.WritePropertyName("primary"); |
| 0 | 34 | | writer.WriteBooleanValue(Primary.Value); |
| | 35 | | } |
| 0 | 36 | | if (EnableAcceleratedNetworking != null) |
| | 37 | | { |
| 0 | 38 | | writer.WritePropertyName("enableAcceleratedNetworking"); |
| 0 | 39 | | writer.WriteBooleanValue(EnableAcceleratedNetworking.Value); |
| | 40 | | } |
| 0 | 41 | | if (NetworkSecurityGroup != null) |
| | 42 | | { |
| 0 | 43 | | writer.WritePropertyName("networkSecurityGroup"); |
| 0 | 44 | | writer.WriteObjectValue(NetworkSecurityGroup); |
| | 45 | | } |
| 0 | 46 | | if (DnsSettings != null) |
| | 47 | | { |
| 0 | 48 | | writer.WritePropertyName("dnsSettings"); |
| 0 | 49 | | writer.WriteObjectValue(DnsSettings); |
| | 50 | | } |
| 0 | 51 | | if (IpConfigurations != null) |
| | 52 | | { |
| 0 | 53 | | writer.WritePropertyName("ipConfigurations"); |
| 0 | 54 | | writer.WriteStartArray(); |
| 0 | 55 | | foreach (var item in IpConfigurations) |
| | 56 | | { |
| 0 | 57 | | writer.WriteObjectValue(item); |
| | 58 | | } |
| 0 | 59 | | writer.WriteEndArray(); |
| | 60 | | } |
| 0 | 61 | | if (EnableIPForwarding != null) |
| | 62 | | { |
| 0 | 63 | | writer.WritePropertyName("enableIPForwarding"); |
| 0 | 64 | | writer.WriteBooleanValue(EnableIPForwarding.Value); |
| | 65 | | } |
| 0 | 66 | | writer.WriteEndObject(); |
| 0 | 67 | | writer.WriteEndObject(); |
| 0 | 68 | | } |
| | 69 | |
|
| | 70 | | internal static VirtualMachineScaleSetUpdateNetworkConfiguration DeserializeVirtualMachineScaleSetUpdateNetworkC |
| | 71 | | { |
| 0 | 72 | | string name = default; |
| 0 | 73 | | string id = default; |
| 0 | 74 | | bool? primary = default; |
| 0 | 75 | | bool? enableAcceleratedNetworking = default; |
| 0 | 76 | | SubResource networkSecurityGroup = default; |
| 0 | 77 | | VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default; |
| 0 | 78 | | IList<VirtualMachineScaleSetUpdateIPConfiguration> ipConfigurations = default; |
| 0 | 79 | | bool? enableIPForwarding = default; |
| 0 | 80 | | foreach (var property in element.EnumerateObject()) |
| | 81 | | { |
| 0 | 82 | | if (property.NameEquals("name")) |
| | 83 | | { |
| 0 | 84 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 85 | | { |
| | 86 | | continue; |
| | 87 | | } |
| 0 | 88 | | name = property.Value.GetString(); |
| 0 | 89 | | continue; |
| | 90 | | } |
| 0 | 91 | | if (property.NameEquals("id")) |
| | 92 | | { |
| 0 | 93 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 94 | | { |
| | 95 | | continue; |
| | 96 | | } |
| 0 | 97 | | id = property.Value.GetString(); |
| 0 | 98 | | continue; |
| | 99 | | } |
| 0 | 100 | | if (property.NameEquals("properties")) |
| | 101 | | { |
| 0 | 102 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 103 | | { |
| 0 | 104 | | if (property0.NameEquals("primary")) |
| | 105 | | { |
| 0 | 106 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 107 | | { |
| | 108 | | continue; |
| | 109 | | } |
| 0 | 110 | | primary = property0.Value.GetBoolean(); |
| 0 | 111 | | continue; |
| | 112 | | } |
| 0 | 113 | | if (property0.NameEquals("enableAcceleratedNetworking")) |
| | 114 | | { |
| 0 | 115 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 116 | | { |
| | 117 | | continue; |
| | 118 | | } |
| 0 | 119 | | enableAcceleratedNetworking = property0.Value.GetBoolean(); |
| 0 | 120 | | continue; |
| | 121 | | } |
| 0 | 122 | | if (property0.NameEquals("networkSecurityGroup")) |
| | 123 | | { |
| 0 | 124 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 125 | | { |
| | 126 | | continue; |
| | 127 | | } |
| 0 | 128 | | networkSecurityGroup = DeserializeSubResource(property0.Value); |
| 0 | 129 | | continue; |
| | 130 | | } |
| 0 | 131 | | if (property0.NameEquals("dnsSettings")) |
| | 132 | | { |
| 0 | 133 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 134 | | { |
| | 135 | | continue; |
| | 136 | | } |
| 0 | 137 | | dnsSettings = VirtualMachineScaleSetNetworkConfigurationDnsSettings.DeserializeVirtualMachin |
| 0 | 138 | | continue; |
| | 139 | | } |
| 0 | 140 | | if (property0.NameEquals("ipConfigurations")) |
| | 141 | | { |
| 0 | 142 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 143 | | { |
| | 144 | | continue; |
| | 145 | | } |
| 0 | 146 | | List<VirtualMachineScaleSetUpdateIPConfiguration> array = new List<VirtualMachineScaleSetUpd |
| 0 | 147 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 148 | | { |
| 0 | 149 | | if (item.ValueKind == JsonValueKind.Null) |
| | 150 | | { |
| 0 | 151 | | array.Add(null); |
| | 152 | | } |
| | 153 | | else |
| | 154 | | { |
| 0 | 155 | | array.Add(VirtualMachineScaleSetUpdateIPConfiguration.DeserializeVirtualMachineScale |
| | 156 | | } |
| | 157 | | } |
| 0 | 158 | | ipConfigurations = array; |
| 0 | 159 | | continue; |
| | 160 | | } |
| 0 | 161 | | if (property0.NameEquals("enableIPForwarding")) |
| | 162 | | { |
| 0 | 163 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 164 | | { |
| | 165 | | continue; |
| | 166 | | } |
| 0 | 167 | | enableIPForwarding = property0.Value.GetBoolean(); |
| | 168 | | continue; |
| | 169 | | } |
| | 170 | | } |
| | 171 | | continue; |
| | 172 | | } |
| | 173 | | } |
| 0 | 174 | | return new VirtualMachineScaleSetUpdateNetworkConfiguration(id, name, primary, enableAcceleratedNetworking, |
| | 175 | | } |
| | 176 | | } |
| | 177 | | } |