< Summary

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

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\AutomaticRepairsPolicy.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> Specifies the configuration parameters for automatic repairs on the virtual machine scale set. </summa
 11    public partial class AutomaticRepairsPolicy
 12    {
 13        /// <summary> Initializes a new instance of AutomaticRepairsPolicy. </summary>
 1614        public AutomaticRepairsPolicy()
 15        {
 1616        }
 17
 18        /// <summary> Initializes a new instance of AutomaticRepairsPolicy. </summary>
 19        /// <param name="enabled"> Specifies whether automatic repairs should be enabled on the virtual machine scale se
 20        /// <param name="gracePeriod"> The amount of time for which automatic repairs are suspended due to a state chang
 4021        internal AutomaticRepairsPolicy(bool? enabled, string gracePeriod)
 22        {
 4023            Enabled = enabled;
 4024            GracePeriod = gracePeriod;
 4025        }
 26
 27        /// <summary> Specifies whether automatic repairs should be enabled on the virtual machine scale set. The defaul
 16028        public bool? Enabled { get; set; }
 29        /// <summary> The amount of time for which automatic repairs are suspended due to a state change on VM. The grac
 12030        public string GracePeriod { get; set; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\AutomaticRepairsPolicy.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 AutomaticRepairsPolicy : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 3217            writer.WriteStartObject();
 3218            if (Enabled != null)
 19            {
 3220                writer.WritePropertyName("enabled");
 3221                writer.WriteBooleanValue(Enabled.Value);
 22            }
 3223            if (GracePeriod != null)
 24            {
 825                writer.WritePropertyName("gracePeriod");
 826                writer.WriteStringValue(GracePeriod);
 27            }
 3228            writer.WriteEndObject();
 3229        }
 30
 31        internal static AutomaticRepairsPolicy DeserializeAutomaticRepairsPolicy(JsonElement element)
 32        {
 4033            bool? enabled = default;
 4034            string gracePeriod = default;
 24035            foreach (var property in element.EnumerateObject())
 36            {
 8037                if (property.NameEquals("enabled"))
 38                {
 4039                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 4043                    enabled = property.Value.GetBoolean();
 4044                    continue;
 45                }
 4046                if (property.NameEquals("gracePeriod"))
 47                {
 4048                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 4052                    gracePeriod = property.Value.GetString();
 53                    continue;
 54                }
 55            }
 4056            return new AutomaticRepairsPolicy(enabled, gracePeriod);
 57        }
 58    }
 59}