< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_RewriteRules()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeApplicationGatewayRewriteRuleSet(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayRewriteRuleSet.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 set of an application gateway. </summary>
 13    public partial class ApplicationGatewayRewriteRuleSet : SubResource
 14    {
 15        /// <summary> Initializes a new instance of ApplicationGatewayRewriteRuleSet. </summary>
 016        public ApplicationGatewayRewriteRuleSet()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ApplicationGatewayRewriteRuleSet. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Name of the rewrite rule set that is unique within an Application Gateway. </param>
 23        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 24        /// <param name="rewriteRules"> Rewrite rules in the rewrite rule set. </param>
 25        /// <param name="provisioningState"> The provisioning state of the rewrite rule set resource. </param>
 026        internal ApplicationGatewayRewriteRuleSet(string id, string name, string etag, IList<ApplicationGatewayRewriteRu
 27        {
 028            Name = name;
 029            Etag = etag;
 030            RewriteRules = rewriteRules;
 031            ProvisioningState = provisioningState;
 032        }
 33
 34        /// <summary> Name of the rewrite rule set that is unique within an Application Gateway. </summary>
 035        public string Name { get; set; }
 36        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 037        public string Etag { get; }
 38        /// <summary> Rewrite rules in the rewrite rule set. </summary>
 039        public IList<ApplicationGatewayRewriteRule> RewriteRules { get; set; }
 40        /// <summary> The provisioning state of the rewrite rule set resource. </summary>
 041        public ProvisioningState? ProvisioningState { get; }
 42    }
 43}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayRewriteRuleSet.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 ApplicationGatewayRewriteRuleSet : 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 (Etag != null)
 25            {
 026                writer.WritePropertyName("etag");
 027                writer.WriteStringValue(Etag);
 28            }
 029            if (Id != null)
 30            {
 031                writer.WritePropertyName("id");
 032                writer.WriteStringValue(Id);
 33            }
 034            writer.WritePropertyName("properties");
 035            writer.WriteStartObject();
 036            if (RewriteRules != null)
 37            {
 038                writer.WritePropertyName("rewriteRules");
 039                writer.WriteStartArray();
 040                foreach (var item in RewriteRules)
 41                {
 042                    writer.WriteObjectValue(item);
 43                }
 044                writer.WriteEndArray();
 45            }
 046            if (ProvisioningState != null)
 47            {
 048                writer.WritePropertyName("provisioningState");
 049                writer.WriteStringValue(ProvisioningState.Value.ToString());
 50            }
 051            writer.WriteEndObject();
 052            writer.WriteEndObject();
 053        }
 54
 55        internal static ApplicationGatewayRewriteRuleSet DeserializeApplicationGatewayRewriteRuleSet(JsonElement element
 56        {
 057            string name = default;
 058            string etag = default;
 059            string id = default;
 060            IList<ApplicationGatewayRewriteRule> rewriteRules = default;
 061            ProvisioningState? provisioningState = default;
 062            foreach (var property in element.EnumerateObject())
 63            {
 064                if (property.NameEquals("name"))
 65                {
 066                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 070                    name = property.Value.GetString();
 071                    continue;
 72                }
 073                if (property.NameEquals("etag"))
 74                {
 075                    if (property.Value.ValueKind == JsonValueKind.Null)
 76                    {
 77                        continue;
 78                    }
 079                    etag = property.Value.GetString();
 080                    continue;
 81                }
 082                if (property.NameEquals("id"))
 83                {
 084                    if (property.Value.ValueKind == JsonValueKind.Null)
 85                    {
 86                        continue;
 87                    }
 088                    id = property.Value.GetString();
 089                    continue;
 90                }
 091                if (property.NameEquals("properties"))
 92                {
 093                    foreach (var property0 in property.Value.EnumerateObject())
 94                    {
 095                        if (property0.NameEquals("rewriteRules"))
 96                        {
 097                            if (property0.Value.ValueKind == JsonValueKind.Null)
 98                            {
 99                                continue;
 100                            }
 0101                            List<ApplicationGatewayRewriteRule> array = new List<ApplicationGatewayRewriteRule>();
 0102                            foreach (var item in property0.Value.EnumerateArray())
 103                            {
 0104                                if (item.ValueKind == JsonValueKind.Null)
 105                                {
 0106                                    array.Add(null);
 107                                }
 108                                else
 109                                {
 0110                                    array.Add(ApplicationGatewayRewriteRule.DeserializeApplicationGatewayRewriteRule(ite
 111                                }
 112                            }
 0113                            rewriteRules = array;
 0114                            continue;
 115                        }
 0116                        if (property0.NameEquals("provisioningState"))
 117                        {
 0118                            if (property0.Value.ValueKind == JsonValueKind.Null)
 119                            {
 120                                continue;
 121                            }
 0122                            provisioningState = new ProvisioningState(property0.Value.GetString());
 123                            continue;
 124                        }
 125                    }
 126                    continue;
 127                }
 128            }
 0129            return new ApplicationGatewayRewriteRuleSet(id, name, etag, rewriteRules, provisioningState);
 130        }
 131    }
 132}