| | 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 EvaluatedNetworkSecurityGroup |
| | 15 | | { |
| | 16 | | internal static EvaluatedNetworkSecurityGroup DeserializeEvaluatedNetworkSecurityGroup(JsonElement element) |
| | 17 | | { |
| 0 | 18 | | string networkSecurityGroupId = default; |
| 0 | 19 | | string appliedTo = default; |
| 0 | 20 | | MatchedRule matchedRule = default; |
| 0 | 21 | | IReadOnlyList<NetworkSecurityRulesEvaluationResult> rulesEvaluationResult = default; |
| 0 | 22 | | foreach (var property in element.EnumerateObject()) |
| | 23 | | { |
| 0 | 24 | | if (property.NameEquals("networkSecurityGroupId")) |
| | 25 | | { |
| 0 | 26 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 27 | | { |
| | 28 | | continue; |
| | 29 | | } |
| 0 | 30 | | networkSecurityGroupId = property.Value.GetString(); |
| 0 | 31 | | continue; |
| | 32 | | } |
| 0 | 33 | | if (property.NameEquals("appliedTo")) |
| | 34 | | { |
| 0 | 35 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 36 | | { |
| | 37 | | continue; |
| | 38 | | } |
| 0 | 39 | | appliedTo = property.Value.GetString(); |
| 0 | 40 | | continue; |
| | 41 | | } |
| 0 | 42 | | if (property.NameEquals("matchedRule")) |
| | 43 | | { |
| 0 | 44 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 45 | | { |
| | 46 | | continue; |
| | 47 | | } |
| 0 | 48 | | matchedRule = MatchedRule.DeserializeMatchedRule(property.Value); |
| 0 | 49 | | continue; |
| | 50 | | } |
| 0 | 51 | | if (property.NameEquals("rulesEvaluationResult")) |
| | 52 | | { |
| 0 | 53 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 54 | | { |
| | 55 | | continue; |
| | 56 | | } |
| 0 | 57 | | List<NetworkSecurityRulesEvaluationResult> array = new List<NetworkSecurityRulesEvaluationResult>(); |
| 0 | 58 | | foreach (var item in property.Value.EnumerateArray()) |
| | 59 | | { |
| 0 | 60 | | if (item.ValueKind == JsonValueKind.Null) |
| | 61 | | { |
| 0 | 62 | | array.Add(null); |
| | 63 | | } |
| | 64 | | else |
| | 65 | | { |
| 0 | 66 | | array.Add(NetworkSecurityRulesEvaluationResult.DeserializeNetworkSecurityRulesEvaluationResu |
| | 67 | | } |
| | 68 | | } |
| 0 | 69 | | rulesEvaluationResult = array; |
| | 70 | | continue; |
| | 71 | | } |
| | 72 | | } |
| 0 | 73 | | return new EvaluatedNetworkSecurityGroup(networkSecurityGroupId, appliedTo, matchedRule, rulesEvaluationResu |
| | 74 | | } |
| | 75 | | } |
| | 76 | | } |