| | 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; |
| | 9 | | using System.Text.Json; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.ResourceManager.Compute.Models |
| | 13 | | { |
| | 14 | | public partial class UpgradeOperationHistoryStatus |
| | 15 | | { |
| | 16 | | internal static UpgradeOperationHistoryStatus DeserializeUpgradeOperationHistoryStatus(JsonElement element) |
| | 17 | | { |
| 0 | 18 | | UpgradeState? code = default; |
| 0 | 19 | | DateTimeOffset? startTime = default; |
| 0 | 20 | | DateTimeOffset? endTime = default; |
| 0 | 21 | | foreach (var property in element.EnumerateObject()) |
| | 22 | | { |
| 0 | 23 | | if (property.NameEquals("code")) |
| | 24 | | { |
| 0 | 25 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 26 | | { |
| | 27 | | continue; |
| | 28 | | } |
| 0 | 29 | | code = property.Value.GetString().ToUpgradeState(); |
| 0 | 30 | | continue; |
| | 31 | | } |
| 0 | 32 | | if (property.NameEquals("startTime")) |
| | 33 | | { |
| 0 | 34 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 35 | | { |
| | 36 | | continue; |
| | 37 | | } |
| 0 | 38 | | startTime = property.Value.GetDateTimeOffset("O"); |
| 0 | 39 | | continue; |
| | 40 | | } |
| 0 | 41 | | if (property.NameEquals("endTime")) |
| | 42 | | { |
| 0 | 43 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 44 | | { |
| | 45 | | continue; |
| | 46 | | } |
| 0 | 47 | | endTime = property.Value.GetDateTimeOffset("O"); |
| | 48 | | continue; |
| | 49 | | } |
| | 50 | | } |
| 0 | 51 | | return new UpgradeOperationHistoryStatus(code, startTime, endTime); |
| | 52 | | } |
| | 53 | | } |
| | 54 | | } |