|  |  | 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 TerminateNotificationProfile : IUtf8JsonSerializable | 
|  |  | 14 |  |     { | 
|  |  | 15 |  |         void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) | 
|  |  | 16 |  |         { | 
|  | 8 | 17 |  |             writer.WriteStartObject(); | 
|  | 8 | 18 |  |             if (NotBeforeTimeout != null) | 
|  |  | 19 |  |             { | 
|  | 8 | 20 |  |                 writer.WritePropertyName("notBeforeTimeout"); | 
|  | 8 | 21 |  |                 writer.WriteStringValue(NotBeforeTimeout); | 
|  |  | 22 |  |             } | 
|  | 8 | 23 |  |             if (Enable != null) | 
|  |  | 24 |  |             { | 
|  | 8 | 25 |  |                 writer.WritePropertyName("enable"); | 
|  | 8 | 26 |  |                 writer.WriteBooleanValue(Enable.Value); | 
|  |  | 27 |  |             } | 
|  | 8 | 28 |  |             writer.WriteEndObject(); | 
|  | 8 | 29 |  |         } | 
|  |  | 30 |  |  | 
|  |  | 31 |  |         internal static TerminateNotificationProfile DeserializeTerminateNotificationProfile(JsonElement element) | 
|  |  | 32 |  |         { | 
|  | 12 | 33 |  |             string notBeforeTimeout = default; | 
|  | 12 | 34 |  |             bool? enable = default; | 
|  | 72 | 35 |  |             foreach (var property in element.EnumerateObject()) | 
|  |  | 36 |  |             { | 
|  | 24 | 37 |  |                 if (property.NameEquals("notBeforeTimeout")) | 
|  |  | 38 |  |                 { | 
|  | 12 | 39 |  |                     if (property.Value.ValueKind == JsonValueKind.Null) | 
|  |  | 40 |  |                     { | 
|  |  | 41 |  |                         continue; | 
|  |  | 42 |  |                     } | 
|  | 12 | 43 |  |                     notBeforeTimeout = property.Value.GetString(); | 
|  | 12 | 44 |  |                     continue; | 
|  |  | 45 |  |                 } | 
|  | 12 | 46 |  |                 if (property.NameEquals("enable")) | 
|  |  | 47 |  |                 { | 
|  | 12 | 48 |  |                     if (property.Value.ValueKind == JsonValueKind.Null) | 
|  |  | 49 |  |                     { | 
|  |  | 50 |  |                         continue; | 
|  |  | 51 |  |                     } | 
|  | 12 | 52 |  |                     enable = property.Value.GetBoolean(); | 
|  |  | 53 |  |                     continue; | 
|  |  | 54 |  |                 } | 
|  |  | 55 |  |             } | 
|  | 12 | 56 |  |             return new TerminateNotificationProfile(notBeforeTimeout, enable); | 
|  |  | 57 |  |         } | 
|  |  | 58 |  |     } | 
|  |  | 59 |  | } |