| | 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.AppConfiguration.Models |
| | 13 | | { |
| | 14 | | public partial class PrivateLinkResource |
| | 15 | | { |
| | 16 | | internal static PrivateLinkResource DeserializePrivateLinkResource(JsonElement element) |
| | 17 | | { |
| 20 | 18 | | string id = default; |
| 20 | 19 | | string name = default; |
| 20 | 20 | | string type = default; |
| 20 | 21 | | string groupId = default; |
| 20 | 22 | | IReadOnlyList<string> requiredMembers = default; |
| 20 | 23 | | IReadOnlyList<string> requiredZoneNames = default; |
| 200 | 24 | | foreach (var property in element.EnumerateObject()) |
| | 25 | | { |
| 80 | 26 | | if (property.NameEquals("id")) |
| | 27 | | { |
| 20 | 28 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 29 | | { |
| | 30 | | continue; |
| | 31 | | } |
| 20 | 32 | | id = property.Value.GetString(); |
| 20 | 33 | | continue; |
| | 34 | | } |
| 60 | 35 | | if (property.NameEquals("name")) |
| | 36 | | { |
| 20 | 37 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 38 | | { |
| | 39 | | continue; |
| | 40 | | } |
| 20 | 41 | | name = property.Value.GetString(); |
| 20 | 42 | | continue; |
| | 43 | | } |
| 40 | 44 | | if (property.NameEquals("type")) |
| | 45 | | { |
| 20 | 46 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 47 | | { |
| | 48 | | continue; |
| | 49 | | } |
| 20 | 50 | | type = property.Value.GetString(); |
| 20 | 51 | | continue; |
| | 52 | | } |
| 20 | 53 | | if (property.NameEquals("properties")) |
| | 54 | | { |
| 160 | 55 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 56 | | { |
| 60 | 57 | | if (property0.NameEquals("groupId")) |
| | 58 | | { |
| 20 | 59 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 60 | | { |
| | 61 | | continue; |
| | 62 | | } |
| 20 | 63 | | groupId = property0.Value.GetString(); |
| 20 | 64 | | continue; |
| | 65 | | } |
| 40 | 66 | | if (property0.NameEquals("requiredMembers")) |
| | 67 | | { |
| 20 | 68 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 69 | | { |
| | 70 | | continue; |
| | 71 | | } |
| 20 | 72 | | List<string> array = new List<string>(); |
| 80 | 73 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 74 | | { |
| 20 | 75 | | if (item.ValueKind == JsonValueKind.Null) |
| | 76 | | { |
| 0 | 77 | | array.Add(null); |
| | 78 | | } |
| | 79 | | else |
| | 80 | | { |
| 20 | 81 | | array.Add(item.GetString()); |
| | 82 | | } |
| | 83 | | } |
| 20 | 84 | | requiredMembers = array; |
| 20 | 85 | | continue; |
| | 86 | | } |
| 20 | 87 | | if (property0.NameEquals("requiredZoneNames")) |
| | 88 | | { |
| 20 | 89 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 90 | | { |
| | 91 | | continue; |
| | 92 | | } |
| 20 | 93 | | List<string> array = new List<string>(); |
| 80 | 94 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 95 | | { |
| 20 | 96 | | if (item.ValueKind == JsonValueKind.Null) |
| | 97 | | { |
| 0 | 98 | | array.Add(null); |
| | 99 | | } |
| | 100 | | else |
| | 101 | | { |
| 20 | 102 | | array.Add(item.GetString()); |
| | 103 | | } |
| | 104 | | } |
| 20 | 105 | | requiredZoneNames = array; |
| | 106 | | continue; |
| | 107 | | } |
| | 108 | | } |
| | 109 | | continue; |
| | 110 | | } |
| | 111 | | } |
| 20 | 112 | | return new PrivateLinkResource(id, name, type, groupId, requiredMembers, requiredZoneNames); |
| | 113 | | } |
| | 114 | | } |
| | 115 | | } |