< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ManagementPolicySnapShot.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 snapshot. </summary>
 11    public partial class ManagementPolicySnapShot
 12    {
 13        /// <summary> Initializes a new instance of ManagementPolicySnapShot. </summary>
 814        public ManagementPolicySnapShot()
 15        {
 816        }
 17
 18        /// <summary> Initializes a new instance of ManagementPolicySnapShot. </summary>
 19        /// <param name="delete"> The function to delete the blob snapshot. </param>
 1620        internal ManagementPolicySnapShot(DateAfterCreation delete)
 21        {
 1622            Delete = delete;
 1623        }
 24
 25        /// <summary> The function to delete the blob snapshot. </summary>
 7226        public DateAfterCreation Delete { get; set; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ManagementPolicySnapShot.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 ManagementPolicySnapShot : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 817            writer.WriteStartObject();
 818            if (Delete != null)
 19            {
 820                writer.WritePropertyName("delete");
 821                writer.WriteObjectValue(Delete);
 22            }
 823            writer.WriteEndObject();
 824        }
 25
 26        internal static ManagementPolicySnapShot DeserializeManagementPolicySnapShot(JsonElement element)
 27        {
 1628            DateAfterCreation delete = default;
 6429            foreach (var property in element.EnumerateObject())
 30            {
 1631                if (property.NameEquals("delete"))
 32                {
 1633                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 1637                    delete = DateAfterCreation.DeserializeDateAfterCreation(property.Value);
 38                    continue;
 39                }
 40            }
 1641            return new ManagementPolicySnapShot(delete);
 42        }
 43    }
 44}