< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVMProtectionPolicy
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetVMProtectionPolicy.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetVMProtectionPolicy.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_ProtectFromScaleIn()-0%100%
get_ProtectFromScaleSetActions()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVirtualMachineScaleSetVMProtectionPolicy(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetVMProtectionPolicy.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.Compute.Models
 9{
 10    /// <summary> The protection policy of a virtual machine scale set VM. </summary>
 11    public partial class VirtualMachineScaleSetVMProtectionPolicy
 12    {
 13        /// <summary> Initializes a new instance of VirtualMachineScaleSetVMProtectionPolicy. </summary>
 014        public VirtualMachineScaleSetVMProtectionPolicy()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of VirtualMachineScaleSetVMProtectionPolicy. </summary>
 19        /// <param name="protectFromScaleIn"> Indicates that the virtual machine scale set VM shouldn&apos;t be consider
 20        /// <param name="protectFromScaleSetActions"> Indicates that model updates or actions (including scale-in) initi
 021        internal VirtualMachineScaleSetVMProtectionPolicy(bool? protectFromScaleIn, bool? protectFromScaleSetActions)
 22        {
 023            ProtectFromScaleIn = protectFromScaleIn;
 024            ProtectFromScaleSetActions = protectFromScaleSetActions;
 025        }
 26
 27        /// <summary> Indicates that the virtual machine scale set VM shouldn&apos;t be considered for deletion during a
 028        public bool? ProtectFromScaleIn { get; set; }
 29        /// <summary> Indicates that model updates or actions (including scale-in) initiated on the virtual machine scal
 030        public bool? ProtectFromScaleSetActions { get; set; }
 31    }
 32}

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