< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineInstanceView
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineInstanceView.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineInstanceView.Serialization.cs
Covered lines:124
Uncovered lines:38
Coverable lines:162
Total lines:354
Line coverage:76.5% (124 of 162)
Covered branches:76
Total branches:98
Branch coverage:77.5% (76 of 98)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_PlatformUpdateDomain()-100%100%
get_PlatformFaultDomain()-100%100%
get_ComputerName()-100%100%
get_OsName()-100%100%
get_OsVersion()-100%100%
get_HyperVGeneration()-100%100%
get_RdpThumbPrint()-100%100%
get_VmAgent()-100%100%
get_MaintenanceRedeployStatus()-100%100%
get_Disks()-100%100%
get_Extensions()-100%100%
get_BootDiagnostics()-100%100%
get_Statuses()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-58.82%65.63%
DeserializeVirtualMachineInstanceView(...)-81.48%83.33%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineInstanceView.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. </summary>
 13    public partial class VirtualMachineInstanceView
 14    {
 15        /// <summary> Initializes a new instance of VirtualMachineInstanceView. </summary>
 016        public VirtualMachineInstanceView()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VirtualMachineInstanceView. </summary>
 21        /// <param name="platformUpdateDomain"> Specifies the update domain of the virtual machine. </param>
 22        /// <param name="platformFaultDomain"> Specifies the fault domain of the virtual machine. </param>
 23        /// <param name="computerName"> The computer name assigned to the virtual machine. </param>
 24        /// <param name="osName"> The Operating System running on the virtual machine. </param>
 25        /// <param name="osVersion"> The version of Operating System running on the virtual machine. </param>
 26        /// <param name="hyperVGeneration"> Specifies the HyperVGeneration Type associated with a resource. </param>
 27        /// <param name="rdpThumbPrint"> The Remote desktop certificate thumbprint. </param>
 28        /// <param name="vmAgent"> The VM Agent running on the virtual machine. </param>
 29        /// <param name="maintenanceRedeployStatus"> The Maintenance Operation status on the virtual machine. </param>
 30        /// <param name="disks"> The virtual machine disk information. </param>
 31        /// <param name="extensions"> The extensions information. </param>
 32        /// <param name="bootDiagnostics"> Boot Diagnostics is a debugging feature which allows you to view Console Outp
 33        /// <param name="statuses"> The resource status information. </param>
 16834        internal VirtualMachineInstanceView(int? platformUpdateDomain, int? platformFaultDomain, string computerName, st
 35        {
 16836            PlatformUpdateDomain = platformUpdateDomain;
 16837            PlatformFaultDomain = platformFaultDomain;
 16838            ComputerName = computerName;
 16839            OsName = osName;
 16840            OsVersion = osVersion;
 16841            HyperVGeneration = hyperVGeneration;
 16842            RdpThumbPrint = rdpThumbPrint;
 16843            VmAgent = vmAgent;
 16844            MaintenanceRedeployStatus = maintenanceRedeployStatus;
 16845            Disks = disks;
 16846            Extensions = extensions;
 16847            BootDiagnostics = bootDiagnostics;
 16848            Statuses = statuses;
 16849        }
 50
 51        /// <summary> Specifies the update domain of the virtual machine. </summary>
 18452        public int? PlatformUpdateDomain { get; set; }
 53        /// <summary> Specifies the fault domain of the virtual machine. </summary>
 18454        public int? PlatformFaultDomain { get; set; }
 55        /// <summary> The computer name assigned to the virtual machine. </summary>
 21656        public string ComputerName { get; set; }
 57        /// <summary> The Operating System running on the virtual machine. </summary>
 21658        public string OsName { get; set; }
 59        /// <summary> The version of Operating System running on the virtual machine. </summary>
 21660        public string OsVersion { get; set; }
 61        /// <summary> Specifies the HyperVGeneration Type associated with a resource. </summary>
 20062        public HyperVGenerationType? HyperVGeneration { get; set; }
 63        /// <summary> The Remote desktop certificate thumbprint. </summary>
 18464        public string RdpThumbPrint { get; set; }
 65        /// <summary> The VM Agent running on the virtual machine. </summary>
 20066        public VirtualMachineAgentInstanceView VmAgent { get; set; }
 67        /// <summary> The Maintenance Operation status on the virtual machine. </summary>
 18468        public MaintenanceRedeployStatus MaintenanceRedeployStatus { get; set; }
 69        /// <summary> The virtual machine disk information. </summary>
 28070        public IList<DiskInstanceView> Disks { get; set; }
 71        /// <summary> The extensions information. </summary>
 18472        public IList<VirtualMachineExtensionInstanceView> Extensions { get; set; }
 73        /// <summary> Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to 
 19274        public BootDiagnosticsInstanceView BootDiagnostics { get; set; }
 75        /// <summary> The resource status information. </summary>
 24476        public IList<InstanceViewStatus> Statuses { get; set; }
 77    }
 78}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineInstanceView.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 VirtualMachineInstanceView : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 1618            writer.WriteStartObject();
 1619            if (PlatformUpdateDomain != null)
 20            {
 021                writer.WritePropertyName("platformUpdateDomain");
 022                writer.WriteNumberValue(PlatformUpdateDomain.Value);
 23            }
 1624            if (PlatformFaultDomain != null)
 25            {
 026                writer.WritePropertyName("platformFaultDomain");
 027                writer.WriteNumberValue(PlatformFaultDomain.Value);
 28            }
 1629            if (ComputerName != null)
 30            {
 031                writer.WritePropertyName("computerName");
 032                writer.WriteStringValue(ComputerName);
 33            }
 1634            if (OsName != null)
 35            {
 036                writer.WritePropertyName("osName");
 037                writer.WriteStringValue(OsName);
 38            }
 1639            if (OsVersion != null)
 40            {
 041                writer.WritePropertyName("osVersion");
 042                writer.WriteStringValue(OsVersion);
 43            }
 1644            if (HyperVGeneration != null)
 45            {
 1646                writer.WritePropertyName("hyperVGeneration");
 1647                writer.WriteStringValue(HyperVGeneration.Value.ToString());
 48            }
 1649            if (RdpThumbPrint != null)
 50            {
 051                writer.WritePropertyName("rdpThumbPrint");
 052                writer.WriteStringValue(RdpThumbPrint);
 53            }
 1654            if (VmAgent != null)
 55            {
 1656                writer.WritePropertyName("vmAgent");
 1657                writer.WriteObjectValue(VmAgent);
 58            }
 1659            if (MaintenanceRedeployStatus != null)
 60            {
 061                writer.WritePropertyName("maintenanceRedeployStatus");
 062                writer.WriteObjectValue(MaintenanceRedeployStatus);
 63            }
 1664            if (Disks != null)
 65            {
 1666                writer.WritePropertyName("disks");
 1667                writer.WriteStartArray();
 9668                foreach (var item in Disks)
 69                {
 3270                    writer.WriteObjectValue(item);
 71                }
 1672                writer.WriteEndArray();
 73            }
 1674            if (Extensions != null)
 75            {
 076                writer.WritePropertyName("extensions");
 077                writer.WriteStartArray();
 078                foreach (var item in Extensions)
 79                {
 080                    writer.WriteObjectValue(item);
 81                }
 082                writer.WriteEndArray();
 83            }
 1684            if (BootDiagnostics != null)
 85            {
 086                writer.WritePropertyName("bootDiagnostics");
 087                writer.WriteObjectValue(BootDiagnostics);
 88            }
 1689            if (Statuses != null)
 90            {
 1691                writer.WritePropertyName("statuses");
 1692                writer.WriteStartArray();
 9693                foreach (var item in Statuses)
 94                {
 3295                    writer.WriteObjectValue(item);
 96                }
 1697                writer.WriteEndArray();
 98            }
 1699            writer.WriteEndObject();
 16100        }
 101
 102        internal static VirtualMachineInstanceView DeserializeVirtualMachineInstanceView(JsonElement element)
 103        {
 168104            int? platformUpdateDomain = default;
 168105            int? platformFaultDomain = default;
 168106            string computerName = default;
 168107            string osName = default;
 168108            string osVersion = default;
 168109            HyperVGenerationType? hyperVGeneration = default;
 168110            string rdpThumbPrint = default;
 168111            VirtualMachineAgentInstanceView vmAgent = default;
 168112            MaintenanceRedeployStatus maintenanceRedeployStatus = default;
 168113            IList<DiskInstanceView> disks = default;
 168114            IList<VirtualMachineExtensionInstanceView> extensions = default;
 168115            BootDiagnosticsInstanceView bootDiagnostics = default;
 168116            IList<InstanceViewStatus> statuses = default;
 1920117            foreach (var property in element.EnumerateObject())
 118            {
 792119                if (property.NameEquals("platformUpdateDomain"))
 120                {
 0121                    if (property.Value.ValueKind == JsonValueKind.Null)
 122                    {
 123                        continue;
 124                    }
 0125                    platformUpdateDomain = property.Value.GetInt32();
 0126                    continue;
 127                }
 792128                if (property.NameEquals("platformFaultDomain"))
 129                {
 0130                    if (property.Value.ValueKind == JsonValueKind.Null)
 131                    {
 132                        continue;
 133                    }
 0134                    platformFaultDomain = property.Value.GetInt32();
 0135                    continue;
 136                }
 792137                if (property.NameEquals("computerName"))
 138                {
 32139                    if (property.Value.ValueKind == JsonValueKind.Null)
 140                    {
 141                        continue;
 142                    }
 32143                    computerName = property.Value.GetString();
 32144                    continue;
 145                }
 760146                if (property.NameEquals("osName"))
 147                {
 32148                    if (property.Value.ValueKind == JsonValueKind.Null)
 149                    {
 150                        continue;
 151                    }
 32152                    osName = property.Value.GetString();
 32153                    continue;
 154                }
 728155                if (property.NameEquals("osVersion"))
 156                {
 32157                    if (property.Value.ValueKind == JsonValueKind.Null)
 158                    {
 159                        continue;
 160                    }
 32161                    osVersion = property.Value.GetString();
 32162                    continue;
 163                }
 696164                if (property.NameEquals("hyperVGeneration"))
 165                {
 168166                    if (property.Value.ValueKind == JsonValueKind.Null)
 167                    {
 168                        continue;
 169                    }
 168170                    hyperVGeneration = new HyperVGenerationType(property.Value.GetString());
 168171                    continue;
 172                }
 528173                if (property.NameEquals("rdpThumbPrint"))
 174                {
 0175                    if (property.Value.ValueKind == JsonValueKind.Null)
 176                    {
 177                        continue;
 178                    }
 0179                    rdpThumbPrint = property.Value.GetString();
 0180                    continue;
 181                }
 528182                if (property.NameEquals("vmAgent"))
 183                {
 168184                    if (property.Value.ValueKind == JsonValueKind.Null)
 185                    {
 186                        continue;
 187                    }
 168188                    vmAgent = VirtualMachineAgentInstanceView.DeserializeVirtualMachineAgentInstanceView(property.Value)
 168189                    continue;
 190                }
 360191                if (property.NameEquals("maintenanceRedeployStatus"))
 192                {
 0193                    if (property.Value.ValueKind == JsonValueKind.Null)
 194                    {
 195                        continue;
 196                    }
 0197                    maintenanceRedeployStatus = MaintenanceRedeployStatus.DeserializeMaintenanceRedeployStatus(property.
 0198                    continue;
 199                }
 360200                if (property.NameEquals("disks"))
 201                {
 168202                    if (property.Value.ValueKind == JsonValueKind.Null)
 203                    {
 204                        continue;
 205                    }
 168206                    List<DiskInstanceView> array = new List<DiskInstanceView>();
 800207                    foreach (var item in property.Value.EnumerateArray())
 208                    {
 232209                        if (item.ValueKind == JsonValueKind.Null)
 210                        {
 0211                            array.Add(null);
 212                        }
 213                        else
 214                        {
 232215                            array.Add(DiskInstanceView.DeserializeDiskInstanceView(item));
 216                        }
 217                    }
 168218                    disks = array;
 168219                    continue;
 220                }
 192221                if (property.NameEquals("extensions"))
 222                {
 12223                    if (property.Value.ValueKind == JsonValueKind.Null)
 224                    {
 225                        continue;
 226                    }
 12227                    List<VirtualMachineExtensionInstanceView> array = new List<VirtualMachineExtensionInstanceView>();
 48228                    foreach (var item in property.Value.EnumerateArray())
 229                    {
 12230                        if (item.ValueKind == JsonValueKind.Null)
 231                        {
 0232                            array.Add(null);
 233                        }
 234                        else
 235                        {
 12236                            array.Add(VirtualMachineExtensionInstanceView.DeserializeVirtualMachineExtensionInstanceView
 237                        }
 238                    }
 12239                    extensions = array;
 12240                    continue;
 241                }
 180242                if (property.NameEquals("bootDiagnostics"))
 243                {
 12244                    if (property.Value.ValueKind == JsonValueKind.Null)
 245                    {
 246                        continue;
 247                    }
 12248                    bootDiagnostics = BootDiagnosticsInstanceView.DeserializeBootDiagnosticsInstanceView(property.Value)
 12249                    continue;
 250                }
 168251                if (property.NameEquals("statuses"))
 252                {
 168253                    if (property.Value.ValueKind == JsonValueKind.Null)
 254                    {
 255                        continue;
 256                    }
 168257                    List<InstanceViewStatus> array = new List<InstanceViewStatus>();
 1008258                    foreach (var item in property.Value.EnumerateArray())
 259                    {
 336260                        if (item.ValueKind == JsonValueKind.Null)
 261                        {
 0262                            array.Add(null);
 263                        }
 264                        else
 265                        {
 336266                            array.Add(InstanceViewStatus.DeserializeInstanceViewStatus(item));
 267                        }
 268                    }
 168269                    statuses = array;
 270                    continue;
 271                }
 272            }
 168273            return new VirtualMachineInstanceView(platformUpdateDomain, platformFaultDomain, computerName, osName, osVer
 274        }
 275    }
 276}