| | 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 Dependency |
| | 15 | | { |
| | 16 | | internal static Dependency DeserializeDependency(JsonElement element) |
| | 17 | | { |
| 84 | 18 | | IReadOnlyList<BasicDependency> dependsOn = default; |
| 84 | 19 | | string id = default; |
| 84 | 20 | | string resourceType = default; |
| 84 | 21 | | string resourceName = default; |
| 840 | 22 | | foreach (var property in element.EnumerateObject()) |
| | 23 | | { |
| 336 | 24 | | if (property.NameEquals("dependsOn")) |
| | 25 | | { |
| 84 | 26 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 27 | | { |
| | 28 | | continue; |
| | 29 | | } |
| 84 | 30 | | List<BasicDependency> array = new List<BasicDependency>(); |
| 336 | 31 | | foreach (var item in property.Value.EnumerateArray()) |
| | 32 | | { |
| 84 | 33 | | if (item.ValueKind == JsonValueKind.Null) |
| | 34 | | { |
| 0 | 35 | | array.Add(null); |
| | 36 | | } |
| | 37 | | else |
| | 38 | | { |
| 84 | 39 | | array.Add(BasicDependency.DeserializeBasicDependency(item)); |
| | 40 | | } |
| | 41 | | } |
| 84 | 42 | | dependsOn = array; |
| 84 | 43 | | continue; |
| | 44 | | } |
| 252 | 45 | | if (property.NameEquals("id")) |
| | 46 | | { |
| 84 | 47 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 48 | | { |
| | 49 | | continue; |
| | 50 | | } |
| 84 | 51 | | id = property.Value.GetString(); |
| 84 | 52 | | continue; |
| | 53 | | } |
| 168 | 54 | | if (property.NameEquals("resourceType")) |
| | 55 | | { |
| 84 | 56 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 57 | | { |
| | 58 | | continue; |
| | 59 | | } |
| 84 | 60 | | resourceType = property.Value.GetString(); |
| 84 | 61 | | continue; |
| | 62 | | } |
| 84 | 63 | | if (property.NameEquals("resourceName")) |
| | 64 | | { |
| 84 | 65 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 66 | | { |
| | 67 | | continue; |
| | 68 | | } |
| 84 | 69 | | resourceName = property.Value.GetString(); |
| | 70 | | continue; |
| | 71 | | } |
| | 72 | | } |
| 84 | 73 | | return new Dependency(dependsOn, id, resourceType, resourceName); |
| | 74 | | } |
| | 75 | | } |
| | 76 | | } |