< Summary

Class:Azure.ResourceManager.Network.Models.OwaspCrsExclusionEntry
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\OwaspCrsExclusionEntry.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\OwaspCrsExclusionEntry.Serialization.cs
Covered lines:0
Uncovered lines:32
Coverable lines:32
Total lines:91
Line coverage:0% (0 of 32)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
get_MatchVariable()-0%100%
get_SelectorMatchOperator()-0%100%
get_Selector()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeOwaspCrsExclusionEntry(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\OwaspCrsExclusionEntry.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> Allow to exclude some variable satisfy the condition for the WAF check. </summary>
 13    public partial class OwaspCrsExclusionEntry
 14    {
 15        /// <summary> Initializes a new instance of OwaspCrsExclusionEntry. </summary>
 16        /// <param name="matchVariable"> The variable to be excluded. </param>
 17        /// <param name="selectorMatchOperator"> When matchVariable is a collection, operate on the selector to specify 
 18        /// <param name="selector"> When matchVariable is a collection, operator used to specify which elements in the c
 019        public OwaspCrsExclusionEntry(OwaspCrsExclusionEntryMatchVariable matchVariable, OwaspCrsExclusionEntrySelectorM
 20        {
 021            if (selector == null)
 22            {
 023                throw new ArgumentNullException(nameof(selector));
 24            }
 25
 026            MatchVariable = matchVariable;
 027            SelectorMatchOperator = selectorMatchOperator;
 028            Selector = selector;
 029        }
 30
 31        /// <summary> The variable to be excluded. </summary>
 032        public OwaspCrsExclusionEntryMatchVariable MatchVariable { get; set; }
 33        /// <summary> When matchVariable is a collection, operate on the selector to specify which elements in the colle
 034        public OwaspCrsExclusionEntrySelectorMatchOperator SelectorMatchOperator { get; set; }
 35        /// <summary> When matchVariable is a collection, operator used to specify which elements in the collection this
 036        public string Selector { get; set; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\OwaspCrsExclusionEntry.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    public partial class OwaspCrsExclusionEntry : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("matchVariable");
 019            writer.WriteStringValue(MatchVariable.ToString());
 020            writer.WritePropertyName("selectorMatchOperator");
 021            writer.WriteStringValue(SelectorMatchOperator.ToString());
 022            writer.WritePropertyName("selector");
 023            writer.WriteStringValue(Selector);
 024            writer.WriteEndObject();
 025        }
 26
 27        internal static OwaspCrsExclusionEntry DeserializeOwaspCrsExclusionEntry(JsonElement element)
 28        {
 029            OwaspCrsExclusionEntryMatchVariable matchVariable = default;
 030            OwaspCrsExclusionEntrySelectorMatchOperator selectorMatchOperator = default;
 031            string selector = default;
 032            foreach (var property in element.EnumerateObject())
 33            {
 034                if (property.NameEquals("matchVariable"))
 35                {
 036                    matchVariable = new OwaspCrsExclusionEntryMatchVariable(property.Value.GetString());
 037                    continue;
 38                }
 039                if (property.NameEquals("selectorMatchOperator"))
 40                {
 041                    selectorMatchOperator = new OwaspCrsExclusionEntrySelectorMatchOperator(property.Value.GetString());
 042                    continue;
 43                }
 044                if (property.NameEquals("selector"))
 45                {
 046                    selector = property.Value.GetString();
 47                    continue;
 48                }
 49            }
 050            return new OwaspCrsExclusionEntry(matchVariable, selectorMatchOperator, selector);
 51        }
 52    }
 53}