< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_GroupId()-0%100%
get_RequiredMembers()-0%100%
get_RequiredZoneNames()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializePrivateLinkResource(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\PrivateLinkResource.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.ResourceManager.KeyVault.Models
 12{
 13    /// <summary> A private link resource. </summary>
 14    public partial class PrivateLinkResource : Resource
 15    {
 16        /// <summary> Initializes a new instance of PrivateLinkResource. </summary>
 017        public PrivateLinkResource()
 18        {
 019            RequiredMembers = new ChangeTrackingList<string>();
 020            RequiredZoneNames = new ChangeTrackingList<string>();
 021        }
 22
 23        /// <summary> Initializes a new instance of PrivateLinkResource. </summary>
 24        /// <param name="id"> Fully qualified identifier of the key vault resource. </param>
 25        /// <param name="name"> Name of the key vault resource. </param>
 26        /// <param name="type"> Resource type of the key vault resource. </param>
 27        /// <param name="location"> Azure location of the key vault resource. </param>
 28        /// <param name="tags"> Tags assigned to the key vault resource. </param>
 29        /// <param name="groupId"> Group identifier of private link resource. </param>
 30        /// <param name="requiredMembers"> Required member names of private link resource. </param>
 31        /// <param name="requiredZoneNames"> Required DNS zone names of the the private link resource. </param>
 032        internal PrivateLinkResource(string id, string name, string type, string location, IReadOnlyDictionary<string, s
 33        {
 034            GroupId = groupId;
 035            RequiredMembers = requiredMembers;
 036            RequiredZoneNames = requiredZoneNames;
 037        }
 38
 39        /// <summary> Group identifier of private link resource. </summary>
 040        public string GroupId { get; }
 41        /// <summary> Required member names of private link resource. </summary>
 042        public IReadOnlyList<string> RequiredMembers { get; }
 43        /// <summary> Required DNS zone names of the the private link resource. </summary>
 044        public IList<string> RequiredZoneNames { get; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\PrivateLinkResource.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 PrivateLinkResource : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("properties");
 020            writer.WriteStartObject();
 021            if (Optional.IsCollectionDefined(RequiredZoneNames))
 22            {
 023                writer.WritePropertyName("requiredZoneNames");
 024                writer.WriteStartArray();
 025                foreach (var item in RequiredZoneNames)
 26                {
 027                    writer.WriteStringValue(item);
 28                }
 029                writer.WriteEndArray();
 30            }
 031            writer.WriteEndObject();
 032            writer.WriteEndObject();
 033        }
 34
 35        internal static PrivateLinkResource DeserializePrivateLinkResource(JsonElement element)
 36        {
 037            Optional<string> id = default;
 038            Optional<string> name = default;
 039            Optional<string> type = default;
 040            Optional<string> location = default;
 041            Optional<IReadOnlyDictionary<string, string>> tags = default;
 042            Optional<string> groupId = default;
 043            Optional<IReadOnlyList<string>> requiredMembers = default;
 044            Optional<IList<string>> requiredZoneNames = default;
 045            foreach (var property in element.EnumerateObject())
 46            {
 047                if (property.NameEquals("id"))
 48                {
 049                    id = property.Value.GetString();
 050                    continue;
 51                }
 052                if (property.NameEquals("name"))
 53                {
 054                    name = property.Value.GetString();
 055                    continue;
 56                }
 057                if (property.NameEquals("type"))
 58                {
 059                    type = property.Value.GetString();
 060                    continue;
 61                }
 062                if (property.NameEquals("location"))
 63                {
 064                    location = property.Value.GetString();
 065                    continue;
 66                }
 067                if (property.NameEquals("tags"))
 68                {
 069                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 070                    foreach (var property0 in property.Value.EnumerateObject())
 71                    {
 072                        dictionary.Add(property0.Name, property0.Value.GetString());
 73                    }
 074                    tags = dictionary;
 075                    continue;
 76                }
 077                if (property.NameEquals("properties"))
 78                {
 079                    foreach (var property0 in property.Value.EnumerateObject())
 80                    {
 081                        if (property0.NameEquals("groupId"))
 82                        {
 083                            groupId = property0.Value.GetString();
 084                            continue;
 85                        }
 086                        if (property0.NameEquals("requiredMembers"))
 87                        {
 088                            List<string> array = new List<string>();
 089                            foreach (var item in property0.Value.EnumerateArray())
 90                            {
 091                                array.Add(item.GetString());
 92                            }
 093                            requiredMembers = array;
 094                            continue;
 95                        }
 096                        if (property0.NameEquals("requiredZoneNames"))
 97                        {
 098                            List<string> array = new List<string>();
 099                            foreach (var item in property0.Value.EnumerateArray())
 100                            {
 0101                                array.Add(item.GetString());
 102                            }
 0103                            requiredZoneNames = array;
 104                            continue;
 105                        }
 106                    }
 107                    continue;
 108                }
 109            }
 0110            return new PrivateLinkResource(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags)
 111        }
 112    }
 113}