< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_TierToCool()-100%100%
get_TierToArchive()-100%100%
get_Delete()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeManagementPolicyBaseBlob(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ManagementPolicyBaseBlob.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> Management policy action for base blob. </summary>
 11    public partial class ManagementPolicyBaseBlob
 12    {
 13        /// <summary> Initializes a new instance of ManagementPolicyBaseBlob. </summary>
 814        public ManagementPolicyBaseBlob()
 15        {
 816        }
 17
 18        /// <summary> Initializes a new instance of ManagementPolicyBaseBlob. </summary>
 19        /// <param name="tierToCool"> The function to tier blobs to cool storage. Support blobs currently at Hot tier. <
 20        /// <param name="tierToArchive"> The function to tier blobs to archive storage. Support blobs currently at Hot o
 21        /// <param name="delete"> The function to delete the blob. </param>
 1622        internal ManagementPolicyBaseBlob(DateAfterModification tierToCool, DateAfterModification tierToArchive, DateAft
 23        {
 1624            TierToCool = tierToCool;
 1625            TierToArchive = tierToArchive;
 1626            Delete = delete;
 1627        }
 28
 29        /// <summary> The function to tier blobs to cool storage. Support blobs currently at Hot tier. </summary>
 6430        public DateAfterModification TierToCool { get; set; }
 31        /// <summary> The function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier. </summ
 6432        public DateAfterModification TierToArchive { get; set; }
 33        /// <summary> The function to delete the blob. </summary>
 7234        public DateAfterModification Delete { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ManagementPolicyBaseBlob.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 ManagementPolicyBaseBlob : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 817            writer.WriteStartObject();
 818            if (TierToCool != null)
 19            {
 420                writer.WritePropertyName("tierToCool");
 421                writer.WriteObjectValue(TierToCool);
 22            }
 823            if (TierToArchive != null)
 24            {
 425                writer.WritePropertyName("tierToArchive");
 426                writer.WriteObjectValue(TierToArchive);
 27            }
 828            if (Delete != null)
 29            {
 830                writer.WritePropertyName("delete");
 831                writer.WriteObjectValue(Delete);
 32            }
 833            writer.WriteEndObject();
 834        }
 35
 36        internal static ManagementPolicyBaseBlob DeserializeManagementPolicyBaseBlob(JsonElement element)
 37        {
 1638            DateAfterModification tierToCool = default;
 1639            DateAfterModification tierToArchive = default;
 1640            DateAfterModification delete = default;
 9641            foreach (var property in element.EnumerateObject())
 42            {
 3243                if (property.NameEquals("tierToCool"))
 44                {
 845                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 849                    tierToCool = DateAfterModification.DeserializeDateAfterModification(property.Value);
 850                    continue;
 51                }
 2452                if (property.NameEquals("tierToArchive"))
 53                {
 854                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 858                    tierToArchive = DateAfterModification.DeserializeDateAfterModification(property.Value);
 859                    continue;
 60                }
 1661                if (property.NameEquals("delete"))
 62                {
 1663                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 1667                    delete = DateAfterModification.DeserializeDateAfterModification(property.Value);
 68                    continue;
 69                }
 70            }
 1671            return new ManagementPolicyBaseBlob(tierToCool, tierToArchive, delete);
 72        }
 73    }
 74}