< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
get_Enabled()-0%100%
get_DrainTimeoutInSec()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeApplicationGatewayConnectionDraining(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayConnectionDraining.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
 8namespace Azure.ResourceManager.Network.Models
 9{
 10    /// <summary> Connection draining allows open connections to a backend server to be active for a specified time afte
 11    public partial class ApplicationGatewayConnectionDraining
 12    {
 13        /// <summary> Initializes a new instance of ApplicationGatewayConnectionDraining. </summary>
 14        /// <param name="enabled"> Whether connection draining is enabled or not. </param>
 15        /// <param name="drainTimeoutInSec"> The number of seconds connection draining is active. Acceptable values are 
 016        public ApplicationGatewayConnectionDraining(bool enabled, int drainTimeoutInSec)
 17        {
 018            Enabled = enabled;
 019            DrainTimeoutInSec = drainTimeoutInSec;
 020        }
 21
 22        /// <summary> Whether connection draining is enabled or not. </summary>
 023        public bool Enabled { get; set; }
 24        /// <summary> The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 s
 025        public int DrainTimeoutInSec { get; set; }
 26    }
 27}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayConnectionDraining.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    public partial class ApplicationGatewayConnectionDraining : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("enabled");
 019            writer.WriteBooleanValue(Enabled);
 020            writer.WritePropertyName("drainTimeoutInSec");
 021            writer.WriteNumberValue(DrainTimeoutInSec);
 022            writer.WriteEndObject();
 023        }
 24
 25        internal static ApplicationGatewayConnectionDraining DeserializeApplicationGatewayConnectionDraining(JsonElement
 26        {
 027            bool enabled = default;
 028            int drainTimeoutInSec = default;
 029            foreach (var property in element.EnumerateObject())
 30            {
 031                if (property.NameEquals("enabled"))
 32                {
 033                    enabled = property.Value.GetBoolean();
 034                    continue;
 35                }
 036                if (property.NameEquals("drainTimeoutInSec"))
 37                {
 038                    drainTimeoutInSec = property.Value.GetInt32();
 39                    continue;
 40                }
 41            }
 042            return new ApplicationGatewayConnectionDraining(enabled, drainTimeoutInSec);
 43        }
 44    }
 45}