< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_RuleSequence()-0%100%
get_Conditions()-0%100%
get_ActionSet()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeApplicationGatewayRewriteRule(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayRewriteRule.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.Collections.Generic;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> Rewrite rule of an application gateway. </summary>
 13    public partial class ApplicationGatewayRewriteRule
 14    {
 15        /// <summary> Initializes a new instance of ApplicationGatewayRewriteRule. </summary>
 016        public ApplicationGatewayRewriteRule()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ApplicationGatewayRewriteRule. </summary>
 21        /// <param name="name"> Name of the rewrite rule that is unique within an Application Gateway. </param>
 22        /// <param name="ruleSequence"> Rule Sequence of the rewrite rule that determines the order of execution of a pa
 23        /// <param name="conditions"> Conditions based on which the action set execution will be evaluated. </param>
 24        /// <param name="actionSet"> Set of actions to be done as part of the rewrite Rule. </param>
 025        internal ApplicationGatewayRewriteRule(string name, int? ruleSequence, IList<ApplicationGatewayRewriteRuleCondit
 26        {
 027            Name = name;
 028            RuleSequence = ruleSequence;
 029            Conditions = conditions;
 030            ActionSet = actionSet;
 031        }
 32
 33        /// <summary> Name of the rewrite rule that is unique within an Application Gateway. </summary>
 034        public string Name { get; set; }
 35        /// <summary> Rule Sequence of the rewrite rule that determines the order of execution of a particular rule in a
 036        public int? RuleSequence { get; set; }
 37        /// <summary> Conditions based on which the action set execution will be evaluated. </summary>
 038        public IList<ApplicationGatewayRewriteRuleCondition> Conditions { get; set; }
 39        /// <summary> Set of actions to be done as part of the rewrite Rule. </summary>
 040        public ApplicationGatewayRewriteRuleActionSet ActionSet { get; set; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayRewriteRule.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Network.Models
 13{
 14    public partial class ApplicationGatewayRewriteRule : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Name != null)
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            if (RuleSequence != null)
 25            {
 026                writer.WritePropertyName("ruleSequence");
 027                writer.WriteNumberValue(RuleSequence.Value);
 28            }
 029            if (Conditions != null)
 30            {
 031                writer.WritePropertyName("conditions");
 032                writer.WriteStartArray();
 033                foreach (var item in Conditions)
 34                {
 035                    writer.WriteObjectValue(item);
 36                }
 037                writer.WriteEndArray();
 38            }
 039            if (ActionSet != null)
 40            {
 041                writer.WritePropertyName("actionSet");
 042                writer.WriteObjectValue(ActionSet);
 43            }
 044            writer.WriteEndObject();
 045        }
 46
 47        internal static ApplicationGatewayRewriteRule DeserializeApplicationGatewayRewriteRule(JsonElement element)
 48        {
 049            string name = default;
 050            int? ruleSequence = default;
 051            IList<ApplicationGatewayRewriteRuleCondition> conditions = default;
 052            ApplicationGatewayRewriteRuleActionSet actionSet = default;
 053            foreach (var property in element.EnumerateObject())
 54            {
 055                if (property.NameEquals("name"))
 56                {
 057                    if (property.Value.ValueKind == JsonValueKind.Null)
 58                    {
 59                        continue;
 60                    }
 061                    name = property.Value.GetString();
 062                    continue;
 63                }
 064                if (property.NameEquals("ruleSequence"))
 65                {
 066                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 070                    ruleSequence = property.Value.GetInt32();
 071                    continue;
 72                }
 073                if (property.NameEquals("conditions"))
 74                {
 075                    if (property.Value.ValueKind == JsonValueKind.Null)
 76                    {
 77                        continue;
 78                    }
 079                    List<ApplicationGatewayRewriteRuleCondition> array = new List<ApplicationGatewayRewriteRuleCondition
 080                    foreach (var item in property.Value.EnumerateArray())
 81                    {
 082                        if (item.ValueKind == JsonValueKind.Null)
 83                        {
 084                            array.Add(null);
 85                        }
 86                        else
 87                        {
 088                            array.Add(ApplicationGatewayRewriteRuleCondition.DeserializeApplicationGatewayRewriteRuleCon
 89                        }
 90                    }
 091                    conditions = array;
 092                    continue;
 93                }
 094                if (property.NameEquals("actionSet"))
 95                {
 096                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 0100                    actionSet = ApplicationGatewayRewriteRuleActionSet.DeserializeApplicationGatewayRewriteRuleActionSet
 101                    continue;
 102                }
 103            }
 0104            return new ApplicationGatewayRewriteRule(name, ruleSequence, conditions, actionSet);
 105        }
 106    }
 107}