< Summary

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

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_RedirectType()-0%100%
get_TargetListener()-0%100%
get_TargetUrl()-0%100%
get_IncludePath()-0%100%
get_IncludeQueryString()-0%100%
get_RequestRoutingRules()-0%100%
get_UrlPathMaps()-0%100%
get_PathRules()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeApplicationGatewayRedirectConfiguration(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayRedirectConfiguration.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> Redirect configuration of an application gateway. </summary>
 13    public partial class ApplicationGatewayRedirectConfiguration : SubResource
 14    {
 15        /// <summary> Initializes a new instance of ApplicationGatewayRedirectConfiguration. </summary>
 016        public ApplicationGatewayRedirectConfiguration()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ApplicationGatewayRedirectConfiguration. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Name of the redirect configuration 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="redirectType"> HTTP redirection type. </param>
 26        /// <param name="targetListener"> Reference to a listener to redirect the request to. </param>
 27        /// <param name="targetUrl"> Url to redirect the request to. </param>
 28        /// <param name="includePath"> Include path in the redirected url. </param>
 29        /// <param name="includeQueryString"> Include query string in the redirected url. </param>
 30        /// <param name="requestRoutingRules"> Request routing specifying redirect configuration. </param>
 31        /// <param name="urlPathMaps"> Url path maps specifying default redirect configuration. </param>
 32        /// <param name="pathRules"> Path rules specifying redirect configuration. </param>
 033        internal ApplicationGatewayRedirectConfiguration(string id, string name, string etag, string type, ApplicationGa
 34        {
 035            Name = name;
 036            Etag = etag;
 037            Type = type;
 038            RedirectType = redirectType;
 039            TargetListener = targetListener;
 040            TargetUrl = targetUrl;
 041            IncludePath = includePath;
 042            IncludeQueryString = includeQueryString;
 043            RequestRoutingRules = requestRoutingRules;
 044            UrlPathMaps = urlPathMaps;
 045            PathRules = pathRules;
 046        }
 47
 48        /// <summary> Name of the redirect configuration that is unique within an Application Gateway. </summary>
 049        public string Name { get; set; }
 50        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 051        public string Etag { get; }
 52        /// <summary> Type of the resource. </summary>
 053        public string Type { get; }
 54        /// <summary> HTTP redirection type. </summary>
 055        public ApplicationGatewayRedirectType? RedirectType { get; set; }
 56        /// <summary> Reference to a listener to redirect the request to. </summary>
 057        public SubResource TargetListener { get; set; }
 58        /// <summary> Url to redirect the request to. </summary>
 059        public string TargetUrl { get; set; }
 60        /// <summary> Include path in the redirected url. </summary>
 061        public bool? IncludePath { get; set; }
 62        /// <summary> Include query string in the redirected url. </summary>
 063        public bool? IncludeQueryString { get; set; }
 64        /// <summary> Request routing specifying redirect configuration. </summary>
 065        public IList<SubResource> RequestRoutingRules { get; set; }
 66        /// <summary> Url path maps specifying default redirect configuration. </summary>
 067        public IList<SubResource> UrlPathMaps { get; set; }
 68        /// <summary> Path rules specifying redirect configuration. </summary>
 069        public IList<SubResource> PathRules { get; set; }
 70    }
 71}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayRedirectConfiguration.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 ApplicationGatewayRedirectConfiguration : 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 (RedirectType != null)
 42            {
 043                writer.WritePropertyName("redirectType");
 044                writer.WriteStringValue(RedirectType.Value.ToString());
 45            }
 046            if (TargetListener != null)
 47            {
 048                writer.WritePropertyName("targetListener");
 049                writer.WriteObjectValue(TargetListener);
 50            }
 051            if (TargetUrl != null)
 52            {
 053                writer.WritePropertyName("targetUrl");
 054                writer.WriteStringValue(TargetUrl);
 55            }
 056            if (IncludePath != null)
 57            {
 058                writer.WritePropertyName("includePath");
 059                writer.WriteBooleanValue(IncludePath.Value);
 60            }
 061            if (IncludeQueryString != null)
 62            {
 063                writer.WritePropertyName("includeQueryString");
 064                writer.WriteBooleanValue(IncludeQueryString.Value);
 65            }
 066            if (RequestRoutingRules != null)
 67            {
 068                writer.WritePropertyName("requestRoutingRules");
 069                writer.WriteStartArray();
 070                foreach (var item in RequestRoutingRules)
 71                {
 072                    writer.WriteObjectValue(item);
 73                }
 074                writer.WriteEndArray();
 75            }
 076            if (UrlPathMaps != null)
 77            {
 078                writer.WritePropertyName("urlPathMaps");
 079                writer.WriteStartArray();
 080                foreach (var item in UrlPathMaps)
 81                {
 082                    writer.WriteObjectValue(item);
 83                }
 084                writer.WriteEndArray();
 85            }
 086            if (PathRules != null)
 87            {
 088                writer.WritePropertyName("pathRules");
 089                writer.WriteStartArray();
 090                foreach (var item in PathRules)
 91                {
 092                    writer.WriteObjectValue(item);
 93                }
 094                writer.WriteEndArray();
 95            }
 096            writer.WriteEndObject();
 097            writer.WriteEndObject();
 098        }
 99
 100        internal static ApplicationGatewayRedirectConfiguration DeserializeApplicationGatewayRedirectConfiguration(JsonE
 101        {
 0102            string name = default;
 0103            string etag = default;
 0104            string type = default;
 0105            string id = default;
 0106            ApplicationGatewayRedirectType? redirectType = default;
 0107            SubResource targetListener = default;
 0108            string targetUrl = default;
 0109            bool? includePath = default;
 0110            bool? includeQueryString = default;
 0111            IList<SubResource> requestRoutingRules = default;
 0112            IList<SubResource> urlPathMaps = default;
 0113            IList<SubResource> pathRules = default;
 0114            foreach (var property in element.EnumerateObject())
 115            {
 0116                if (property.NameEquals("name"))
 117                {
 0118                    if (property.Value.ValueKind == JsonValueKind.Null)
 119                    {
 120                        continue;
 121                    }
 0122                    name = property.Value.GetString();
 0123                    continue;
 124                }
 0125                if (property.NameEquals("etag"))
 126                {
 0127                    if (property.Value.ValueKind == JsonValueKind.Null)
 128                    {
 129                        continue;
 130                    }
 0131                    etag = property.Value.GetString();
 0132                    continue;
 133                }
 0134                if (property.NameEquals("type"))
 135                {
 0136                    if (property.Value.ValueKind == JsonValueKind.Null)
 137                    {
 138                        continue;
 139                    }
 0140                    type = property.Value.GetString();
 0141                    continue;
 142                }
 0143                if (property.NameEquals("id"))
 144                {
 0145                    if (property.Value.ValueKind == JsonValueKind.Null)
 146                    {
 147                        continue;
 148                    }
 0149                    id = property.Value.GetString();
 0150                    continue;
 151                }
 0152                if (property.NameEquals("properties"))
 153                {
 0154                    foreach (var property0 in property.Value.EnumerateObject())
 155                    {
 0156                        if (property0.NameEquals("redirectType"))
 157                        {
 0158                            if (property0.Value.ValueKind == JsonValueKind.Null)
 159                            {
 160                                continue;
 161                            }
 0162                            redirectType = new ApplicationGatewayRedirectType(property0.Value.GetString());
 0163                            continue;
 164                        }
 0165                        if (property0.NameEquals("targetListener"))
 166                        {
 0167                            if (property0.Value.ValueKind == JsonValueKind.Null)
 168                            {
 169                                continue;
 170                            }
 0171                            targetListener = DeserializeSubResource(property0.Value);
 0172                            continue;
 173                        }
 0174                        if (property0.NameEquals("targetUrl"))
 175                        {
 0176                            if (property0.Value.ValueKind == JsonValueKind.Null)
 177                            {
 178                                continue;
 179                            }
 0180                            targetUrl = property0.Value.GetString();
 0181                            continue;
 182                        }
 0183                        if (property0.NameEquals("includePath"))
 184                        {
 0185                            if (property0.Value.ValueKind == JsonValueKind.Null)
 186                            {
 187                                continue;
 188                            }
 0189                            includePath = property0.Value.GetBoolean();
 0190                            continue;
 191                        }
 0192                        if (property0.NameEquals("includeQueryString"))
 193                        {
 0194                            if (property0.Value.ValueKind == JsonValueKind.Null)
 195                            {
 196                                continue;
 197                            }
 0198                            includeQueryString = property0.Value.GetBoolean();
 0199                            continue;
 200                        }
 0201                        if (property0.NameEquals("requestRoutingRules"))
 202                        {
 0203                            if (property0.Value.ValueKind == JsonValueKind.Null)
 204                            {
 205                                continue;
 206                            }
 0207                            List<SubResource> array = new List<SubResource>();
 0208                            foreach (var item in property0.Value.EnumerateArray())
 209                            {
 0210                                if (item.ValueKind == JsonValueKind.Null)
 211                                {
 0212                                    array.Add(null);
 213                                }
 214                                else
 215                                {
 0216                                    array.Add(DeserializeSubResource(item));
 217                                }
 218                            }
 0219                            requestRoutingRules = array;
 0220                            continue;
 221                        }
 0222                        if (property0.NameEquals("urlPathMaps"))
 223                        {
 0224                            if (property0.Value.ValueKind == JsonValueKind.Null)
 225                            {
 226                                continue;
 227                            }
 0228                            List<SubResource> array = new List<SubResource>();
 0229                            foreach (var item in property0.Value.EnumerateArray())
 230                            {
 0231                                if (item.ValueKind == JsonValueKind.Null)
 232                                {
 0233                                    array.Add(null);
 234                                }
 235                                else
 236                                {
 0237                                    array.Add(DeserializeSubResource(item));
 238                                }
 239                            }
 0240                            urlPathMaps = array;
 0241                            continue;
 242                        }
 0243                        if (property0.NameEquals("pathRules"))
 244                        {
 0245                            if (property0.Value.ValueKind == JsonValueKind.Null)
 246                            {
 247                                continue;
 248                            }
 0249                            List<SubResource> array = new List<SubResource>();
 0250                            foreach (var item in property0.Value.EnumerateArray())
 251                            {
 0252                                if (item.ValueKind == JsonValueKind.Null)
 253                                {
 0254                                    array.Add(null);
 255                                }
 256                                else
 257                                {
 0258                                    array.Add(DeserializeSubResource(item));
 259                                }
 260                            }
 0261                            pathRules = array;
 262                            continue;
 263                        }
 264                    }
 265                    continue;
 266                }
 267            }
 0268            return new ApplicationGatewayRedirectConfiguration(id, name, etag, type, redirectType, targetListener, targe
 269        }
 270    }
 271}