| | | 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 ProviderResourceType |
| | | 15 | | { |
| | | 16 | | internal static ProviderResourceType DeserializeProviderResourceType(JsonElement element) |
| | | 17 | | { |
| | 16460 | 18 | | string resourceType = default; |
| | 16460 | 19 | | IReadOnlyList<string> locations = default; |
| | 16460 | 20 | | IReadOnlyList<Alias> aliases = default; |
| | 16460 | 21 | | IReadOnlyList<string> apiVersions = default; |
| | 16460 | 22 | | string capabilities = default; |
| | 16460 | 23 | | IReadOnlyDictionary<string, string> properties = default; |
| | 190912 | 24 | | foreach (var property in element.EnumerateObject()) |
| | | 25 | | { |
| | 78996 | 26 | | if (property.NameEquals("resourceType")) |
| | | 27 | | { |
| | 16460 | 28 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 29 | | { |
| | | 30 | | continue; |
| | | 31 | | } |
| | 16460 | 32 | | resourceType = property.Value.GetString(); |
| | 16460 | 33 | | continue; |
| | | 34 | | } |
| | 62536 | 35 | | if (property.NameEquals("locations")) |
| | | 36 | | { |
| | 16460 | 37 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 38 | | { |
| | | 39 | | continue; |
| | | 40 | | } |
| | 16460 | 41 | | List<string> array = new List<string>(); |
| | 552440 | 42 | | foreach (var item in property.Value.EnumerateArray()) |
| | | 43 | | { |
| | 259760 | 44 | | if (item.ValueKind == JsonValueKind.Null) |
| | | 45 | | { |
| | 132 | 46 | | array.Add(null); |
| | | 47 | | } |
| | | 48 | | else |
| | | 49 | | { |
| | 259628 | 50 | | array.Add(item.GetString()); |
| | | 51 | | } |
| | | 52 | | } |
| | 16460 | 53 | | locations = array; |
| | 16460 | 54 | | continue; |
| | | 55 | | } |
| | 46076 | 56 | | if (property.NameEquals("aliases")) |
| | | 57 | | { |
| | 8576 | 58 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 59 | | { |
| | | 60 | | continue; |
| | | 61 | | } |
| | 8576 | 62 | | List<Alias> array = new List<Alias>(); |
| | 225632 | 63 | | foreach (var item in property.Value.EnumerateArray()) |
| | | 64 | | { |
| | 104240 | 65 | | if (item.ValueKind == JsonValueKind.Null) |
| | | 66 | | { |
| | 0 | 67 | | array.Add(null); |
| | | 68 | | } |
| | | 69 | | else |
| | | 70 | | { |
| | 104240 | 71 | | array.Add(Alias.DeserializeAlias(item)); |
| | | 72 | | } |
| | | 73 | | } |
| | 8576 | 74 | | aliases = array; |
| | 8576 | 75 | | continue; |
| | | 76 | | } |
| | 37500 | 77 | | if (property.NameEquals("apiVersions")) |
| | | 78 | | { |
| | 16212 | 79 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 80 | | { |
| | | 81 | | continue; |
| | | 82 | | } |
| | 16212 | 83 | | List<string> array = new List<string>(); |
| | 197872 | 84 | | foreach (var item in property.Value.EnumerateArray()) |
| | | 85 | | { |
| | 82724 | 86 | | if (item.ValueKind == JsonValueKind.Null) |
| | | 87 | | { |
| | 0 | 88 | | array.Add(null); |
| | | 89 | | } |
| | | 90 | | else |
| | | 91 | | { |
| | 82724 | 92 | | array.Add(item.GetString()); |
| | | 93 | | } |
| | | 94 | | } |
| | 16212 | 95 | | apiVersions = array; |
| | 16212 | 96 | | continue; |
| | | 97 | | } |
| | 21288 | 98 | | if (property.NameEquals("capabilities")) |
| | | 99 | | { |
| | 15172 | 100 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 101 | | { |
| | | 102 | | continue; |
| | | 103 | | } |
| | 15172 | 104 | | capabilities = property.Value.GetString(); |
| | 15172 | 105 | | continue; |
| | | 106 | | } |
| | 6116 | 107 | | if (property.NameEquals("properties")) |
| | | 108 | | { |
| | 0 | 109 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 110 | | { |
| | | 111 | | continue; |
| | | 112 | | } |
| | 0 | 113 | | Dictionary<string, string> dictionary = new Dictionary<string, string>(); |
| | 0 | 114 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | | 115 | | { |
| | 0 | 116 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 117 | | { |
| | 0 | 118 | | dictionary.Add(property0.Name, null); |
| | | 119 | | } |
| | | 120 | | else |
| | | 121 | | { |
| | 0 | 122 | | dictionary.Add(property0.Name, property0.Value.GetString()); |
| | | 123 | | } |
| | | 124 | | } |
| | 0 | 125 | | properties = dictionary; |
| | | 126 | | continue; |
| | | 127 | | } |
| | | 128 | | } |
| | 16460 | 129 | | return new ProviderResourceType(resourceType, locations, aliases, apiVersions, capabilities, properties); |
| | | 130 | | } |
| | | 131 | | } |
| | | 132 | | } |