< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVMInstanceView
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetVMInstanceView.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetVMInstanceView.Serialization.cs
Covered lines:70
Uncovered lines:72
Coverable lines:142
Total lines:316
Line coverage:49.2% (70 of 142)
Covered branches:47
Total branches:86
Branch coverage:54.6% (47 of 86)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_PlatformUpdateDomain()-0%100%
get_PlatformFaultDomain()-0%100%
get_RdpThumbPrint()-0%100%
get_VmAgent()-0%100%
get_MaintenanceRedeployStatus()-0%100%
get_Disks()-100%100%
get_Extensions()-0%100%
get_VmHealth()-0%100%
get_BootDiagnostics()-0%100%
get_Statuses()-0%100%
get_PlacementGroupId()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVirtualMachineScaleSetVMInstanceView(...)-78.87%81.03%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetVMInstanceView.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 scale set VM. </summary>
 13    public partial class VirtualMachineScaleSetVMInstanceView
 14    {
 15        /// <summary> Initializes a new instance of VirtualMachineScaleSetVMInstanceView. </summary>
 016        public VirtualMachineScaleSetVMInstanceView()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VirtualMachineScaleSetVMInstanceView. </summary>
 21        /// <param name="platformUpdateDomain"> The Update Domain count. </param>
 22        /// <param name="platformFaultDomain"> The Fault Domain count. </param>
 23        /// <param name="rdpThumbPrint"> The Remote desktop certificate thumbprint. </param>
 24        /// <param name="vmAgent"> The VM Agent running on the virtual machine. </param>
 25        /// <param name="maintenanceRedeployStatus"> The Maintenance Operation status on the virtual machine. </param>
 26        /// <param name="disks"> The disks information. </param>
 27        /// <param name="extensions"> The extensions information. </param>
 28        /// <param name="vmHealth"> The health status for the VM. </param>
 29        /// <param name="bootDiagnostics"> Boot Diagnostics is a debugging feature which allows you to view Console Outp
 30        /// <param name="statuses"> The resource status information. </param>
 31        /// <param name="placementGroupId"> The placement group in which the VM is running. If the VM is deallocated it 
 2432        internal VirtualMachineScaleSetVMInstanceView(int? platformUpdateDomain, int? platformFaultDomain, string rdpThu
 33        {
 2434            PlatformUpdateDomain = platformUpdateDomain;
 2435            PlatformFaultDomain = platformFaultDomain;
 2436            RdpThumbPrint = rdpThumbPrint;
 2437            VmAgent = vmAgent;
 2438            MaintenanceRedeployStatus = maintenanceRedeployStatus;
 2439            Disks = disks;
 2440            Extensions = extensions;
 2441            VmHealth = vmHealth;
 2442            BootDiagnostics = bootDiagnostics;
 2443            Statuses = statuses;
 2444            PlacementGroupId = placementGroupId;
 2445        }
 46
 47        /// <summary> The Update Domain count. </summary>
 048        public int? PlatformUpdateDomain { get; set; }
 49        /// <summary> The Fault Domain count. </summary>
 050        public int? PlatformFaultDomain { get; set; }
 51        /// <summary> The Remote desktop certificate thumbprint. </summary>
 052        public string RdpThumbPrint { get; set; }
 53        /// <summary> The VM Agent running on the virtual machine. </summary>
 054        public VirtualMachineAgentInstanceView VmAgent { get; set; }
 55        /// <summary> The Maintenance Operation status on the virtual machine. </summary>
 056        public MaintenanceRedeployStatus MaintenanceRedeployStatus { get; set; }
 57        /// <summary> The disks information. </summary>
 3658        public IList<DiskInstanceView> Disks { get; set; }
 59        /// <summary> The extensions information. </summary>
 060        public IList<VirtualMachineExtensionInstanceView> Extensions { get; set; }
 61        /// <summary> The health status for the VM. </summary>
 062        public VirtualMachineHealthStatus VmHealth { get; }
 63        /// <summary> Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to 
 064        public BootDiagnosticsInstanceView BootDiagnostics { get; set; }
 65        /// <summary> The resource status information. </summary>
 066        public IList<InstanceViewStatus> Statuses { get; set; }
 67        /// <summary> The placement group in which the VM is running. If the VM is deallocated it will not have a placem
 068        public string PlacementGroupId { get; set; }
 69    }
 70}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetVMInstanceView.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 VirtualMachineScaleSetVMInstanceView : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (PlatformUpdateDomain != null)
 20            {
 021                writer.WritePropertyName("platformUpdateDomain");
 022                writer.WriteNumberValue(PlatformUpdateDomain.Value);
 23            }
 024            if (PlatformFaultDomain != null)
 25            {
 026                writer.WritePropertyName("platformFaultDomain");
 027                writer.WriteNumberValue(PlatformFaultDomain.Value);
 28            }
 029            if (RdpThumbPrint != null)
 30            {
 031                writer.WritePropertyName("rdpThumbPrint");
 032                writer.WriteStringValue(RdpThumbPrint);
 33            }
 034            if (VmAgent != null)
 35            {
 036                writer.WritePropertyName("vmAgent");
 037                writer.WriteObjectValue(VmAgent);
 38            }
 039            if (MaintenanceRedeployStatus != null)
 40            {
 041                writer.WritePropertyName("maintenanceRedeployStatus");
 042                writer.WriteObjectValue(MaintenanceRedeployStatus);
 43            }
 044            if (Disks != null)
 45            {
 046                writer.WritePropertyName("disks");
 047                writer.WriteStartArray();
 048                foreach (var item in Disks)
 49                {
 050                    writer.WriteObjectValue(item);
 51                }
 052                writer.WriteEndArray();
 53            }
 054            if (Extensions != null)
 55            {
 056                writer.WritePropertyName("extensions");
 057                writer.WriteStartArray();
 058                foreach (var item in Extensions)
 59                {
 060                    writer.WriteObjectValue(item);
 61                }
 062                writer.WriteEndArray();
 63            }
 064            if (VmHealth != null)
 65            {
 066                writer.WritePropertyName("vmHealth");
 067                writer.WriteObjectValue(VmHealth);
 68            }
 069            if (BootDiagnostics != null)
 70            {
 071                writer.WritePropertyName("bootDiagnostics");
 072                writer.WriteObjectValue(BootDiagnostics);
 73            }
 074            if (Statuses != null)
 75            {
 076                writer.WritePropertyName("statuses");
 077                writer.WriteStartArray();
 078                foreach (var item in Statuses)
 79                {
 080                    writer.WriteObjectValue(item);
 81                }
 082                writer.WriteEndArray();
 83            }
 084            if (PlacementGroupId != null)
 85            {
 086                writer.WritePropertyName("placementGroupId");
 087                writer.WriteStringValue(PlacementGroupId);
 88            }
 089            writer.WriteEndObject();
 090        }
 91
 92        internal static VirtualMachineScaleSetVMInstanceView DeserializeVirtualMachineScaleSetVMInstanceView(JsonElement
 93        {
 2494            int? platformUpdateDomain = default;
 2495            int? platformFaultDomain = default;
 2496            string rdpThumbPrint = default;
 2497            VirtualMachineAgentInstanceView vmAgent = default;
 2498            MaintenanceRedeployStatus maintenanceRedeployStatus = default;
 2499            IList<DiskInstanceView> disks = default;
 24100            IList<VirtualMachineExtensionInstanceView> extensions = default;
 24101            VirtualMachineHealthStatus vmHealth = default;
 24102            BootDiagnosticsInstanceView bootDiagnostics = default;
 24103            IList<InstanceViewStatus> statuses = default;
 24104            string placementGroupId = default;
 576105            foreach (var property in element.EnumerateObject())
 106            {
 264107                if (property.NameEquals("platformUpdateDomain"))
 108                {
 24109                    if (property.Value.ValueKind == JsonValueKind.Null)
 110                    {
 111                        continue;
 112                    }
 24113                    platformUpdateDomain = property.Value.GetInt32();
 24114                    continue;
 115                }
 240116                if (property.NameEquals("platformFaultDomain"))
 117                {
 24118                    if (property.Value.ValueKind == JsonValueKind.Null)
 119                    {
 120                        continue;
 121                    }
 24122                    platformFaultDomain = property.Value.GetInt32();
 24123                    continue;
 124                }
 216125                if (property.NameEquals("rdpThumbPrint"))
 126                {
 0127                    if (property.Value.ValueKind == JsonValueKind.Null)
 128                    {
 129                        continue;
 130                    }
 0131                    rdpThumbPrint = property.Value.GetString();
 0132                    continue;
 133                }
 216134                if (property.NameEquals("vmAgent"))
 135                {
 24136                    if (property.Value.ValueKind == JsonValueKind.Null)
 137                    {
 138                        continue;
 139                    }
 24140                    vmAgent = VirtualMachineAgentInstanceView.DeserializeVirtualMachineAgentInstanceView(property.Value)
 24141                    continue;
 142                }
 192143                if (property.NameEquals("maintenanceRedeployStatus"))
 144                {
 0145                    if (property.Value.ValueKind == JsonValueKind.Null)
 146                    {
 147                        continue;
 148                    }
 0149                    maintenanceRedeployStatus = MaintenanceRedeployStatus.DeserializeMaintenanceRedeployStatus(property.
 0150                    continue;
 151                }
 192152                if (property.NameEquals("disks"))
 153                {
 24154                    if (property.Value.ValueKind == JsonValueKind.Null)
 155                    {
 156                        continue;
 157                    }
 24158                    List<DiskInstanceView> array = new List<DiskInstanceView>();
 120159                    foreach (var item in property.Value.EnumerateArray())
 160                    {
 36161                        if (item.ValueKind == JsonValueKind.Null)
 162                        {
 0163                            array.Add(null);
 164                        }
 165                        else
 166                        {
 36167                            array.Add(DiskInstanceView.DeserializeDiskInstanceView(item));
 168                        }
 169                    }
 24170                    disks = array;
 24171                    continue;
 172                }
 168173                if (property.NameEquals("extensions"))
 174                {
 24175                    if (property.Value.ValueKind == JsonValueKind.Null)
 176                    {
 177                        continue;
 178                    }
 24179                    List<VirtualMachineExtensionInstanceView> array = new List<VirtualMachineExtensionInstanceView>();
 96180                    foreach (var item in property.Value.EnumerateArray())
 181                    {
 24182                        if (item.ValueKind == JsonValueKind.Null)
 183                        {
 0184                            array.Add(null);
 185                        }
 186                        else
 187                        {
 24188                            array.Add(VirtualMachineExtensionInstanceView.DeserializeVirtualMachineExtensionInstanceView
 189                        }
 190                    }
 24191                    extensions = array;
 24192                    continue;
 193                }
 144194                if (property.NameEquals("vmHealth"))
 195                {
 0196                    if (property.Value.ValueKind == JsonValueKind.Null)
 197                    {
 198                        continue;
 199                    }
 0200                    vmHealth = VirtualMachineHealthStatus.DeserializeVirtualMachineHealthStatus(property.Value);
 0201                    continue;
 202                }
 144203                if (property.NameEquals("bootDiagnostics"))
 204                {
 0205                    if (property.Value.ValueKind == JsonValueKind.Null)
 206                    {
 207                        continue;
 208                    }
 0209                    bootDiagnostics = BootDiagnosticsInstanceView.DeserializeBootDiagnosticsInstanceView(property.Value)
 0210                    continue;
 211                }
 144212                if (property.NameEquals("statuses"))
 213                {
 24214                    if (property.Value.ValueKind == JsonValueKind.Null)
 215                    {
 216                        continue;
 217                    }
 24218                    List<InstanceViewStatus> array = new List<InstanceViewStatus>();
 144219                    foreach (var item in property.Value.EnumerateArray())
 220                    {
 48221                        if (item.ValueKind == JsonValueKind.Null)
 222                        {
 0223                            array.Add(null);
 224                        }
 225                        else
 226                        {
 48227                            array.Add(InstanceViewStatus.DeserializeInstanceViewStatus(item));
 228                        }
 229                    }
 24230                    statuses = array;
 24231                    continue;
 232                }
 120233                if (property.NameEquals("placementGroupId"))
 234                {
 24235                    if (property.Value.ValueKind == JsonValueKind.Null)
 236                    {
 237                        continue;
 238                    }
 24239                    placementGroupId = property.Value.GetString();
 240                    continue;
 241                }
 242            }
 24243            return new VirtualMachineScaleSetVMInstanceView(platformUpdateDomain, platformFaultDomain, rdpThumbPrint, vm
 244        }
 245    }
 246}