< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Id()-0%100%
get_Name()-0%100%
get_Type()-0%100%
get_Location()-0%100%
get_Properties()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeVaultAccessPolicyParameters(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\VaultAccessPolicyParameters.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.KeyVault.Models
 11{
 12    /// <summary> Parameters for updating the access policy in a vault. </summary>
 13    public partial class VaultAccessPolicyParameters
 14    {
 15        /// <summary> Initializes a new instance of VaultAccessPolicyParameters. </summary>
 16        /// <param name="properties"> Properties of the access policy. </param>
 17        /// <exception cref="ArgumentNullException"> <paramref name="properties"/> is null. </exception>
 018        public VaultAccessPolicyParameters(VaultAccessPolicyProperties properties)
 19        {
 020            if (properties == null)
 21            {
 022                throw new ArgumentNullException(nameof(properties));
 23            }
 24
 025            Properties = properties;
 026        }
 27
 28        /// <summary> Initializes a new instance of VaultAccessPolicyParameters. </summary>
 29        /// <param name="id"> The resource id of the access policy. </param>
 30        /// <param name="name"> The resource name of the access policy. </param>
 31        /// <param name="type"> The resource name of the access policy. </param>
 32        /// <param name="location"> The resource type of the access policy. </param>
 33        /// <param name="properties"> Properties of the access policy. </param>
 034        internal VaultAccessPolicyParameters(string id, string name, string type, string location, VaultAccessPolicyProp
 35        {
 036            Id = id;
 037            Name = name;
 038            Type = type;
 039            Location = location;
 040            Properties = properties;
 041        }
 42
 43        /// <summary> The resource id of the access policy. </summary>
 044        public string Id { get; }
 45        /// <summary> The resource name of the access policy. </summary>
 046        public string Name { get; }
 47        /// <summary> The resource name of the access policy. </summary>
 048        public string Type { get; }
 49        /// <summary> The resource type of the access policy. </summary>
 050        public string Location { get; }
 51        /// <summary> Properties of the access policy. </summary>
 052        public VaultAccessPolicyProperties Properties { get; set; }
 53    }
 54}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\VaultAccessPolicyParameters.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.KeyVault.Models
 12{
 13    public partial class VaultAccessPolicyParameters : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("properties");
 019            writer.WriteObjectValue(Properties);
 020            writer.WriteEndObject();
 021        }
 22
 23        internal static VaultAccessPolicyParameters DeserializeVaultAccessPolicyParameters(JsonElement element)
 24        {
 025            Optional<string> id = default;
 026            Optional<string> name = default;
 027            Optional<string> type = default;
 028            Optional<string> location = default;
 029            VaultAccessPolicyProperties properties = default;
 030            foreach (var property in element.EnumerateObject())
 31            {
 032                if (property.NameEquals("id"))
 33                {
 034                    id = property.Value.GetString();
 035                    continue;
 36                }
 037                if (property.NameEquals("name"))
 38                {
 039                    name = property.Value.GetString();
 040                    continue;
 41                }
 042                if (property.NameEquals("type"))
 43                {
 044                    type = property.Value.GetString();
 045                    continue;
 46                }
 047                if (property.NameEquals("location"))
 48                {
 049                    location = property.Value.GetString();
 050                    continue;
 51                }
 052                if (property.NameEquals("properties"))
 53                {
 054                    properties = VaultAccessPolicyProperties.DeserializeVaultAccessPolicyProperties(property.Value);
 55                    continue;
 56                }
 57            }
 058            return new VaultAccessPolicyParameters(id.Value, name.Value, type.Value, location.Value, properties);
 59        }
 60    }
 61}