< Summary

Class:Azure.ResourceManager.Storage.Models.KeyVaultProperties
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\KeyVaultProperties.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\KeyVaultProperties.Serialization.cs
Covered lines:33
Uncovered lines:25
Coverable lines:58
Total lines:151
Line coverage:56.8% (33 of 58)
Covered branches:22
Total branches:32
Branch coverage:68.7% (22 of 32)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_KeyName()-0%100%
get_KeyVersion()-0%100%
get_KeyVaultUri()-0%100%
get_CurrentVersionedKeyIdentifier()-0%100%
get_LastKeyRotationTimestamp()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeKeyVaultProperties(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\KeyVaultProperties.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.Storage.Models
 11{
 12    /// <summary> Properties of key vault. </summary>
 13    public partial class KeyVaultProperties
 14    {
 15        /// <summary> Initializes a new instance of KeyVaultProperties. </summary>
 016        public KeyVaultProperties()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of KeyVaultProperties. </summary>
 21        /// <param name="keyName"> The name of KeyVault key. </param>
 22        /// <param name="keyVersion"> The version of KeyVault key. </param>
 23        /// <param name="keyVaultUri"> The Uri of KeyVault. </param>
 24        /// <param name="currentVersionedKeyIdentifier"> The object identifier of the current versioned Key Vault Key in
 25        /// <param name="lastKeyRotationTimestamp"> Timestamp of last rotation of the Key Vault Key. </param>
 826        internal KeyVaultProperties(string keyName, string keyVersion, string keyVaultUri, string currentVersionedKeyIde
 27        {
 828            KeyName = keyName;
 829            KeyVersion = keyVersion;
 830            KeyVaultUri = keyVaultUri;
 831            CurrentVersionedKeyIdentifier = currentVersionedKeyIdentifier;
 832            LastKeyRotationTimestamp = lastKeyRotationTimestamp;
 833        }
 34
 35        /// <summary> The name of KeyVault key. </summary>
 036        public string KeyName { get; set; }
 37        /// <summary> The version of KeyVault key. </summary>
 038        public string KeyVersion { get; set; }
 39        /// <summary> The Uri of KeyVault. </summary>
 040        public string KeyVaultUri { get; set; }
 41        /// <summary> The object identifier of the current versioned Key Vault Key in use. </summary>
 042        public string CurrentVersionedKeyIdentifier { get; }
 43        /// <summary> Timestamp of last rotation of the Key Vault Key. </summary>
 044        public DateTimeOffset? LastKeyRotationTimestamp { get; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\KeyVaultProperties.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;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Storage.Models
 13{
 14    public partial class KeyVaultProperties : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (KeyName != null)
 20            {
 021                writer.WritePropertyName("keyname");
 022                writer.WriteStringValue(KeyName);
 23            }
 024            if (KeyVersion != null)
 25            {
 026                writer.WritePropertyName("keyversion");
 027                writer.WriteStringValue(KeyVersion);
 28            }
 029            if (KeyVaultUri != null)
 30            {
 031                writer.WritePropertyName("keyvaulturi");
 032                writer.WriteStringValue(KeyVaultUri);
 33            }
 034            if (CurrentVersionedKeyIdentifier != null)
 35            {
 036                writer.WritePropertyName("currentVersionedKeyIdentifier");
 037                writer.WriteStringValue(CurrentVersionedKeyIdentifier);
 38            }
 039            if (LastKeyRotationTimestamp != null)
 40            {
 041                writer.WritePropertyName("lastKeyRotationTimestamp");
 042                writer.WriteStringValue(LastKeyRotationTimestamp.Value, "O");
 43            }
 044            writer.WriteEndObject();
 045        }
 46
 47        internal static KeyVaultProperties DeserializeKeyVaultProperties(JsonElement element)
 48        {
 849            string keyname = default;
 850            string keyversion = default;
 851            string keyvaulturi = default;
 852            string currentVersionedKeyIdentifier = default;
 853            DateTimeOffset? lastKeyRotationTimestamp = default;
 8854            foreach (var property in element.EnumerateObject())
 55            {
 3656                if (property.NameEquals("keyname"))
 57                {
 858                    if (property.Value.ValueKind == JsonValueKind.Null)
 59                    {
 60                        continue;
 61                    }
 862                    keyname = property.Value.GetString();
 863                    continue;
 64                }
 2865                if (property.NameEquals("keyversion"))
 66                {
 867                    if (property.Value.ValueKind == JsonValueKind.Null)
 68                    {
 69                        continue;
 70                    }
 871                    keyversion = property.Value.GetString();
 872                    continue;
 73                }
 2074                if (property.NameEquals("keyvaulturi"))
 75                {
 876                    if (property.Value.ValueKind == JsonValueKind.Null)
 77                    {
 78                        continue;
 79                    }
 880                    keyvaulturi = property.Value.GetString();
 881                    continue;
 82                }
 1283                if (property.NameEquals("currentVersionedKeyIdentifier"))
 84                {
 485                    if (property.Value.ValueKind == JsonValueKind.Null)
 86                    {
 87                        continue;
 88                    }
 489                    currentVersionedKeyIdentifier = property.Value.GetString();
 490                    continue;
 91                }
 892                if (property.NameEquals("lastKeyRotationTimestamp"))
 93                {
 494                    if (property.Value.ValueKind == JsonValueKind.Null)
 95                    {
 96                        continue;
 97                    }
 498                    lastKeyRotationTimestamp = property.Value.GetDateTimeOffset("O");
 99                    continue;
 100                }
 101            }
 8102            return new KeyVaultProperties(keyname, keyversion, keyvaulturi, currentVersionedKeyIdentifier, lastKeyRotati
 103        }
 104    }
 105}