< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\DeleteRetentionPolicy.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.Storage.Models
 9{
 10    /// <summary> The service properties for soft delete. </summary>
 11    public partial class DeleteRetentionPolicy
 12    {
 13        /// <summary> Initializes a new instance of DeleteRetentionPolicy. </summary>
 814        public DeleteRetentionPolicy()
 15        {
 816        }
 17
 18        /// <summary> Initializes a new instance of DeleteRetentionPolicy. </summary>
 19        /// <param name="enabled"> Indicates whether DeleteRetentionPolicy is enabled. </param>
 20        /// <param name="days"> Indicates the number of days that the deleted item should be retained. The minimum speci
 5221        internal DeleteRetentionPolicy(bool? enabled, int? days)
 22        {
 5223            Enabled = enabled;
 5224            Days = days;
 5225        }
 26
 27        /// <summary> Indicates whether DeleteRetentionPolicy is enabled. </summary>
 10828        public bool? Enabled { get; set; }
 29        /// <summary> Indicates the number of days that the deleted item should be retained. The minimum specified value
 10030        public int? Days { get; set; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\DeleteRetentionPolicy.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.Storage.Models
 12{
 13    public partial class DeleteRetentionPolicy : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1617            writer.WriteStartObject();
 1618            if (Enabled != null)
 19            {
 1620                writer.WritePropertyName("enabled");
 1621                writer.WriteBooleanValue(Enabled.Value);
 22            }
 1623            if (Days != null)
 24            {
 825                writer.WritePropertyName("days");
 826                writer.WriteNumberValue(Days.Value);
 27            }
 1628            writer.WriteEndObject();
 1629        }
 30
 31        internal static DeleteRetentionPolicy DeserializeDeleteRetentionPolicy(JsonElement element)
 32        {
 5233            bool? enabled = default;
 5234            int? days = default;
 24035            foreach (var property in element.EnumerateObject())
 36            {
 6837                if (property.NameEquals("enabled"))
 38                {
 5239                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 5243                    enabled = property.Value.GetBoolean();
 5244                    continue;
 45                }
 1646                if (property.NameEquals("days"))
 47                {
 1648                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 1652                    days = property.Value.GetInt32();
 53                    continue;
 54                }
 55            }
 5256            return new DeleteRetentionPolicy(enabled, days);
 57        }
 58    }
 59}