< Summary

Class:Azure.ResourceManager.Storage.Models.ManagementPolicyAction
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ManagementPolicyAction.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ManagementPolicyAction.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_BaseBlob()-100%100%
get_Snapshot()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeManagementPolicyAction(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ManagementPolicyAction.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> Actions are applied to the filtered blobs when the execution condition is met. </summary>
 11    public partial class ManagementPolicyAction
 12    {
 13        /// <summary> Initializes a new instance of ManagementPolicyAction. </summary>
 1214        public ManagementPolicyAction()
 15        {
 1216        }
 17
 18        /// <summary> Initializes a new instance of ManagementPolicyAction. </summary>
 19        /// <param name="baseBlob"> The management policy action for base blob. </param>
 20        /// <param name="snapshot"> The management policy action for snapshot. </param>
 2421        internal ManagementPolicyAction(ManagementPolicyBaseBlob baseBlob, ManagementPolicySnapShot snapshot)
 22        {
 2423            BaseBlob = baseBlob;
 2424            Snapshot = snapshot;
 2425        }
 26
 27        /// <summary> The management policy action for base blob. </summary>
 18028        public ManagementPolicyBaseBlob BaseBlob { get; set; }
 29        /// <summary> The management policy action for snapshot. </summary>
 11630        public ManagementPolicySnapShot Snapshot { get; set; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ManagementPolicyAction.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 ManagementPolicyAction : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1217            writer.WriteStartObject();
 1218            if (BaseBlob != null)
 19            {
 820                writer.WritePropertyName("baseBlob");
 821                writer.WriteObjectValue(BaseBlob);
 22            }
 1223            if (Snapshot != null)
 24            {
 825                writer.WritePropertyName("snapshot");
 826                writer.WriteObjectValue(Snapshot);
 27            }
 1228            writer.WriteEndObject();
 1229        }
 30
 31        internal static ManagementPolicyAction DeserializeManagementPolicyAction(JsonElement element)
 32        {
 2433            ManagementPolicyBaseBlob baseBlob = default;
 2434            ManagementPolicySnapShot snapshot = default;
 11235            foreach (var property in element.EnumerateObject())
 36            {
 3237                if (property.NameEquals("baseBlob"))
 38                {
 1639                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 1643                    baseBlob = ManagementPolicyBaseBlob.DeserializeManagementPolicyBaseBlob(property.Value);
 1644                    continue;
 45                }
 1646                if (property.NameEquals("snapshot"))
 47                {
 1648                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 1652                    snapshot = ManagementPolicySnapShot.DeserializeManagementPolicySnapShot(property.Value);
 53                    continue;
 54                }
 55            }
 2456            return new ManagementPolicyAction(baseBlob, snapshot);
 57        }
 58    }
 59}