< Summary

Class:Azure.Security.KeyVault.Administration.Models.KeyVaultPermission
Assembly:Azure.Security.KeyVault.Administration
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\KeyVaultPermission.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\KeyVaultPermission.Serialization.cs
Covered lines:29
Uncovered lines:16
Coverable lines:45
Total lines:115
Line coverage:64.4% (29 of 45)
Covered branches:15
Total branches:18
Branch coverage:83.3% (15 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Actions()-0%100%
get_NotActions()-0%100%
get_DataActions()-0%100%
get_NotDataActions()-0%100%
DeserializeKeyVaultPermission(...)-79.31%83.33%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\KeyVaultPermission.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.Collections.Generic;
 9using Azure.Core;
 10
 11namespace Azure.Security.KeyVault.Administration.Models
 12{
 13    /// <summary> Role definition permissions. </summary>
 14    public partial class KeyVaultPermission
 15    {
 16        /// <summary> Initializes a new instance of KeyVaultPermission. </summary>
 017        internal KeyVaultPermission()
 18        {
 019            Actions = new ChangeTrackingList<string>();
 020            NotActions = new ChangeTrackingList<string>();
 021            DataActions = new ChangeTrackingList<string>();
 022            NotDataActions = new ChangeTrackingList<string>();
 023        }
 24
 25        /// <summary> Initializes a new instance of KeyVaultPermission. </summary>
 26        /// <param name="actions"> Allowed actions. </param>
 27        /// <param name="notActions"> Denied actions. </param>
 28        /// <param name="dataActions"> Allowed Data actions. </param>
 29        /// <param name="notDataActions"> Denied Data actions. </param>
 20430        internal KeyVaultPermission(IReadOnlyList<string> actions, IReadOnlyList<string> notActions, IReadOnlyList<strin
 31        {
 20432            Actions = actions;
 20433            NotActions = notActions;
 20434            DataActions = dataActions;
 20435            NotDataActions = notDataActions;
 20436        }
 37
 38        /// <summary> Allowed actions. </summary>
 039        public IReadOnlyList<string> Actions { get; }
 40        /// <summary> Denied actions. </summary>
 041        public IReadOnlyList<string> NotActions { get; }
 42        /// <summary> Allowed Data actions. </summary>
 043        public IReadOnlyList<string> DataActions { get; }
 44        /// <summary> Denied Data actions. </summary>
 045        public IReadOnlyList<string> NotDataActions { get; }
 46    }
 47}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\KeyVaultPermission.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Security.KeyVault.Administration.Models
 13{
 14    public partial class KeyVaultPermission
 15    {
 16        internal static KeyVaultPermission DeserializeKeyVaultPermission(JsonElement element)
 17        {
 20418            Optional<IReadOnlyList<string>> actions = default;
 20419            Optional<IReadOnlyList<string>> notActions = default;
 20420            Optional<IReadOnlyList<string>> dataActions = default;
 20421            Optional<IReadOnlyList<string>> notDataActions = default;
 204022            foreach (var property in element.EnumerateObject())
 23            {
 81624                if (property.NameEquals("actions"))
 25                {
 20426                    List<string> array = new List<string>();
 027                    foreach (var item in property.Value.EnumerateArray())
 28                    {
 029                        array.Add(item.GetString());
 30                    }
 20431                    actions = array;
 20432                    continue;
 33                }
 61234                if (property.NameEquals("notActions"))
 35                {
 20436                    List<string> array = new List<string>();
 037                    foreach (var item in property.Value.EnumerateArray())
 38                    {
 039                        array.Add(item.GetString());
 40                    }
 20441                    notActions = array;
 20442                    continue;
 43                }
 40844                if (property.NameEquals("dataActions"))
 45                {
 20446                    List<string> array = new List<string>();
 428447                    foreach (var item in property.Value.EnumerateArray())
 48                    {
 193849                        array.Add(item.GetString());
 50                    }
 20451                    dataActions = array;
 20452                    continue;
 53                }
 20454                if (property.NameEquals("notDataActions"))
 55                {
 20456                    List<string> array = new List<string>();
 057                    foreach (var item in property.Value.EnumerateArray())
 58                    {
 059                        array.Add(item.GetString());
 60                    }
 20461                    notDataActions = array;
 62                    continue;
 63                }
 64            }
 20465            return new KeyVaultPermission(Optional.ToList(actions), Optional.ToList(notActions), Optional.ToList(dataAct
 66        }
 67    }
 68}