| | | 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.Network.Models |
| | | 13 | | { |
| | | 14 | | public partial class EffectiveNetworkSecurityGroup |
| | | 15 | | { |
| | | 16 | | internal static EffectiveNetworkSecurityGroup DeserializeEffectiveNetworkSecurityGroup(JsonElement element) |
| | | 17 | | { |
| | 0 | 18 | | SubResource networkSecurityGroup = default; |
| | 0 | 19 | | EffectiveNetworkSecurityGroupAssociation association = default; |
| | 0 | 20 | | IReadOnlyList<EffectiveNetworkSecurityRule> effectiveSecurityRules = default; |
| | 0 | 21 | | string tagMap = default; |
| | 0 | 22 | | foreach (var property in element.EnumerateObject()) |
| | | 23 | | { |
| | 0 | 24 | | if (property.NameEquals("networkSecurityGroup")) |
| | | 25 | | { |
| | 0 | 26 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 27 | | { |
| | | 28 | | continue; |
| | | 29 | | } |
| | 0 | 30 | | networkSecurityGroup = SubResource.DeserializeSubResource(property.Value); |
| | 0 | 31 | | continue; |
| | | 32 | | } |
| | 0 | 33 | | if (property.NameEquals("association")) |
| | | 34 | | { |
| | 0 | 35 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 36 | | { |
| | | 37 | | continue; |
| | | 38 | | } |
| | 0 | 39 | | association = EffectiveNetworkSecurityGroupAssociation.DeserializeEffectiveNetworkSecurityGroupAssoc |
| | 0 | 40 | | continue; |
| | | 41 | | } |
| | 0 | 42 | | if (property.NameEquals("effectiveSecurityRules")) |
| | | 43 | | { |
| | 0 | 44 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 45 | | { |
| | | 46 | | continue; |
| | | 47 | | } |
| | 0 | 48 | | List<EffectiveNetworkSecurityRule> array = new List<EffectiveNetworkSecurityRule>(); |
| | 0 | 49 | | foreach (var item in property.Value.EnumerateArray()) |
| | | 50 | | { |
| | 0 | 51 | | if (item.ValueKind == JsonValueKind.Null) |
| | | 52 | | { |
| | 0 | 53 | | array.Add(null); |
| | | 54 | | } |
| | | 55 | | else |
| | | 56 | | { |
| | 0 | 57 | | array.Add(EffectiveNetworkSecurityRule.DeserializeEffectiveNetworkSecurityRule(item)); |
| | | 58 | | } |
| | | 59 | | } |
| | 0 | 60 | | effectiveSecurityRules = array; |
| | 0 | 61 | | continue; |
| | | 62 | | } |
| | 0 | 63 | | if (property.NameEquals("tagMap")) |
| | | 64 | | { |
| | 0 | 65 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 66 | | { |
| | | 67 | | continue; |
| | | 68 | | } |
| | 0 | 69 | | tagMap = property.Value.GetString(); |
| | | 70 | | continue; |
| | | 71 | | } |
| | | 72 | | } |
| | 0 | 73 | | return new EffectiveNetworkSecurityGroup(networkSecurityGroup, association, effectiveSecurityRules, tagMap); |
| | | 74 | | } |
| | | 75 | | } |
| | | 76 | | } |