< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineExtensionInstanceView
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineExtensionInstanceView.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineExtensionInstanceView.Serialization.cs
Covered lines:34
Uncovered lines:40
Coverable lines:74
Total lines:185
Line coverage:45.9% (34 of 74)
Covered branches:23
Total branches:44
Branch coverage:52.2% (23 of 44)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Name()-0%100%
get_Type()-0%100%
get_TypeHandlerVersion()-0%100%
get_Substatuses()-0%100%
get_Statuses()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVirtualMachineExtensionInstanceView(...)-75%76.67%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineExtensionInstanceView.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.Collections.Generic;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    /// <summary> The instance view of a virtual machine extension. </summary>
 13    public partial class VirtualMachineExtensionInstanceView
 14    {
 15        /// <summary> Initializes a new instance of VirtualMachineExtensionInstanceView. </summary>
 016        public VirtualMachineExtensionInstanceView()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VirtualMachineExtensionInstanceView. </summary>
 21        /// <param name="name"> The virtual machine extension name. </param>
 22        /// <param name="type"> Specifies the type of the extension; an example is &quot;CustomScriptExtension&quot;. </
 23        /// <param name="typeHandlerVersion"> Specifies the version of the script handler. </param>
 24        /// <param name="substatuses"> The resource status information. </param>
 25        /// <param name="statuses"> The resource status information. </param>
 3626        internal VirtualMachineExtensionInstanceView(string name, string type, string typeHandlerVersion, IList<Instance
 27        {
 3628            Name = name;
 3629            Type = type;
 3630            TypeHandlerVersion = typeHandlerVersion;
 3631            Substatuses = substatuses;
 3632            Statuses = statuses;
 3633        }
 34
 35        /// <summary> The virtual machine extension name. </summary>
 036        public string Name { get; set; }
 37        /// <summary> Specifies the type of the extension; an example is &quot;CustomScriptExtension&quot;. </summary>
 038        public string Type { get; set; }
 39        /// <summary> Specifies the version of the script handler. </summary>
 040        public string TypeHandlerVersion { get; set; }
 41        /// <summary> The resource status information. </summary>
 042        public IList<InstanceViewStatus> Substatuses { get; set; }
 43        /// <summary> The resource status information. </summary>
 044        public IList<InstanceViewStatus> Statuses { get; set; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineExtensionInstanceView.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Compute.Models
 13{
 14    public partial class VirtualMachineExtensionInstanceView : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Name != null)
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            if (Type != null)
 25            {
 026                writer.WritePropertyName("type");
 027                writer.WriteStringValue(Type);
 28            }
 029            if (TypeHandlerVersion != null)
 30            {
 031                writer.WritePropertyName("typeHandlerVersion");
 032                writer.WriteStringValue(TypeHandlerVersion);
 33            }
 034            if (Substatuses != null)
 35            {
 036                writer.WritePropertyName("substatuses");
 037                writer.WriteStartArray();
 038                foreach (var item in Substatuses)
 39                {
 040                    writer.WriteObjectValue(item);
 41                }
 042                writer.WriteEndArray();
 43            }
 044            if (Statuses != null)
 45            {
 046                writer.WritePropertyName("statuses");
 047                writer.WriteStartArray();
 048                foreach (var item in Statuses)
 49                {
 050                    writer.WriteObjectValue(item);
 51                }
 052                writer.WriteEndArray();
 53            }
 054            writer.WriteEndObject();
 055        }
 56
 57        internal static VirtualMachineExtensionInstanceView DeserializeVirtualMachineExtensionInstanceView(JsonElement e
 58        {
 3659            string name = default;
 3660            string type = default;
 3661            string typeHandlerVersion = default;
 3662            IList<InstanceViewStatus> substatuses = default;
 3663            IList<InstanceViewStatus> statuses = default;
 31264            foreach (var property in element.EnumerateObject())
 65            {
 12066                if (property.NameEquals("name"))
 67                {
 3668                    if (property.Value.ValueKind == JsonValueKind.Null)
 69                    {
 70                        continue;
 71                    }
 3672                    name = property.Value.GetString();
 3673                    continue;
 74                }
 8475                if (property.NameEquals("type"))
 76                {
 2877                    if (property.Value.ValueKind == JsonValueKind.Null)
 78                    {
 79                        continue;
 80                    }
 2881                    type = property.Value.GetString();
 2882                    continue;
 83                }
 5684                if (property.NameEquals("typeHandlerVersion"))
 85                {
 2886                    if (property.Value.ValueKind == JsonValueKind.Null)
 87                    {
 88                        continue;
 89                    }
 2890                    typeHandlerVersion = property.Value.GetString();
 2891                    continue;
 92                }
 2893                if (property.NameEquals("substatuses"))
 94                {
 095                    if (property.Value.ValueKind == JsonValueKind.Null)
 96                    {
 97                        continue;
 98                    }
 099                    List<InstanceViewStatus> array = new List<InstanceViewStatus>();
 0100                    foreach (var item in property.Value.EnumerateArray())
 101                    {
 0102                        if (item.ValueKind == JsonValueKind.Null)
 103                        {
 0104                            array.Add(null);
 105                        }
 106                        else
 107                        {
 0108                            array.Add(InstanceViewStatus.DeserializeInstanceViewStatus(item));
 109                        }
 110                    }
 0111                    substatuses = array;
 0112                    continue;
 113                }
 28114                if (property.NameEquals("statuses"))
 115                {
 28116                    if (property.Value.ValueKind == JsonValueKind.Null)
 117                    {
 118                        continue;
 119                    }
 28120                    List<InstanceViewStatus> array = new List<InstanceViewStatus>();
 112121                    foreach (var item in property.Value.EnumerateArray())
 122                    {
 28123                        if (item.ValueKind == JsonValueKind.Null)
 124                        {
 0125                            array.Add(null);
 126                        }
 127                        else
 128                        {
 28129                            array.Add(InstanceViewStatus.DeserializeInstanceViewStatus(item));
 130                        }
 131                    }
 28132                    statuses = array;
 133                    continue;
 134                }
 135            }
 36136            return new VirtualMachineExtensionInstanceView(name, type, typeHandlerVersion, substatuses, statuses);
 137        }
 138    }
 139}