< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Port()-0%100%
get_Method()-0%100%
get_Path()-0%100%
get_RequestHeaders()-0%100%
get_ValidStatusCodeRanges()-0%100%
get_PreferHttps()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeConnectionMonitorHttpConfiguration(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionMonitorHttpConfiguration.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> Describes the HTTP configuration. </summary>
 13    public partial class ConnectionMonitorHttpConfiguration
 14    {
 15        /// <summary> Initializes a new instance of ConnectionMonitorHttpConfiguration. </summary>
 016        public ConnectionMonitorHttpConfiguration()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ConnectionMonitorHttpConfiguration. </summary>
 21        /// <param name="port"> The port to connect to. </param>
 22        /// <param name="method"> The HTTP method to use. </param>
 23        /// <param name="path"> The path component of the URI. For instance, &quot;/dir1/dir2&quot;. </param>
 24        /// <param name="requestHeaders"> The HTTP headers to transmit with the request. </param>
 25        /// <param name="validStatusCodeRanges"> HTTP status codes to consider successful. For instance, &quot;2xx,301-3
 26        /// <param name="preferHttps"> Value indicating whether HTTPS is preferred over HTTP in cases where the choice i
 027        internal ConnectionMonitorHttpConfiguration(int? port, HttpConfigurationMethod? method, string path, IList<HttpH
 28        {
 029            Port = port;
 030            Method = method;
 031            Path = path;
 032            RequestHeaders = requestHeaders;
 033            ValidStatusCodeRanges = validStatusCodeRanges;
 034            PreferHttps = preferHttps;
 035        }
 36
 37        /// <summary> The port to connect to. </summary>
 038        public int? Port { get; set; }
 39        /// <summary> The HTTP method to use. </summary>
 040        public HttpConfigurationMethod? Method { get; set; }
 41        /// <summary> The path component of the URI. For instance, &quot;/dir1/dir2&quot;. </summary>
 042        public string Path { get; set; }
 43        /// <summary> The HTTP headers to transmit with the request. </summary>
 044        public IList<HttpHeader> RequestHeaders { get; set; }
 45        /// <summary> HTTP status codes to consider successful. For instance, &quot;2xx,301-304,418&quot;. </summary>
 046        public IList<string> ValidStatusCodeRanges { get; set; }
 47        /// <summary> Value indicating whether HTTPS is preferred over HTTP in cases where the choice is not explicit. <
 048        public bool? PreferHttps { get; set; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionMonitorHttpConfiguration.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 ConnectionMonitorHttpConfiguration : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Port != null)
 20            {
 021                writer.WritePropertyName("port");
 022                writer.WriteNumberValue(Port.Value);
 23            }
 024            if (Method != null)
 25            {
 026                writer.WritePropertyName("method");
 027                writer.WriteStringValue(Method.Value.ToString());
 28            }
 029            if (Path != null)
 30            {
 031                writer.WritePropertyName("path");
 032                writer.WriteStringValue(Path);
 33            }
 034            if (RequestHeaders != null)
 35            {
 036                writer.WritePropertyName("requestHeaders");
 037                writer.WriteStartArray();
 038                foreach (var item in RequestHeaders)
 39                {
 040                    writer.WriteObjectValue(item);
 41                }
 042                writer.WriteEndArray();
 43            }
 044            if (ValidStatusCodeRanges != null)
 45            {
 046                writer.WritePropertyName("validStatusCodeRanges");
 047                writer.WriteStartArray();
 048                foreach (var item in ValidStatusCodeRanges)
 49                {
 050                    writer.WriteStringValue(item);
 51                }
 052                writer.WriteEndArray();
 53            }
 054            if (PreferHttps != null)
 55            {
 056                writer.WritePropertyName("preferHTTPS");
 057                writer.WriteBooleanValue(PreferHttps.Value);
 58            }
 059            writer.WriteEndObject();
 060        }
 61
 62        internal static ConnectionMonitorHttpConfiguration DeserializeConnectionMonitorHttpConfiguration(JsonElement ele
 63        {
 064            int? port = default;
 065            HttpConfigurationMethod? method = default;
 066            string path = default;
 067            IList<HttpHeader> requestHeaders = default;
 068            IList<string> validStatusCodeRanges = default;
 069            bool? preferHTTPS = default;
 070            foreach (var property in element.EnumerateObject())
 71            {
 072                if (property.NameEquals("port"))
 73                {
 074                    if (property.Value.ValueKind == JsonValueKind.Null)
 75                    {
 76                        continue;
 77                    }
 078                    port = property.Value.GetInt32();
 079                    continue;
 80                }
 081                if (property.NameEquals("method"))
 82                {
 083                    if (property.Value.ValueKind == JsonValueKind.Null)
 84                    {
 85                        continue;
 86                    }
 087                    method = new HttpConfigurationMethod(property.Value.GetString());
 088                    continue;
 89                }
 090                if (property.NameEquals("path"))
 91                {
 092                    if (property.Value.ValueKind == JsonValueKind.Null)
 93                    {
 94                        continue;
 95                    }
 096                    path = property.Value.GetString();
 097                    continue;
 98                }
 099                if (property.NameEquals("requestHeaders"))
 100                {
 0101                    if (property.Value.ValueKind == JsonValueKind.Null)
 102                    {
 103                        continue;
 104                    }
 0105                    List<HttpHeader> array = new List<HttpHeader>();
 0106                    foreach (var item in property.Value.EnumerateArray())
 107                    {
 0108                        if (item.ValueKind == JsonValueKind.Null)
 109                        {
 0110                            array.Add(null);
 111                        }
 112                        else
 113                        {
 0114                            array.Add(HttpHeader.DeserializeHttpHeader(item));
 115                        }
 116                    }
 0117                    requestHeaders = array;
 0118                    continue;
 119                }
 0120                if (property.NameEquals("validStatusCodeRanges"))
 121                {
 0122                    if (property.Value.ValueKind == JsonValueKind.Null)
 123                    {
 124                        continue;
 125                    }
 0126                    List<string> array = new List<string>();
 0127                    foreach (var item in property.Value.EnumerateArray())
 128                    {
 0129                        if (item.ValueKind == JsonValueKind.Null)
 130                        {
 0131                            array.Add(null);
 132                        }
 133                        else
 134                        {
 0135                            array.Add(item.GetString());
 136                        }
 137                    }
 0138                    validStatusCodeRanges = array;
 0139                    continue;
 140                }
 0141                if (property.NameEquals("preferHTTPS"))
 142                {
 0143                    if (property.Value.ValueKind == JsonValueKind.Null)
 144                    {
 145                        continue;
 146                    }
 0147                    preferHTTPS = property.Value.GetBoolean();
 148                    continue;
 149                }
 150            }
 0151            return new ConnectionMonitorHttpConfiguration(port, method, path, requestHeaders, validStatusCodeRanges, pre
 152        }
 153    }
 154}