| | 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.Text.Json; |
| | 9 | | using Azure.Core; |
| | 10 | |
|
| | 11 | | namespace Azure.ResourceManager.Compute.Models |
| | 12 | | { |
| | 13 | | public partial class VirtualMachineScaleSetUpdatePublicIPAddressConfiguration : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | if (Name != null) |
| | 19 | | { |
| 0 | 20 | | writer.WritePropertyName("name"); |
| 0 | 21 | | writer.WriteStringValue(Name); |
| | 22 | | } |
| 0 | 23 | | writer.WritePropertyName("properties"); |
| 0 | 24 | | writer.WriteStartObject(); |
| 0 | 25 | | if (IdleTimeoutInMinutes != null) |
| | 26 | | { |
| 0 | 27 | | writer.WritePropertyName("idleTimeoutInMinutes"); |
| 0 | 28 | | writer.WriteNumberValue(IdleTimeoutInMinutes.Value); |
| | 29 | | } |
| 0 | 30 | | if (DnsSettings != null) |
| | 31 | | { |
| 0 | 32 | | writer.WritePropertyName("dnsSettings"); |
| 0 | 33 | | writer.WriteObjectValue(DnsSettings); |
| | 34 | | } |
| 0 | 35 | | writer.WriteEndObject(); |
| 0 | 36 | | writer.WriteEndObject(); |
| 0 | 37 | | } |
| | 38 | |
|
| | 39 | | internal static VirtualMachineScaleSetUpdatePublicIPAddressConfiguration DeserializeVirtualMachineScaleSetUpdate |
| | 40 | | { |
| 0 | 41 | | string name = default; |
| 0 | 42 | | int? idleTimeoutInMinutes = default; |
| 0 | 43 | | VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings = default; |
| 0 | 44 | | foreach (var property in element.EnumerateObject()) |
| | 45 | | { |
| 0 | 46 | | if (property.NameEquals("name")) |
| | 47 | | { |
| 0 | 48 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 49 | | { |
| | 50 | | continue; |
| | 51 | | } |
| 0 | 52 | | name = property.Value.GetString(); |
| 0 | 53 | | continue; |
| | 54 | | } |
| 0 | 55 | | if (property.NameEquals("properties")) |
| | 56 | | { |
| 0 | 57 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 58 | | { |
| 0 | 59 | | if (property0.NameEquals("idleTimeoutInMinutes")) |
| | 60 | | { |
| 0 | 61 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 62 | | { |
| | 63 | | continue; |
| | 64 | | } |
| 0 | 65 | | idleTimeoutInMinutes = property0.Value.GetInt32(); |
| 0 | 66 | | continue; |
| | 67 | | } |
| 0 | 68 | | if (property0.NameEquals("dnsSettings")) |
| | 69 | | { |
| 0 | 70 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 71 | | { |
| | 72 | | continue; |
| | 73 | | } |
| 0 | 74 | | dnsSettings = VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.DeserializeVirtu |
| | 75 | | continue; |
| | 76 | | } |
| | 77 | | } |
| | 78 | | continue; |
| | 79 | | } |
| | 80 | | } |
| 0 | 81 | | return new VirtualMachineScaleSetUpdatePublicIPAddressConfiguration(name, idleTimeoutInMinutes, dnsSettings) |
| | 82 | | } |
| | 83 | | } |
| | 84 | | } |