< Summary

Class:Azure.ResourceManager.Storage.Models.StorageAccountKey
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\StorageAccountKey.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\StorageAccountKey.Serialization.cs
Covered lines:24
Uncovered lines:2
Coverable lines:26
Total lines:89
Line coverage:92.3% (24 of 26)
Covered branches:14
Total branches:14
Branch coverage:100% (14 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_KeyName()-100%100%
get_Value()-100%100%
get_Permissions()-100%100%
DeserializeStorageAccountKey(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\StorageAccountKey.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.Storage.Models
 9{
 10    /// <summary> An access key for the storage account. </summary>
 11    public partial class StorageAccountKey
 12    {
 13        /// <summary> Initializes a new instance of StorageAccountKey. </summary>
 014        internal StorageAccountKey()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of StorageAccountKey. </summary>
 19        /// <param name="keyName"> Name of the key. </param>
 20        /// <param name="value"> Base 64-encoded value of the key. </param>
 21        /// <param name="permissions"> Permissions for the key -- read-only or full permissions. </param>
 2422        internal StorageAccountKey(string keyName, string value, KeyPermission? permissions)
 23        {
 2424            KeyName = keyName;
 2425            Value = value;
 2426            Permissions = permissions;
 2427        }
 28
 29        /// <summary> Name of the key. </summary>
 2830        public string KeyName { get; }
 31        /// <summary> Base 64-encoded value of the key. </summary>
 1632        public string Value { get; }
 33        /// <summary> Permissions for the key -- read-only or full permissions. </summary>
 834        public KeyPermission? Permissions { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\StorageAccountKey.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.Storage.Models
 12{
 13    public partial class StorageAccountKey
 14    {
 15        internal static StorageAccountKey DeserializeStorageAccountKey(JsonElement element)
 16        {
 2417            string keyName = default;
 2418            string value = default;
 2419            KeyPermission? permissions = default;
 19220            foreach (var property in element.EnumerateObject())
 21            {
 7222                if (property.NameEquals("keyName"))
 23                {
 2424                    if (property.Value.ValueKind == JsonValueKind.Null)
 25                    {
 26                        continue;
 27                    }
 2428                    keyName = property.Value.GetString();
 2429                    continue;
 30                }
 4831                if (property.NameEquals("value"))
 32                {
 2433                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 2437                    value = property.Value.GetString();
 2438                    continue;
 39                }
 2440                if (property.NameEquals("permissions"))
 41                {
 2442                    if (property.Value.ValueKind == JsonValueKind.Null)
 43                    {
 44                        continue;
 45                    }
 2446                    permissions = property.Value.GetString().ToKeyPermission();
 47                    continue;
 48                }
 49            }
 2450            return new StorageAccountKey(keyName, value, permissions);
 51        }
 52    }
 53}