< Summary

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

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\TerminateNotificationProfile.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 TerminateNotificationProfile. </summary>
 11    public partial class TerminateNotificationProfile
 12    {
 13        /// <summary> Initializes a new instance of TerminateNotificationProfile. </summary>
 414        public TerminateNotificationProfile()
 15        {
 416        }
 17
 18        /// <summary> Initializes a new instance of TerminateNotificationProfile. </summary>
 19        /// <param name="notBeforeTimeout"> Configurable length of time a Virtual Machine being deleted will have to pot
 20        /// <param name="enable"> Specifies whether the Terminate Scheduled event is enabled or disabled. </param>
 1221        internal TerminateNotificationProfile(string notBeforeTimeout, bool? enable)
 22        {
 1223            NotBeforeTimeout = notBeforeTimeout;
 1224            Enable = enable;
 1225        }
 26
 27        /// <summary> Configurable length of time a Virtual Machine being deleted will have to potentially approve the T
 3628        public string NotBeforeTimeout { get; set; }
 29        /// <summary> Specifies whether the Terminate Scheduled event is enabled or disabled. </summary>
 3630        public bool? Enable { get; set; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\TerminateNotificationProfile.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 TerminateNotificationProfile : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 817            writer.WriteStartObject();
 818            if (NotBeforeTimeout != null)
 19            {
 820                writer.WritePropertyName("notBeforeTimeout");
 821                writer.WriteStringValue(NotBeforeTimeout);
 22            }
 823            if (Enable != null)
 24            {
 825                writer.WritePropertyName("enable");
 826                writer.WriteBooleanValue(Enable.Value);
 27            }
 828            writer.WriteEndObject();
 829        }
 30
 31        internal static TerminateNotificationProfile DeserializeTerminateNotificationProfile(JsonElement element)
 32        {
 1233            string notBeforeTimeout = default;
 1234            bool? enable = default;
 7235            foreach (var property in element.EnumerateObject())
 36            {
 2437                if (property.NameEquals("notBeforeTimeout"))
 38                {
 1239                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 1243                    notBeforeTimeout = property.Value.GetString();
 1244                    continue;
 45                }
 1246                if (property.NameEquals("enable"))
 47                {
 1248                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 1252                    enable = property.Value.GetBoolean();
 53                    continue;
 54                }
 55            }
 1256            return new TerminateNotificationProfile(notBeforeTimeout, enable);
 57        }
 58    }
 59}