< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetDataDisk
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetDataDisk.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetDataDisk.Serialization.cs
Covered lines:80
Uncovered lines:16
Coverable lines:96
Total lines:214
Line coverage:83.3% (80 of 96)
Covered branches:39
Total branches:48
Branch coverage:81.2% (39 of 48)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Lun()-100%100%
get_Caching()-100%100%
get_WriteAcceleratorEnabled()-100%100%
get_CreateOption()-100%100%
get_DiskSizeGB()-100%100%
get_ManagedDisk()-100%100%
get_DiskIopsReadWrite()-100%100%
get_DiskMBpsReadWrite()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-64.29%64.29%
DeserializeVirtualMachineScaleSetDataDisk(...)-86.36%88.24%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetDataDisk.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> Describes a virtual machine scale set data disk. </summary>
 11    public partial class VirtualMachineScaleSetDataDisk
 12    {
 13        /// <summary> Initializes a new instance of VirtualMachineScaleSetDataDisk. </summary>
 14        /// <param name="lun"> Specifies the logical unit number of the data disk. This value is used to identify data d
 15        /// <param name="createOption"> The create option. </param>
 10816        public VirtualMachineScaleSetDataDisk(int lun, DiskCreateOptionTypes createOption)
 17        {
 10818            Lun = lun;
 10819            CreateOption = createOption;
 10820        }
 21
 22        /// <summary> Initializes a new instance of VirtualMachineScaleSetDataDisk. </summary>
 23        /// <param name="name"> The disk name. </param>
 24        /// <param name="lun"> Specifies the logical unit number of the data disk. This value is used to identify data d
 25        /// <param name="caching"> Specifies the caching requirements. &lt;br&gt;&lt;br&gt; Possible values are: &lt;br&
 26        /// <param name="writeAcceleratorEnabled"> Specifies whether writeAccelerator should be enabled or disabled on t
 27        /// <param name="createOption"> The create option. </param>
 28        /// <param name="diskSizeGB"> Specifies the size of an empty data disk in gigabytes. This element can be used to
 29        /// <param name="managedDisk"> The managed disk parameters. </param>
 30        /// <param name="diskIopsReadWrite"> Specifies the Read-Write IOPS for the managed disk. Should be used only whe
 31        /// <param name="diskMBpsReadWrite"> Specifies the bandwidth in MB per second for the managed disk. Should be us
 30032        internal VirtualMachineScaleSetDataDisk(string name, int lun, CachingTypes? caching, bool? writeAcceleratorEnabl
 33        {
 30034            Name = name;
 30035            Lun = lun;
 30036            Caching = caching;
 30037            WriteAcceleratorEnabled = writeAcceleratorEnabled;
 30038            CreateOption = createOption;
 30039            DiskSizeGB = diskSizeGB;
 30040            ManagedDisk = managedDisk;
 30041            DiskIopsReadWrite = diskIopsReadWrite;
 30042            DiskMBpsReadWrite = diskMBpsReadWrite;
 30043        }
 44
 45        /// <summary> The disk name. </summary>
 76446        public string Name { get; set; }
 47        /// <summary> Specifies the logical unit number of the data disk. This value is used to identify data disks with
 111648        public int Lun { get; set; }
 49        /// <summary> Specifies the caching requirements. &lt;br&gt;&lt;br&gt; Possible values are: &lt;br&gt;&lt;br&gt;
 98050        public CachingTypes? Caching { get; set; }
 51        /// <summary> Specifies whether writeAccelerator should be enabled or disabled on the disk. </summary>
 54852        public bool? WriteAcceleratorEnabled { get; set; }
 53        /// <summary> The create option. </summary>
 111654        public DiskCreateOptionTypes CreateOption { get; set; }
 55        /// <summary> Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the s
 93256        public int? DiskSizeGB { get; set; }
 57        /// <summary> The managed disk parameters. </summary>
 113258        public VirtualMachineScaleSetManagedDiskParameters ManagedDisk { get; set; }
 59        /// <summary> Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is
 54860        public long? DiskIopsReadWrite { get; set; }
 61        /// <summary> Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAcc
 54862        public long? DiskMBpsReadWrite { get; set; }
 63    }
 64}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetDataDisk.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 VirtualMachineScaleSetDataDisk : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 24817            writer.WriteStartObject();
 24818            if (Name != null)
 19            {
 020                writer.WritePropertyName("name");
 021                writer.WriteStringValue(Name);
 22            }
 24823            writer.WritePropertyName("lun");
 24824            writer.WriteNumberValue(Lun);
 24825            if (Caching != null)
 26            {
 027                writer.WritePropertyName("caching");
 028                writer.WriteStringValue(Caching.Value.ToSerialString());
 29            }
 24830            if (WriteAcceleratorEnabled != null)
 31            {
 032                writer.WritePropertyName("writeAcceleratorEnabled");
 033                writer.WriteBooleanValue(WriteAcceleratorEnabled.Value);
 34            }
 24835            writer.WritePropertyName("createOption");
 24836            writer.WriteStringValue(CreateOption.ToString());
 24837            if (DiskSizeGB != null)
 38            {
 24839                writer.WritePropertyName("diskSizeGB");
 24840                writer.WriteNumberValue(DiskSizeGB.Value);
 41            }
 24842            if (ManagedDisk != null)
 43            {
 844                writer.WritePropertyName("managedDisk");
 845                writer.WriteObjectValue(ManagedDisk);
 46            }
 24847            if (DiskIopsReadWrite != null)
 48            {
 049                writer.WritePropertyName("diskIOPSReadWrite");
 050                writer.WriteNumberValue(DiskIopsReadWrite.Value);
 51            }
 24852            if (DiskMBpsReadWrite != null)
 53            {
 054                writer.WritePropertyName("diskMBpsReadWrite");
 055                writer.WriteNumberValue(DiskMBpsReadWrite.Value);
 56            }
 24857            writer.WriteEndObject();
 24858        }
 59
 60        internal static VirtualMachineScaleSetDataDisk DeserializeVirtualMachineScaleSetDataDisk(JsonElement element)
 61        {
 30062            string name = default;
 30063            int lun = default;
 30064            CachingTypes? caching = default;
 30065            bool? writeAcceleratorEnabled = default;
 30066            DiskCreateOptionTypes createOption = default;
 30067            int? diskSizeGB = default;
 30068            VirtualMachineScaleSetManagedDiskParameters managedDisk = default;
 30069            long? diskIOPSReadWrite = default;
 30070            long? diskMBpsReadWrite = default;
 364871            foreach (var property in element.EnumerateObject())
 72            {
 152473                if (property.NameEquals("name"))
 74                {
 075                    if (property.Value.ValueKind == JsonValueKind.Null)
 76                    {
 77                        continue;
 78                    }
 079                    name = property.Value.GetString();
 080                    continue;
 81                }
 152482                if (property.NameEquals("lun"))
 83                {
 30084                    lun = property.Value.GetInt32();
 30085                    continue;
 86                }
 122487                if (property.NameEquals("caching"))
 88                {
 30089                    if (property.Value.ValueKind == JsonValueKind.Null)
 90                    {
 91                        continue;
 92                    }
 30093                    caching = property.Value.GetString().ToCachingTypes();
 30094                    continue;
 95                }
 92496                if (property.NameEquals("writeAcceleratorEnabled"))
 97                {
 098                    if (property.Value.ValueKind == JsonValueKind.Null)
 99                    {
 100                        continue;
 101                    }
 0102                    writeAcceleratorEnabled = property.Value.GetBoolean();
 0103                    continue;
 104                }
 924105                if (property.NameEquals("createOption"))
 106                {
 300107                    createOption = new DiskCreateOptionTypes(property.Value.GetString());
 300108                    continue;
 109                }
 624110                if (property.NameEquals("diskSizeGB"))
 111                {
 300112                    if (property.Value.ValueKind == JsonValueKind.Null)
 113                    {
 114                        continue;
 115                    }
 300116                    diskSizeGB = property.Value.GetInt32();
 300117                    continue;
 118                }
 324119                if (property.NameEquals("managedDisk"))
 120                {
 300121                    if (property.Value.ValueKind == JsonValueKind.Null)
 122                    {
 123                        continue;
 124                    }
 300125                    managedDisk = VirtualMachineScaleSetManagedDiskParameters.DeserializeVirtualMachineScaleSetManagedDi
 300126                    continue;
 127                }
 24128                if (property.NameEquals("diskIOPSReadWrite"))
 129                {
 12130                    if (property.Value.ValueKind == JsonValueKind.Null)
 131                    {
 132                        continue;
 133                    }
 12134                    diskIOPSReadWrite = property.Value.GetInt64();
 12135                    continue;
 136                }
 12137                if (property.NameEquals("diskMBpsReadWrite"))
 138                {
 12139                    if (property.Value.ValueKind == JsonValueKind.Null)
 140                    {
 141                        continue;
 142                    }
 12143                    diskMBpsReadWrite = property.Value.GetInt64();
 144                    continue;
 145                }
 146            }
 300147            return new VirtualMachineScaleSetDataDisk(name, lun, caching, writeAcceleratorEnabled, createOption, diskSiz
 148        }
 149    }
 150}