< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\RetentionPolicyParameters.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> Parameters that define the retention policy for flow log. </summary>
 11    public partial class RetentionPolicyParameters
 12    {
 13        /// <summary> Initializes a new instance of RetentionPolicyParameters. </summary>
 014        public RetentionPolicyParameters()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of RetentionPolicyParameters. </summary>
 19        /// <param name="days"> Number of days to retain flow log records. </param>
 20        /// <param name="enabled"> Flag to enable/disable retention. </param>
 021        internal RetentionPolicyParameters(int? days, bool? enabled)
 22        {
 023            Days = days;
 024            Enabled = enabled;
 025        }
 26
 27        /// <summary> Number of days to retain flow log records. </summary>
 028        public int? Days { get; set; }
 29        /// <summary> Flag to enable/disable retention. </summary>
 030        public bool? Enabled { get; set; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\RetentionPolicyParameters.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 RetentionPolicyParameters : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Days != null)
 19            {
 020                writer.WritePropertyName("days");
 021                writer.WriteNumberValue(Days.Value);
 22            }
 023            if (Enabled != null)
 24            {
 025                writer.WritePropertyName("enabled");
 026                writer.WriteBooleanValue(Enabled.Value);
 27            }
 028            writer.WriteEndObject();
 029        }
 30
 31        internal static RetentionPolicyParameters DeserializeRetentionPolicyParameters(JsonElement element)
 32        {
 033            int? days = default;
 034            bool? enabled = default;
 035            foreach (var property in element.EnumerateObject())
 36            {
 037                if (property.NameEquals("days"))
 38                {
 039                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 043                    days = property.Value.GetInt32();
 044                    continue;
 45                }
 046                if (property.NameEquals("enabled"))
 47                {
 048                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 052                    enabled = property.Value.GetBoolean();
 53                    continue;
 54                }
 55            }
 056            return new RetentionPolicyParameters(days, enabled);
 57        }
 58    }
 59}