| | 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 UpgradeOperationHistoricalStatusInfoProperties |
| | 14 | | { |
| | 15 | | internal static UpgradeOperationHistoricalStatusInfoProperties DeserializeUpgradeOperationHistoricalStatusInfoPr |
| | 16 | | { |
| 0 | 17 | | UpgradeOperationHistoryStatus runningStatus = default; |
| 0 | 18 | | RollingUpgradeProgressInfo progress = default; |
| 0 | 19 | | ApiError error = default; |
| 0 | 20 | | UpgradeOperationInvoker? startedBy = default; |
| 0 | 21 | | ImageReference targetImageReference = default; |
| 0 | 22 | | RollbackStatusInfo rollbackInfo = default; |
| 0 | 23 | | foreach (var property in element.EnumerateObject()) |
| | 24 | | { |
| 0 | 25 | | if (property.NameEquals("runningStatus")) |
| | 26 | | { |
| 0 | 27 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 28 | | { |
| | 29 | | continue; |
| | 30 | | } |
| 0 | 31 | | runningStatus = UpgradeOperationHistoryStatus.DeserializeUpgradeOperationHistoryStatus(property.Valu |
| 0 | 32 | | continue; |
| | 33 | | } |
| 0 | 34 | | if (property.NameEquals("progress")) |
| | 35 | | { |
| 0 | 36 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 37 | | { |
| | 38 | | continue; |
| | 39 | | } |
| 0 | 40 | | progress = RollingUpgradeProgressInfo.DeserializeRollingUpgradeProgressInfo(property.Value); |
| 0 | 41 | | continue; |
| | 42 | | } |
| 0 | 43 | | if (property.NameEquals("error")) |
| | 44 | | { |
| 0 | 45 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 46 | | { |
| | 47 | | continue; |
| | 48 | | } |
| 0 | 49 | | error = ApiError.DeserializeApiError(property.Value); |
| 0 | 50 | | continue; |
| | 51 | | } |
| 0 | 52 | | if (property.NameEquals("startedBy")) |
| | 53 | | { |
| 0 | 54 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 55 | | { |
| | 56 | | continue; |
| | 57 | | } |
| 0 | 58 | | startedBy = property.Value.GetString().ToUpgradeOperationInvoker(); |
| 0 | 59 | | continue; |
| | 60 | | } |
| 0 | 61 | | if (property.NameEquals("targetImageReference")) |
| | 62 | | { |
| 0 | 63 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 64 | | { |
| | 65 | | continue; |
| | 66 | | } |
| 0 | 67 | | targetImageReference = ImageReference.DeserializeImageReference(property.Value); |
| 0 | 68 | | continue; |
| | 69 | | } |
| 0 | 70 | | if (property.NameEquals("rollbackInfo")) |
| | 71 | | { |
| 0 | 72 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 73 | | { |
| | 74 | | continue; |
| | 75 | | } |
| 0 | 76 | | rollbackInfo = RollbackStatusInfo.DeserializeRollbackStatusInfo(property.Value); |
| | 77 | | continue; |
| | 78 | | } |
| | 79 | | } |
| 0 | 80 | | return new UpgradeOperationHistoricalStatusInfoProperties(runningStatus, progress, error, startedBy, targetI |
| | 81 | | } |
| | 82 | | } |
| | 83 | | } |