< Summary

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

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\AutomaticOSUpgradePolicy.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 configuration parameters used for performing automatic OS upgrade. </summary>
 11    public partial class AutomaticOSUpgradePolicy
 12    {
 13        /// <summary> Initializes a new instance of AutomaticOSUpgradePolicy. </summary>
 014        public AutomaticOSUpgradePolicy()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of AutomaticOSUpgradePolicy. </summary>
 19        /// <param name="enableAutomaticOSUpgrade"> Indicates whether OS upgrades should automatically be applied to sca
 20        /// <param name="disableAutomaticRollback"> Whether OS image rollback feature should be disabled. Default value 
 021        internal AutomaticOSUpgradePolicy(bool? enableAutomaticOSUpgrade, bool? disableAutomaticRollback)
 22        {
 023            EnableAutomaticOSUpgrade = enableAutomaticOSUpgrade;
 024            DisableAutomaticRollback = disableAutomaticRollback;
 025        }
 26
 27        /// <summary> Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling 
 028        public bool? EnableAutomaticOSUpgrade { get; set; }
 29        /// <summary> Whether OS image rollback feature should be disabled. Default value is false. </summary>
 030        public bool? DisableAutomaticRollback { get; set; }
 31    }
 32}

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