< Summary

Class:Azure.ResourceManager.Compute.Models.DiskEncryptionSettings
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiskEncryptionSettings.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiskEncryptionSettings.Serialization.cs
Covered lines:0
Uncovered lines:38
Coverable lines:38
Total lines:110
Line coverage:0% (0 of 38)
Covered branches:0
Total branches:20
Branch coverage:0% (0 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_DiskEncryptionKey()-0%100%
get_KeyEncryptionKey()-0%100%
get_Enabled()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeDiskEncryptionSettings(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiskEncryptionSettings.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 Encryption Settings for a Disk. </summary>
 11    public partial class DiskEncryptionSettings
 12    {
 13        /// <summary> Initializes a new instance of DiskEncryptionSettings. </summary>
 014        public DiskEncryptionSettings()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of DiskEncryptionSettings. </summary>
 19        /// <param name="diskEncryptionKey"> Specifies the location of the disk encryption key, which is a Key Vault Sec
 20        /// <param name="keyEncryptionKey"> Specifies the location of the key encryption key in Key Vault. </param>
 21        /// <param name="enabled"> Specifies whether disk encryption should be enabled on the virtual machine. </param>
 022        internal DiskEncryptionSettings(KeyVaultSecretReference diskEncryptionKey, KeyVaultKeyReference keyEncryptionKey
 23        {
 024            DiskEncryptionKey = diskEncryptionKey;
 025            KeyEncryptionKey = keyEncryptionKey;
 026            Enabled = enabled;
 027        }
 28
 29        /// <summary> Specifies the location of the disk encryption key, which is a Key Vault Secret. </summary>
 030        public KeyVaultSecretReference DiskEncryptionKey { get; set; }
 31        /// <summary> Specifies the location of the key encryption key in Key Vault. </summary>
 032        public KeyVaultKeyReference KeyEncryptionKey { get; set; }
 33        /// <summary> Specifies whether disk encryption should be enabled on the virtual machine. </summary>
 034        public bool? Enabled { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiskEncryptionSettings.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 DiskEncryptionSettings : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (DiskEncryptionKey != null)
 19            {
 020                writer.WritePropertyName("diskEncryptionKey");
 021                writer.WriteObjectValue(DiskEncryptionKey);
 22            }
 023            if (KeyEncryptionKey != null)
 24            {
 025                writer.WritePropertyName("keyEncryptionKey");
 026                writer.WriteObjectValue(KeyEncryptionKey);
 27            }
 028            if (Enabled != null)
 29            {
 030                writer.WritePropertyName("enabled");
 031                writer.WriteBooleanValue(Enabled.Value);
 32            }
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static DiskEncryptionSettings DeserializeDiskEncryptionSettings(JsonElement element)
 37        {
 038            KeyVaultSecretReference diskEncryptionKey = default;
 039            KeyVaultKeyReference keyEncryptionKey = default;
 040            bool? enabled = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("diskEncryptionKey"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    diskEncryptionKey = KeyVaultSecretReference.DeserializeKeyVaultSecretReference(property.Value);
 050                    continue;
 51                }
 052                if (property.NameEquals("keyEncryptionKey"))
 53                {
 054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 058                    keyEncryptionKey = KeyVaultKeyReference.DeserializeKeyVaultKeyReference(property.Value);
 059                    continue;
 60                }
 061                if (property.NameEquals("enabled"))
 62                {
 063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 067                    enabled = property.Value.GetBoolean();
 68                    continue;
 69                }
 70            }
 071            return new DiskEncryptionSettings(diskEncryptionKey, keyEncryptionKey, enabled);
 72        }
 73    }
 74}