< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineExtensionHandlerInstanceView
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineExtensionHandlerInstanceView.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineExtensionHandlerInstanceView.Serialization.cs
Covered lines:21
Uncovered lines:17
Coverable lines:38
Total lines:110
Line coverage:55.2% (21 of 38)
Covered branches:14
Total branches:20
Branch coverage:70% (14 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Type()-0%100%
get_TypeHandlerVersion()-0%100%
get_Status()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVirtualMachineExtensionHandlerInstanceView(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineExtensionHandlerInstanceView.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 instance view of a virtual machine extension handler. </summary>
 11    public partial class VirtualMachineExtensionHandlerInstanceView
 12    {
 13        /// <summary> Initializes a new instance of VirtualMachineExtensionHandlerInstanceView. </summary>
 014        public VirtualMachineExtensionHandlerInstanceView()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of VirtualMachineExtensionHandlerInstanceView. </summary>
 19        /// <param name="type"> Specifies the type of the extension; an example is &quot;CustomScriptExtension&quot;. </
 20        /// <param name="typeHandlerVersion"> Specifies the version of the script handler. </param>
 21        /// <param name="status"> The extension handler status. </param>
 2822        internal VirtualMachineExtensionHandlerInstanceView(string type, string typeHandlerVersion, InstanceViewStatus s
 23        {
 2824            Type = type;
 2825            TypeHandlerVersion = typeHandlerVersion;
 2826            Status = status;
 2827        }
 28
 29        /// <summary> Specifies the type of the extension; an example is &quot;CustomScriptExtension&quot;. </summary>
 030        public string Type { get; set; }
 31        /// <summary> Specifies the version of the script handler. </summary>
 032        public string TypeHandlerVersion { get; set; }
 33        /// <summary> The extension handler status. </summary>
 034        public InstanceViewStatus Status { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineExtensionHandlerInstanceView.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 VirtualMachineExtensionHandlerInstanceView : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Type != null)
 19            {
 020                writer.WritePropertyName("type");
 021                writer.WriteStringValue(Type);
 22            }
 023            if (TypeHandlerVersion != null)
 24            {
 025                writer.WritePropertyName("typeHandlerVersion");
 026                writer.WriteStringValue(TypeHandlerVersion);
 27            }
 028            if (Status != null)
 29            {
 030                writer.WritePropertyName("status");
 031                writer.WriteObjectValue(Status);
 32            }
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static VirtualMachineExtensionHandlerInstanceView DeserializeVirtualMachineExtensionHandlerInstanceView
 37        {
 2838            string type = default;
 2839            string typeHandlerVersion = default;
 2840            InstanceViewStatus status = default;
 22441            foreach (var property in element.EnumerateObject())
 42            {
 8443                if (property.NameEquals("type"))
 44                {
 2845                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 2849                    type = property.Value.GetString();
 2850                    continue;
 51                }
 5652                if (property.NameEquals("typeHandlerVersion"))
 53                {
 2854                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 2858                    typeHandlerVersion = property.Value.GetString();
 2859                    continue;
 60                }
 2861                if (property.NameEquals("status"))
 62                {
 2863                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 2867                    status = InstanceViewStatus.DeserializeInstanceViewStatus(property.Value);
 68                    continue;
 69                }
 70            }
 2871            return new VirtualMachineExtensionHandlerInstanceView(type, typeHandlerVersion, status);
 72        }
 73    }
 74}