< Summary

Class:Azure.ResourceManager.Compute.Models.ManagedDiskParameters
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ManagedDiskParameters.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ManagedDiskParameters.Serialization.cs
Covered lines:29
Uncovered lines:7
Coverable lines:36
Total lines:107
Line coverage:80.5% (29 of 36)
Covered branches:16
Total branches:20
Branch coverage:80% (16 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_StorageAccountType()-100%100%
get_DiskEncryptionSet()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-66.67%66.67%
DeserializeManagedDiskParameters(...)-81.25%85.71%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ManagedDiskParameters.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 parameters of a managed disk. </summary>
 11    public partial class ManagedDiskParameters : SubResource
 12    {
 13        /// <summary> Initializes a new instance of ManagedDiskParameters. </summary>
 3214        public ManagedDiskParameters()
 15        {
 3216        }
 17
 18        /// <summary> Initializes a new instance of ManagedDiskParameters. </summary>
 19        /// <param name="id"> Resource Id. </param>
 20        /// <param name="storageAccountType"> Specifies the storage account type for the managed disk. NOTE: UltraSSD_LR
 21        /// <param name="diskEncryptionSet"> Specifies the customer managed disk encryption set resource id for the mana
 26422        internal ManagedDiskParameters(string id, StorageAccountTypes? storageAccountType, SubResource diskEncryptionSet
 23        {
 26424            StorageAccountType = storageAccountType;
 26425            DiskEncryptionSet = diskEncryptionSet;
 26426        }
 27
 28        /// <summary> Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with 
 67629        public StorageAccountTypes? StorageAccountType { get; set; }
 30        /// <summary> Specifies the customer managed disk encryption set resource id for the managed disk. </summary>
 36031        public SubResource DiskEncryptionSet { get; set; }
 32    }
 33}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ManagedDiskParameters.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 ManagedDiskParameters : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 6417            writer.WriteStartObject();
 6418            if (StorageAccountType != null)
 19            {
 6420                writer.WritePropertyName("storageAccountType");
 6421                writer.WriteStringValue(StorageAccountType.Value.ToString());
 22            }
 6423            if (DiskEncryptionSet != null)
 24            {
 025                writer.WritePropertyName("diskEncryptionSet");
 026                writer.WriteObjectValue(DiskEncryptionSet);
 27            }
 6428            if (Id != null)
 29            {
 030                writer.WritePropertyName("id");
 031                writer.WriteStringValue(Id);
 32            }
 6433            writer.WriteEndObject();
 6434        }
 35
 36        internal static ManagedDiskParameters DeserializeManagedDiskParameters(JsonElement element)
 37        {
 26438            StorageAccountTypes? storageAccountType = default;
 26439            SubResource diskEncryptionSet = default;
 26440            string id = default;
 158441            foreach (var property in element.EnumerateObject())
 42            {
 52843                if (property.NameEquals("storageAccountType"))
 44                {
 26445                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 26449                    storageAccountType = new StorageAccountTypes(property.Value.GetString());
 26450                    continue;
 51                }
 26452                if (property.NameEquals("diskEncryptionSet"))
 53                {
 054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 058                    diskEncryptionSet = DeserializeSubResource(property.Value);
 059                    continue;
 60                }
 26461                if (property.NameEquals("id"))
 62                {
 26463                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 26467                    id = property.Value.GetString();
 68                    continue;
 69                }
 70            }
 26471            return new ManagedDiskParameters(id, storageAccountType, diskEncryptionSet);
 72        }
 73    }
 74}