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