| | 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.Collections.Generic; |
| | 10 | | using System.Text.Json; |
| | 11 | | using Azure.Core; |
| | 12 | |
|
| | 13 | | namespace Azure.ResourceManager.Resources.Models |
| | 14 | | { |
| | 15 | | public partial class DeploymentPropertiesExtended |
| | 16 | | { |
| | 17 | | internal static DeploymentPropertiesExtended DeserializeDeploymentPropertiesExtended(JsonElement element) |
| | 18 | | { |
| 128 | 19 | | string provisioningState = default; |
| 128 | 20 | | string correlationId = default; |
| 128 | 21 | | DateTimeOffset? timestamp = default; |
| 128 | 22 | | string duration = default; |
| 128 | 23 | | object outputs = default; |
| 128 | 24 | | IReadOnlyList<Provider> providers = default; |
| 128 | 25 | | IReadOnlyList<Dependency> dependencies = default; |
| 128 | 26 | | TemplateLink templateLink = default; |
| 128 | 27 | | object parameters = default; |
| 128 | 28 | | ParametersLink parametersLink = default; |
| 128 | 29 | | DeploymentMode? mode = default; |
| 128 | 30 | | DebugSetting debugSetting = default; |
| 128 | 31 | | OnErrorDeploymentExtended onErrorDeployment = default; |
| 128 | 32 | | string templateHash = default; |
| 128 | 33 | | IReadOnlyList<ResourceReference> outputResources = default; |
| 128 | 34 | | IReadOnlyList<ResourceReference> validatedResources = default; |
| 128 | 35 | | ErrorResponse error = default; |
| 2704 | 36 | | foreach (var property in element.EnumerateObject()) |
| | 37 | | { |
| 1224 | 38 | | if (property.NameEquals("provisioningState")) |
| | 39 | | { |
| 128 | 40 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 41 | | { |
| | 42 | | continue; |
| | 43 | | } |
| 128 | 44 | | provisioningState = property.Value.GetString(); |
| 128 | 45 | | continue; |
| | 46 | | } |
| 1096 | 47 | | if (property.NameEquals("correlationId")) |
| | 48 | | { |
| 108 | 49 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 50 | | { |
| | 51 | | continue; |
| | 52 | | } |
| 108 | 53 | | correlationId = property.Value.GetString(); |
| 108 | 54 | | continue; |
| | 55 | | } |
| 988 | 56 | | if (property.NameEquals("timestamp")) |
| | 57 | | { |
| 128 | 58 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 59 | | { |
| | 60 | | continue; |
| | 61 | | } |
| 128 | 62 | | timestamp = property.Value.GetDateTimeOffset("O"); |
| 128 | 63 | | continue; |
| | 64 | | } |
| 860 | 65 | | if (property.NameEquals("duration")) |
| | 66 | | { |
| 104 | 67 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 68 | | { |
| | 69 | | continue; |
| | 70 | | } |
| 104 | 71 | | duration = property.Value.GetString(); |
| 104 | 72 | | continue; |
| | 73 | | } |
| 756 | 74 | | if (property.NameEquals("outputs")) |
| | 75 | | { |
| 48 | 76 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 77 | | { |
| | 78 | | continue; |
| | 79 | | } |
| 48 | 80 | | outputs = property.Value.GetObject(); |
| 48 | 81 | | continue; |
| | 82 | | } |
| 708 | 83 | | if (property.NameEquals("providers")) |
| | 84 | | { |
| 96 | 85 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 86 | | { |
| | 87 | | continue; |
| | 88 | | } |
| 96 | 89 | | List<Provider> array = new List<Provider>(); |
| 488 | 90 | | foreach (var item in property.Value.EnumerateArray()) |
| | 91 | | { |
| 148 | 92 | | if (item.ValueKind == JsonValueKind.Null) |
| | 93 | | { |
| 0 | 94 | | array.Add(null); |
| | 95 | | } |
| | 96 | | else |
| | 97 | | { |
| 148 | 98 | | array.Add(Provider.DeserializeProvider(item)); |
| | 99 | | } |
| | 100 | | } |
| 96 | 101 | | providers = array; |
| 96 | 102 | | continue; |
| | 103 | | } |
| 612 | 104 | | if (property.NameEquals("dependencies")) |
| | 105 | | { |
| 96 | 106 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 107 | | { |
| | 108 | | continue; |
| | 109 | | } |
| 96 | 110 | | List<Dependency> array = new List<Dependency>(); |
| 360 | 111 | | foreach (var item in property.Value.EnumerateArray()) |
| | 112 | | { |
| 84 | 113 | | if (item.ValueKind == JsonValueKind.Null) |
| | 114 | | { |
| 0 | 115 | | array.Add(null); |
| | 116 | | } |
| | 117 | | else |
| | 118 | | { |
| 84 | 119 | | array.Add(Dependency.DeserializeDependency(item)); |
| | 120 | | } |
| | 121 | | } |
| 96 | 122 | | dependencies = array; |
| 96 | 123 | | continue; |
| | 124 | | } |
| 516 | 125 | | if (property.NameEquals("templateLink")) |
| | 126 | | { |
| 40 | 127 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 128 | | { |
| | 129 | | continue; |
| | 130 | | } |
| 40 | 131 | | templateLink = TemplateLink.DeserializeTemplateLink(property.Value); |
| 40 | 132 | | continue; |
| | 133 | | } |
| 476 | 134 | | if (property.NameEquals("parameters")) |
| | 135 | | { |
| 128 | 136 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 137 | | { |
| | 138 | | continue; |
| | 139 | | } |
| 128 | 140 | | parameters = property.Value.GetObject(); |
| 128 | 141 | | continue; |
| | 142 | | } |
| 348 | 143 | | if (property.NameEquals("parametersLink")) |
| | 144 | | { |
| 24 | 145 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 146 | | { |
| | 147 | | continue; |
| | 148 | | } |
| 24 | 149 | | parametersLink = ParametersLink.DeserializeParametersLink(property.Value); |
| 24 | 150 | | continue; |
| | 151 | | } |
| 324 | 152 | | if (property.NameEquals("mode")) |
| | 153 | | { |
| 128 | 154 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 155 | | { |
| | 156 | | continue; |
| | 157 | | } |
| 128 | 158 | | mode = property.Value.GetString().ToDeploymentMode(); |
| 128 | 159 | | continue; |
| | 160 | | } |
| 196 | 161 | | if (property.NameEquals("debugSetting")) |
| | 162 | | { |
| 0 | 163 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 164 | | { |
| | 165 | | continue; |
| | 166 | | } |
| 0 | 167 | | debugSetting = DebugSetting.DeserializeDebugSetting(property.Value); |
| 0 | 168 | | continue; |
| | 169 | | } |
| 196 | 170 | | if (property.NameEquals("onErrorDeployment")) |
| | 171 | | { |
| 0 | 172 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 173 | | { |
| | 174 | | continue; |
| | 175 | | } |
| 0 | 176 | | onErrorDeployment = OnErrorDeploymentExtended.DeserializeOnErrorDeploymentExtended(property.Value); |
| 0 | 177 | | continue; |
| | 178 | | } |
| 196 | 179 | | if (property.NameEquals("templateHash")) |
| | 180 | | { |
| 96 | 181 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 182 | | { |
| | 183 | | continue; |
| | 184 | | } |
| 96 | 185 | | templateHash = property.Value.GetString(); |
| 96 | 186 | | continue; |
| | 187 | | } |
| 100 | 188 | | if (property.NameEquals("outputResources")) |
| | 189 | | { |
| 72 | 190 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 191 | | { |
| | 192 | | continue; |
| | 193 | | } |
| 72 | 194 | | List<ResourceReference> array = new List<ResourceReference>(); |
| 512 | 195 | | foreach (var item in property.Value.EnumerateArray()) |
| | 196 | | { |
| 184 | 197 | | if (item.ValueKind == JsonValueKind.Null) |
| | 198 | | { |
| 0 | 199 | | array.Add(null); |
| | 200 | | } |
| | 201 | | else |
| | 202 | | { |
| 184 | 203 | | array.Add(ResourceReference.DeserializeResourceReference(item)); |
| | 204 | | } |
| | 205 | | } |
| 72 | 206 | | outputResources = array; |
| 72 | 207 | | continue; |
| | 208 | | } |
| 28 | 209 | | if (property.NameEquals("validatedResources")) |
| | 210 | | { |
| 24 | 211 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 212 | | { |
| | 213 | | continue; |
| | 214 | | } |
| 24 | 215 | | List<ResourceReference> array = new List<ResourceReference>(); |
| 240 | 216 | | foreach (var item in property.Value.EnumerateArray()) |
| | 217 | | { |
| 96 | 218 | | if (item.ValueKind == JsonValueKind.Null) |
| | 219 | | { |
| 0 | 220 | | array.Add(null); |
| | 221 | | } |
| | 222 | | else |
| | 223 | | { |
| 96 | 224 | | array.Add(ResourceReference.DeserializeResourceReference(item)); |
| | 225 | | } |
| | 226 | | } |
| 24 | 227 | | validatedResources = array; |
| 24 | 228 | | continue; |
| | 229 | | } |
| 4 | 230 | | if (property.NameEquals("error")) |
| | 231 | | { |
| 0 | 232 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 233 | | { |
| | 234 | | continue; |
| | 235 | | } |
| 0 | 236 | | error = ErrorResponse.DeserializeErrorResponse(property.Value); |
| | 237 | | continue; |
| | 238 | | } |
| | 239 | | } |
| 128 | 240 | | return new DeploymentPropertiesExtended(provisioningState, correlationId, timestamp, duration, outputs, prov |
| | 241 | | } |
| | 242 | | } |
| | 243 | | } |