| | | 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 VirtualMachineScaleSetPublicIPAddressConfiguration : IUtf8JsonSerializable |
| | | 15 | | { |
| | | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | | 17 | | { |
| | 16 | 18 | | writer.WriteStartObject(); |
| | 16 | 19 | | writer.WritePropertyName("name"); |
| | 16 | 20 | | writer.WriteStringValue(Name); |
| | 16 | 21 | | writer.WritePropertyName("properties"); |
| | 16 | 22 | | writer.WriteStartObject(); |
| | 16 | 23 | | if (IdleTimeoutInMinutes != null) |
| | | 24 | | { |
| | 16 | 25 | | writer.WritePropertyName("idleTimeoutInMinutes"); |
| | 16 | 26 | | writer.WriteNumberValue(IdleTimeoutInMinutes.Value); |
| | | 27 | | } |
| | 16 | 28 | | if (DnsSettings != null) |
| | | 29 | | { |
| | 16 | 30 | | writer.WritePropertyName("dnsSettings"); |
| | 16 | 31 | | writer.WriteObjectValue(DnsSettings); |
| | | 32 | | } |
| | 16 | 33 | | if (IpTags != null) |
| | | 34 | | { |
| | 0 | 35 | | writer.WritePropertyName("ipTags"); |
| | 0 | 36 | | writer.WriteStartArray(); |
| | 0 | 37 | | foreach (var item in IpTags) |
| | | 38 | | { |
| | 0 | 39 | | writer.WriteObjectValue(item); |
| | | 40 | | } |
| | 0 | 41 | | writer.WriteEndArray(); |
| | | 42 | | } |
| | 16 | 43 | | if (PublicIPPrefix != null) |
| | | 44 | | { |
| | 8 | 45 | | writer.WritePropertyName("publicIPPrefix"); |
| | 8 | 46 | | writer.WriteObjectValue(PublicIPPrefix); |
| | | 47 | | } |
| | 16 | 48 | | if (PublicIPAddressVersion != null) |
| | | 49 | | { |
| | 0 | 50 | | writer.WritePropertyName("publicIPAddressVersion"); |
| | 0 | 51 | | writer.WriteStringValue(PublicIPAddressVersion.Value.ToString()); |
| | | 52 | | } |
| | 16 | 53 | | writer.WriteEndObject(); |
| | 16 | 54 | | writer.WriteEndObject(); |
| | 16 | 55 | | } |
| | | 56 | | |
| | | 57 | | internal static VirtualMachineScaleSetPublicIPAddressConfiguration DeserializeVirtualMachineScaleSetPublicIPAddr |
| | | 58 | | { |
| | 24 | 59 | | string name = default; |
| | 24 | 60 | | int? idleTimeoutInMinutes = default; |
| | 24 | 61 | | VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings = default; |
| | 24 | 62 | | IList<VirtualMachineScaleSetIpTag> ipTags = default; |
| | 24 | 63 | | SubResource publicIPPrefix = default; |
| | 24 | 64 | | IPVersion? publicIPAddressVersion = default; |
| | 144 | 65 | | foreach (var property in element.EnumerateObject()) |
| | | 66 | | { |
| | 48 | 67 | | if (property.NameEquals("name")) |
| | | 68 | | { |
| | 24 | 69 | | name = property.Value.GetString(); |
| | 24 | 70 | | continue; |
| | | 71 | | } |
| | 24 | 72 | | if (property.NameEquals("properties")) |
| | | 73 | | { |
| | 264 | 74 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | | 75 | | { |
| | 108 | 76 | | if (property0.NameEquals("idleTimeoutInMinutes")) |
| | | 77 | | { |
| | 24 | 78 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 79 | | { |
| | | 80 | | continue; |
| | | 81 | | } |
| | 24 | 82 | | idleTimeoutInMinutes = property0.Value.GetInt32(); |
| | 24 | 83 | | continue; |
| | | 84 | | } |
| | 84 | 85 | | if (property0.NameEquals("dnsSettings")) |
| | | 86 | | { |
| | 24 | 87 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 88 | | { |
| | | 89 | | continue; |
| | | 90 | | } |
| | 24 | 91 | | dnsSettings = VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.DeserializeVirtu |
| | 24 | 92 | | continue; |
| | | 93 | | } |
| | 60 | 94 | | if (property0.NameEquals("ipTags")) |
| | | 95 | | { |
| | 24 | 96 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 97 | | { |
| | | 98 | | continue; |
| | | 99 | | } |
| | 24 | 100 | | List<VirtualMachineScaleSetIpTag> array = new List<VirtualMachineScaleSetIpTag>(); |
| | 0 | 101 | | foreach (var item in property0.Value.EnumerateArray()) |
| | | 102 | | { |
| | 0 | 103 | | if (item.ValueKind == JsonValueKind.Null) |
| | | 104 | | { |
| | 0 | 105 | | array.Add(null); |
| | | 106 | | } |
| | | 107 | | else |
| | | 108 | | { |
| | 0 | 109 | | array.Add(VirtualMachineScaleSetIpTag.DeserializeVirtualMachineScaleSetIpTag(item)); |
| | | 110 | | } |
| | | 111 | | } |
| | 24 | 112 | | ipTags = array; |
| | 24 | 113 | | continue; |
| | | 114 | | } |
| | 36 | 115 | | if (property0.NameEquals("publicIPPrefix")) |
| | | 116 | | { |
| | 12 | 117 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 118 | | { |
| | | 119 | | continue; |
| | | 120 | | } |
| | 12 | 121 | | publicIPPrefix = SubResource.DeserializeSubResource(property0.Value); |
| | 12 | 122 | | continue; |
| | | 123 | | } |
| | 24 | 124 | | if (property0.NameEquals("publicIPAddressVersion")) |
| | | 125 | | { |
| | 24 | 126 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 127 | | { |
| | | 128 | | continue; |
| | | 129 | | } |
| | 24 | 130 | | publicIPAddressVersion = new IPVersion(property0.Value.GetString()); |
| | | 131 | | continue; |
| | | 132 | | } |
| | | 133 | | } |
| | | 134 | | continue; |
| | | 135 | | } |
| | | 136 | | } |
| | 24 | 137 | | return new VirtualMachineScaleSetPublicIPAddressConfiguration(name, idleTimeoutInMinutes, dnsSettings, ipTag |
| | | 138 | | } |
| | | 139 | | } |
| | | 140 | | } |