| | 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 TenantIdDescription |
| | 15 | | { |
| | 16 | | internal static TenantIdDescription DeserializeTenantIdDescription(JsonElement element) |
| | 17 | | { |
| 4 | 18 | | string id = default; |
| 4 | 19 | | string tenantId = default; |
| 4 | 20 | | TenantCategory? tenantCategory = default; |
| 4 | 21 | | string country = default; |
| 4 | 22 | | string countryCode = default; |
| 4 | 23 | | string displayName = default; |
| 4 | 24 | | IReadOnlyList<string> domains = default; |
| 32 | 25 | | foreach (var property in element.EnumerateObject()) |
| | 26 | | { |
| 12 | 27 | | if (property.NameEquals("id")) |
| | 28 | | { |
| 4 | 29 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 30 | | { |
| | 31 | | continue; |
| | 32 | | } |
| 4 | 33 | | id = property.Value.GetString(); |
| 4 | 34 | | continue; |
| | 35 | | } |
| 8 | 36 | | if (property.NameEquals("tenantId")) |
| | 37 | | { |
| 4 | 38 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 39 | | { |
| | 40 | | continue; |
| | 41 | | } |
| 4 | 42 | | tenantId = property.Value.GetString(); |
| 4 | 43 | | continue; |
| | 44 | | } |
| 4 | 45 | | if (property.NameEquals("tenantCategory")) |
| | 46 | | { |
| 4 | 47 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 48 | | { |
| | 49 | | continue; |
| | 50 | | } |
| 4 | 51 | | tenantCategory = property.Value.GetString().ToTenantCategory(); |
| 4 | 52 | | continue; |
| | 53 | | } |
| 0 | 54 | | if (property.NameEquals("country")) |
| | 55 | | { |
| 0 | 56 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 57 | | { |
| | 58 | | continue; |
| | 59 | | } |
| 0 | 60 | | country = property.Value.GetString(); |
| 0 | 61 | | continue; |
| | 62 | | } |
| 0 | 63 | | if (property.NameEquals("countryCode")) |
| | 64 | | { |
| 0 | 65 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 66 | | { |
| | 67 | | continue; |
| | 68 | | } |
| 0 | 69 | | countryCode = property.Value.GetString(); |
| 0 | 70 | | continue; |
| | 71 | | } |
| 0 | 72 | | if (property.NameEquals("displayName")) |
| | 73 | | { |
| 0 | 74 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 75 | | { |
| | 76 | | continue; |
| | 77 | | } |
| 0 | 78 | | displayName = property.Value.GetString(); |
| 0 | 79 | | continue; |
| | 80 | | } |
| 0 | 81 | | if (property.NameEquals("domains")) |
| | 82 | | { |
| 0 | 83 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 84 | | { |
| | 85 | | continue; |
| | 86 | | } |
| 0 | 87 | | List<string> array = new List<string>(); |
| 0 | 88 | | foreach (var item in property.Value.EnumerateArray()) |
| | 89 | | { |
| 0 | 90 | | if (item.ValueKind == JsonValueKind.Null) |
| | 91 | | { |
| 0 | 92 | | array.Add(null); |
| | 93 | | } |
| | 94 | | else |
| | 95 | | { |
| 0 | 96 | | array.Add(item.GetString()); |
| | 97 | | } |
| | 98 | | } |
| 0 | 99 | | domains = array; |
| | 100 | | continue; |
| | 101 | | } |
| | 102 | | } |
| 4 | 103 | | return new TenantIdDescription(id, tenantId, tenantCategory, country, countryCode, displayName, domains); |
| | 104 | | } |
| | 105 | | } |
| | 106 | | } |