< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
get_KeyUrl()-0%100%
get_SourceVault()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeKeyVaultKeyReference(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\KeyVaultKeyReference.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;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    /// <summary> Describes a reference to Key Vault Key. </summary>
 13    public partial class KeyVaultKeyReference
 14    {
 15        /// <summary> Initializes a new instance of KeyVaultKeyReference. </summary>
 16        /// <param name="keyUrl"> The URL referencing a key encryption key in Key Vault. </param>
 17        /// <param name="sourceVault"> The relative URL of the Key Vault containing the key. </param>
 018        public KeyVaultKeyReference(string keyUrl, SubResource sourceVault)
 19        {
 020            if (keyUrl == null)
 21            {
 022                throw new ArgumentNullException(nameof(keyUrl));
 23            }
 024            if (sourceVault == null)
 25            {
 026                throw new ArgumentNullException(nameof(sourceVault));
 27            }
 28
 029            KeyUrl = keyUrl;
 030            SourceVault = sourceVault;
 031        }
 32
 33        /// <summary> The URL referencing a key encryption key in Key Vault. </summary>
 034        public string KeyUrl { get; set; }
 35        /// <summary> The relative URL of the Key Vault containing the key. </summary>
 036        public SubResource SourceVault { get; set; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\KeyVaultKeyReference.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 KeyVaultKeyReference : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("keyUrl");
 019            writer.WriteStringValue(KeyUrl);
 020            writer.WritePropertyName("sourceVault");
 021            writer.WriteObjectValue(SourceVault);
 022            writer.WriteEndObject();
 023        }
 24
 25        internal static KeyVaultKeyReference DeserializeKeyVaultKeyReference(JsonElement element)
 26        {
 027            string keyUrl = default;
 028            SubResource sourceVault = default;
 029            foreach (var property in element.EnumerateObject())
 30            {
 031                if (property.NameEquals("keyUrl"))
 32                {
 033                    keyUrl = property.Value.GetString();
 034                    continue;
 35                }
 036                if (property.NameEquals("sourceVault"))
 37                {
 038                    sourceVault = SubResource.DeserializeSubResource(property.Value);
 39                    continue;
 40                }
 41            }
 042            return new KeyVaultKeyReference(keyUrl, sourceVault);
 43        }
 44    }
 45}