| | 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 TagDetails |
| | 15 | | { |
| | 16 | | internal static TagDetails DeserializeTagDetails(JsonElement element) |
| | 17 | | { |
| 164 | 18 | | string id = default; |
| 164 | 19 | | string tagName = default; |
| 164 | 20 | | TagCount count = default; |
| 164 | 21 | | IReadOnlyList<TagValue> values = default; |
| 1640 | 22 | | foreach (var property in element.EnumerateObject()) |
| | 23 | | { |
| 656 | 24 | | if (property.NameEquals("id")) |
| | 25 | | { |
| 164 | 26 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 27 | | { |
| | 28 | | continue; |
| | 29 | | } |
| 164 | 30 | | id = property.Value.GetString(); |
| 164 | 31 | | continue; |
| | 32 | | } |
| 492 | 33 | | if (property.NameEquals("tagName")) |
| | 34 | | { |
| 164 | 35 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 36 | | { |
| | 37 | | continue; |
| | 38 | | } |
| 164 | 39 | | tagName = property.Value.GetString(); |
| 164 | 40 | | continue; |
| | 41 | | } |
| 328 | 42 | | if (property.NameEquals("count")) |
| | 43 | | { |
| 164 | 44 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 45 | | { |
| | 46 | | continue; |
| | 47 | | } |
| 164 | 48 | | count = TagCount.DeserializeTagCount(property.Value); |
| 164 | 49 | | continue; |
| | 50 | | } |
| 164 | 51 | | if (property.NameEquals("values")) |
| | 52 | | { |
| 164 | 53 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 54 | | { |
| | 55 | | continue; |
| | 56 | | } |
| 164 | 57 | | List<TagValue> array = new List<TagValue>(); |
| 888 | 58 | | foreach (var item in property.Value.EnumerateArray()) |
| | 59 | | { |
| 280 | 60 | | if (item.ValueKind == JsonValueKind.Null) |
| | 61 | | { |
| 0 | 62 | | array.Add(null); |
| | 63 | | } |
| | 64 | | else |
| | 65 | | { |
| 280 | 66 | | array.Add(TagValue.DeserializeTagValue(item)); |
| | 67 | | } |
| | 68 | | } |
| 164 | 69 | | values = array; |
| | 70 | | continue; |
| | 71 | | } |
| | 72 | | } |
| 164 | 73 | | return new TagDetails(id, tagName, count, values); |
| | 74 | | } |
| | 75 | | } |
| | 76 | | } |