| | 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.Resources.Models |
| | 13 | | { |
| | 14 | | public partial class DeploymentOperationProperties |
| | 15 | | { |
| | 16 | | internal static DeploymentOperationProperties DeserializeDeploymentOperationProperties(JsonElement element) |
| | 17 | | { |
| 60 | 18 | | ProvisioningOperation? provisioningOperation = default; |
| 60 | 19 | | string provisioningState = default; |
| 60 | 20 | | DateTimeOffset? timestamp = default; |
| 60 | 21 | | string duration = default; |
| 60 | 22 | | string serviceRequestId = default; |
| 60 | 23 | | string statusCode = default; |
| 60 | 24 | | object statusMessage = default; |
| 60 | 25 | | TargetResource targetResource = default; |
| 60 | 26 | | HttpMessage request = default; |
| 60 | 27 | | HttpMessage response = default; |
| 992 | 28 | | foreach (var property in element.EnumerateObject()) |
| | 29 | | { |
| 436 | 30 | | if (property.NameEquals("provisioningOperation")) |
| | 31 | | { |
| 44 | 32 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 33 | | { |
| | 34 | | continue; |
| | 35 | | } |
| 44 | 36 | | provisioningOperation = property.Value.GetString().ToProvisioningOperation(); |
| 44 | 37 | | continue; |
| | 38 | | } |
| 392 | 39 | | if (property.NameEquals("provisioningState")) |
| | 40 | | { |
| 60 | 41 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 42 | | { |
| | 43 | | continue; |
| | 44 | | } |
| 60 | 45 | | provisioningState = property.Value.GetString(); |
| 60 | 46 | | continue; |
| | 47 | | } |
| 332 | 48 | | if (property.NameEquals("timestamp")) |
| | 49 | | { |
| 60 | 50 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 51 | | { |
| | 52 | | continue; |
| | 53 | | } |
| 60 | 54 | | timestamp = property.Value.GetDateTimeOffset("O"); |
| 60 | 55 | | continue; |
| | 56 | | } |
| 272 | 57 | | if (property.NameEquals("duration")) |
| | 58 | | { |
| 44 | 59 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 60 | | { |
| | 61 | | continue; |
| | 62 | | } |
| 44 | 63 | | duration = property.Value.GetString(); |
| 44 | 64 | | continue; |
| | 65 | | } |
| 228 | 66 | | if (property.NameEquals("serviceRequestId")) |
| | 67 | | { |
| 32 | 68 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 69 | | { |
| | 70 | | continue; |
| | 71 | | } |
| 32 | 72 | | serviceRequestId = property.Value.GetString(); |
| 32 | 73 | | continue; |
| | 74 | | } |
| 196 | 75 | | if (property.NameEquals("statusCode")) |
| | 76 | | { |
| 60 | 77 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 78 | | { |
| | 79 | | continue; |
| | 80 | | } |
| 60 | 81 | | statusCode = property.Value.GetString(); |
| 60 | 82 | | continue; |
| | 83 | | } |
| 136 | 84 | | if (property.NameEquals("statusMessage")) |
| | 85 | | { |
| 28 | 86 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 87 | | { |
| | 88 | | continue; |
| | 89 | | } |
| 12 | 90 | | statusMessage = property.Value.GetObject(); |
| 12 | 91 | | continue; |
| | 92 | | } |
| 108 | 93 | | if (property.NameEquals("targetResource")) |
| | 94 | | { |
| 48 | 95 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 96 | | { |
| | 97 | | continue; |
| | 98 | | } |
| 48 | 99 | | targetResource = TargetResource.DeserializeTargetResource(property.Value); |
| 48 | 100 | | continue; |
| | 101 | | } |
| 60 | 102 | | if (property.NameEquals("request")) |
| | 103 | | { |
| 0 | 104 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 105 | | { |
| | 106 | | continue; |
| | 107 | | } |
| 0 | 108 | | request = HttpMessage.DeserializeHttpMessage(property.Value); |
| 0 | 109 | | continue; |
| | 110 | | } |
| 60 | 111 | | if (property.NameEquals("response")) |
| | 112 | | { |
| 0 | 113 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 114 | | { |
| | 115 | | continue; |
| | 116 | | } |
| 0 | 117 | | response = HttpMessage.DeserializeHttpMessage(property.Value); |
| | 118 | | continue; |
| | 119 | | } |
| | 120 | | } |
| 60 | 121 | | return new DeploymentOperationProperties(provisioningOperation, provisioningState, timestamp, duration, serv |
| | 122 | | } |
| | 123 | | } |
| | 124 | | } |