| | | 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.Collections.Generic; |
| | | 9 | | using System.Text.Json; |
| | | 10 | | using Azure.Core; |
| | | 11 | | |
| | | 12 | | namespace Azure.ResourceManager.Resources.Models |
| | | 13 | | { |
| | | 14 | | public partial class DeploymentExtended |
| | | 15 | | { |
| | | 16 | | internal static DeploymentExtended DeserializeDeploymentExtended(JsonElement element) |
| | | 17 | | { |
| | 104 | 18 | | string id = default; |
| | 104 | 19 | | string name = default; |
| | 104 | 20 | | string type = default; |
| | 104 | 21 | | string location = default; |
| | 104 | 22 | | DeploymentPropertiesExtended properties = default; |
| | 104 | 23 | | IReadOnlyDictionary<string, string> tags = default; |
| | 1160 | 24 | | foreach (var property in element.EnumerateObject()) |
| | | 25 | | { |
| | 476 | 26 | | if (property.NameEquals("id")) |
| | | 27 | | { |
| | 84 | 28 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 29 | | { |
| | | 30 | | continue; |
| | | 31 | | } |
| | 84 | 32 | | id = property.Value.GetString(); |
| | 84 | 33 | | continue; |
| | | 34 | | } |
| | 392 | 35 | | if (property.NameEquals("name")) |
| | | 36 | | { |
| | 104 | 37 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 38 | | { |
| | | 39 | | continue; |
| | | 40 | | } |
| | 104 | 41 | | name = property.Value.GetString(); |
| | 104 | 42 | | continue; |
| | | 43 | | } |
| | 288 | 44 | | if (property.NameEquals("type")) |
| | | 45 | | { |
| | 72 | 46 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 47 | | { |
| | | 48 | | continue; |
| | | 49 | | } |
| | 72 | 50 | | type = property.Value.GetString(); |
| | 72 | 51 | | continue; |
| | | 52 | | } |
| | 216 | 53 | | if (property.NameEquals("location")) |
| | | 54 | | { |
| | 36 | 55 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 56 | | { |
| | | 57 | | continue; |
| | | 58 | | } |
| | 36 | 59 | | location = property.Value.GetString(); |
| | 36 | 60 | | continue; |
| | | 61 | | } |
| | 180 | 62 | | if (property.NameEquals("properties")) |
| | | 63 | | { |
| | 104 | 64 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 65 | | { |
| | | 66 | | continue; |
| | | 67 | | } |
| | 104 | 68 | | properties = DeploymentPropertiesExtended.DeserializeDeploymentPropertiesExtended(property.Value); |
| | 104 | 69 | | continue; |
| | | 70 | | } |
| | 76 | 71 | | if (property.NameEquals("tags")) |
| | | 72 | | { |
| | 56 | 73 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 74 | | { |
| | | 75 | | continue; |
| | | 76 | | } |
| | 56 | 77 | | Dictionary<string, string> dictionary = new Dictionary<string, string>(); |
| | 224 | 78 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | | 79 | | { |
| | 56 | 80 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 81 | | { |
| | 0 | 82 | | dictionary.Add(property0.Name, null); |
| | | 83 | | } |
| | | 84 | | else |
| | | 85 | | { |
| | 56 | 86 | | dictionary.Add(property0.Name, property0.Value.GetString()); |
| | | 87 | | } |
| | | 88 | | } |
| | 56 | 89 | | tags = dictionary; |
| | | 90 | | continue; |
| | | 91 | | } |
| | | 92 | | } |
| | 104 | 93 | | return new DeploymentExtended(id, name, type, location, properties, tags); |
| | | 94 | | } |
| | | 95 | | } |
| | | 96 | | } |