< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_Type()-0%100%
get_Paths()-0%100%
get_BackendAddressPool()-0%100%
get_BackendHttpSettings()-0%100%
get_RedirectConfiguration()-0%100%
get_RewriteRuleSet()-0%100%
get_ProvisioningState()-0%100%
get_FirewallPolicy()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeApplicationGatewayPathRule(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayPathRule.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> Path rule of URL path map of an application gateway. </summary>
 13    public partial class ApplicationGatewayPathRule : SubResource
 14    {
 15        /// <summary> Initializes a new instance of ApplicationGatewayPathRule. </summary>
 016        public ApplicationGatewayPathRule()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ApplicationGatewayPathRule. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Name of the path rule 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="type"> Type of the resource. </param>
 25        /// <param name="paths"> Path rules of URL path map. </param>
 26        /// <param name="backendAddressPool"> Backend address pool resource of URL path map path rule. </param>
 27        /// <param name="backendHttpSettings"> Backend http settings resource of URL path map path rule. </param>
 28        /// <param name="redirectConfiguration"> Redirect configuration resource of URL path map path rule. </param>
 29        /// <param name="rewriteRuleSet"> Rewrite rule set resource of URL path map path rule. </param>
 30        /// <param name="provisioningState"> The provisioning state of the path rule resource. </param>
 31        /// <param name="firewallPolicy"> Reference to the FirewallPolicy resource. </param>
 032        internal ApplicationGatewayPathRule(string id, string name, string etag, string type, IList<string> paths, SubRe
 33        {
 034            Name = name;
 035            Etag = etag;
 036            Type = type;
 037            Paths = paths;
 038            BackendAddressPool = backendAddressPool;
 039            BackendHttpSettings = backendHttpSettings;
 040            RedirectConfiguration = redirectConfiguration;
 041            RewriteRuleSet = rewriteRuleSet;
 042            ProvisioningState = provisioningState;
 043            FirewallPolicy = firewallPolicy;
 044        }
 45
 46        /// <summary> Name of the path rule that is unique within an Application Gateway. </summary>
 047        public string Name { get; set; }
 48        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 049        public string Etag { get; }
 50        /// <summary> Type of the resource. </summary>
 051        public string Type { get; }
 52        /// <summary> Path rules of URL path map. </summary>
 053        public IList<string> Paths { get; set; }
 54        /// <summary> Backend address pool resource of URL path map path rule. </summary>
 055        public SubResource BackendAddressPool { get; set; }
 56        /// <summary> Backend http settings resource of URL path map path rule. </summary>
 057        public SubResource BackendHttpSettings { get; set; }
 58        /// <summary> Redirect configuration resource of URL path map path rule. </summary>
 059        public SubResource RedirectConfiguration { get; set; }
 60        /// <summary> Rewrite rule set resource of URL path map path rule. </summary>
 061        public SubResource RewriteRuleSet { get; set; }
 62        /// <summary> The provisioning state of the path rule resource. </summary>
 063        public ProvisioningState? ProvisioningState { get; }
 64        /// <summary> Reference to the FirewallPolicy resource. </summary>
 065        public SubResource FirewallPolicy { get; set; }
 66    }
 67}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayPathRule.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 ApplicationGatewayPathRule : 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 (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            if (Id != null)
 35            {
 036                writer.WritePropertyName("id");
 037                writer.WriteStringValue(Id);
 38            }
 039            writer.WritePropertyName("properties");
 040            writer.WriteStartObject();
 041            if (Paths != null)
 42            {
 043                writer.WritePropertyName("paths");
 044                writer.WriteStartArray();
 045                foreach (var item in Paths)
 46                {
 047                    writer.WriteStringValue(item);
 48                }
 049                writer.WriteEndArray();
 50            }
 051            if (BackendAddressPool != null)
 52            {
 053                writer.WritePropertyName("backendAddressPool");
 054                writer.WriteObjectValue(BackendAddressPool);
 55            }
 056            if (BackendHttpSettings != null)
 57            {
 058                writer.WritePropertyName("backendHttpSettings");
 059                writer.WriteObjectValue(BackendHttpSettings);
 60            }
 061            if (RedirectConfiguration != null)
 62            {
 063                writer.WritePropertyName("redirectConfiguration");
 064                writer.WriteObjectValue(RedirectConfiguration);
 65            }
 066            if (RewriteRuleSet != null)
 67            {
 068                writer.WritePropertyName("rewriteRuleSet");
 069                writer.WriteObjectValue(RewriteRuleSet);
 70            }
 071            if (ProvisioningState != null)
 72            {
 073                writer.WritePropertyName("provisioningState");
 074                writer.WriteStringValue(ProvisioningState.Value.ToString());
 75            }
 076            if (FirewallPolicy != null)
 77            {
 078                writer.WritePropertyName("firewallPolicy");
 079                writer.WriteObjectValue(FirewallPolicy);
 80            }
 081            writer.WriteEndObject();
 082            writer.WriteEndObject();
 083        }
 84
 85        internal static ApplicationGatewayPathRule DeserializeApplicationGatewayPathRule(JsonElement element)
 86        {
 087            string name = default;
 088            string etag = default;
 089            string type = default;
 090            string id = default;
 091            IList<string> paths = default;
 092            SubResource backendAddressPool = default;
 093            SubResource backendHttpSettings = default;
 094            SubResource redirectConfiguration = default;
 095            SubResource rewriteRuleSet = default;
 096            ProvisioningState? provisioningState = default;
 097            SubResource firewallPolicy = default;
 098            foreach (var property in element.EnumerateObject())
 99            {
 0100                if (property.NameEquals("name"))
 101                {
 0102                    if (property.Value.ValueKind == JsonValueKind.Null)
 103                    {
 104                        continue;
 105                    }
 0106                    name = property.Value.GetString();
 0107                    continue;
 108                }
 0109                if (property.NameEquals("etag"))
 110                {
 0111                    if (property.Value.ValueKind == JsonValueKind.Null)
 112                    {
 113                        continue;
 114                    }
 0115                    etag = property.Value.GetString();
 0116                    continue;
 117                }
 0118                if (property.NameEquals("type"))
 119                {
 0120                    if (property.Value.ValueKind == JsonValueKind.Null)
 121                    {
 122                        continue;
 123                    }
 0124                    type = property.Value.GetString();
 0125                    continue;
 126                }
 0127                if (property.NameEquals("id"))
 128                {
 0129                    if (property.Value.ValueKind == JsonValueKind.Null)
 130                    {
 131                        continue;
 132                    }
 0133                    id = property.Value.GetString();
 0134                    continue;
 135                }
 0136                if (property.NameEquals("properties"))
 137                {
 0138                    foreach (var property0 in property.Value.EnumerateObject())
 139                    {
 0140                        if (property0.NameEquals("paths"))
 141                        {
 0142                            if (property0.Value.ValueKind == JsonValueKind.Null)
 143                            {
 144                                continue;
 145                            }
 0146                            List<string> array = new List<string>();
 0147                            foreach (var item in property0.Value.EnumerateArray())
 148                            {
 0149                                if (item.ValueKind == JsonValueKind.Null)
 150                                {
 0151                                    array.Add(null);
 152                                }
 153                                else
 154                                {
 0155                                    array.Add(item.GetString());
 156                                }
 157                            }
 0158                            paths = array;
 0159                            continue;
 160                        }
 0161                        if (property0.NameEquals("backendAddressPool"))
 162                        {
 0163                            if (property0.Value.ValueKind == JsonValueKind.Null)
 164                            {
 165                                continue;
 166                            }
 0167                            backendAddressPool = DeserializeSubResource(property0.Value);
 0168                            continue;
 169                        }
 0170                        if (property0.NameEquals("backendHttpSettings"))
 171                        {
 0172                            if (property0.Value.ValueKind == JsonValueKind.Null)
 173                            {
 174                                continue;
 175                            }
 0176                            backendHttpSettings = DeserializeSubResource(property0.Value);
 0177                            continue;
 178                        }
 0179                        if (property0.NameEquals("redirectConfiguration"))
 180                        {
 0181                            if (property0.Value.ValueKind == JsonValueKind.Null)
 182                            {
 183                                continue;
 184                            }
 0185                            redirectConfiguration = DeserializeSubResource(property0.Value);
 0186                            continue;
 187                        }
 0188                        if (property0.NameEquals("rewriteRuleSet"))
 189                        {
 0190                            if (property0.Value.ValueKind == JsonValueKind.Null)
 191                            {
 192                                continue;
 193                            }
 0194                            rewriteRuleSet = DeserializeSubResource(property0.Value);
 0195                            continue;
 196                        }
 0197                        if (property0.NameEquals("provisioningState"))
 198                        {
 0199                            if (property0.Value.ValueKind == JsonValueKind.Null)
 200                            {
 201                                continue;
 202                            }
 0203                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0204                            continue;
 205                        }
 0206                        if (property0.NameEquals("firewallPolicy"))
 207                        {
 0208                            if (property0.Value.ValueKind == JsonValueKind.Null)
 209                            {
 210                                continue;
 211                            }
 0212                            firewallPolicy = DeserializeSubResource(property0.Value);
 213                            continue;
 214                        }
 215                    }
 216                    continue;
 217                }
 218            }
 0219            return new ApplicationGatewayPathRule(id, name, etag, type, paths, backendAddressPool, backendHttpSettings, 
 220        }
 221    }
 222}