< Summary

Class:Azure.ResourceManager.KeyVault.Models.VaultAccessPolicyProperties
Assembly:Azure.ResourceManager.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\VaultAccessPolicyProperties.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\VaultAccessPolicyProperties.Serialization.cs
Covered lines:0
Uncovered lines:25
Coverable lines:25
Total lines:88
Line coverage:0% (0 of 25)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_AccessPolicies()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVaultAccessPolicyProperties(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\VaultAccessPolicyProperties.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.Collections.Generic;
 10using System.Linq;
 11
 12namespace Azure.ResourceManager.KeyVault.Models
 13{
 14    /// <summary> Properties of the vault access policy. </summary>
 15    public partial class VaultAccessPolicyProperties
 16    {
 17        /// <summary> Initializes a new instance of VaultAccessPolicyProperties. </summary>
 18        /// <param name="accessPolicies"> An array of 0 to 16 identities that have access to the key vault. All identiti
 19        /// <exception cref="ArgumentNullException"> <paramref name="accessPolicies"/> is null. </exception>
 020        public VaultAccessPolicyProperties(IEnumerable<AccessPolicyEntry> accessPolicies)
 21        {
 022            if (accessPolicies == null)
 23            {
 024                throw new ArgumentNullException(nameof(accessPolicies));
 25            }
 26
 027            AccessPolicies = accessPolicies.ToList();
 028        }
 29
 30        /// <summary> Initializes a new instance of VaultAccessPolicyProperties. </summary>
 31        /// <param name="accessPolicies"> An array of 0 to 16 identities that have access to the key vault. All identiti
 032        internal VaultAccessPolicyProperties(IList<AccessPolicyEntry> accessPolicies)
 33        {
 034            AccessPolicies = accessPolicies;
 035        }
 36
 37        /// <summary> An array of 0 to 16 identities that have access to the key vault. All identities in the array must
 038        public IList<AccessPolicyEntry> AccessPolicies { get; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\VaultAccessPolicyProperties.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.ResourceManager.KeyVault.Models
 13{
 14    public partial class VaultAccessPolicyProperties : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("accessPolicies");
 020            writer.WriteStartArray();
 021            foreach (var item in AccessPolicies)
 22            {
 023                writer.WriteObjectValue(item);
 24            }
 025            writer.WriteEndArray();
 026            writer.WriteEndObject();
 027        }
 28
 29        internal static VaultAccessPolicyProperties DeserializeVaultAccessPolicyProperties(JsonElement element)
 30        {
 031            IList<AccessPolicyEntry> accessPolicies = default;
 032            foreach (var property in element.EnumerateObject())
 33            {
 034                if (property.NameEquals("accessPolicies"))
 35                {
 036                    List<AccessPolicyEntry> array = new List<AccessPolicyEntry>();
 037                    foreach (var item in property.Value.EnumerateArray())
 38                    {
 039                        array.Add(AccessPolicyEntry.DeserializeAccessPolicyEntry(item));
 40                    }
 041                    accessPolicies = array;
 42                    continue;
 43                }
 44            }
 045            return new VaultAccessPolicyProperties(accessPolicies);
 46        }
 47    }
 48}