< Summary

Class:Azure.ResourceManager.AppConfiguration.Models.PrivateLinkResource
Assembly:Azure.ResourceManager.AppConfiguration
File(s):C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\PrivateLinkResource.cs
C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\PrivateLinkResource.Serialization.cs
Covered lines:50
Uncovered lines:9
Coverable lines:59
Total lines:165
Line coverage:84.7% (50 of 59)
Covered branches:36
Total branches:38
Branch coverage:94.7% (36 of 38)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Id()-0%100%
get_Name()-100%100%
get_Type()-0%100%
get_GroupId()-0%100%
get_RequiredMembers()-0%100%
get_RequiredZoneNames()-0%100%
DeserializePrivateLinkResource(...)-95.35%94.74%

File(s)

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\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;
 9
 10namespace Azure.ResourceManager.AppConfiguration.Models
 11{
 12    /// <summary> A resource that supports private link capabilities. </summary>
 13    public partial class PrivateLinkResource
 14    {
 15        /// <summary> Initializes a new instance of PrivateLinkResource. </summary>
 016        internal PrivateLinkResource()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of PrivateLinkResource. </summary>
 21        /// <param name="id"> The resource ID. </param>
 22        /// <param name="name"> The name of the resource. </param>
 23        /// <param name="type"> The type of the resource. </param>
 24        /// <param name="groupId"> The private link resource group id. </param>
 25        /// <param name="requiredMembers"> The private link resource required member names. </param>
 26        /// <param name="requiredZoneNames"> The list of required DNS zone names of the private link resource. </param>
 2027        internal PrivateLinkResource(string id, string name, string type, string groupId, IReadOnlyList<string> required
 28        {
 2029            Id = id;
 2030            Name = name;
 2031            Type = type;
 2032            GroupId = groupId;
 2033            RequiredMembers = requiredMembers;
 2034            RequiredZoneNames = requiredZoneNames;
 2035        }
 36
 37        /// <summary> The resource ID. </summary>
 038        public string Id { get; }
 39        /// <summary> The name of the resource. </summary>
 840        public string Name { get; }
 41        /// <summary> The type of the resource. </summary>
 042        public string Type { get; }
 43        /// <summary> The private link resource group id. </summary>
 044        public string GroupId { get; }
 45        /// <summary> The private link resource required member names. </summary>
 046        public IReadOnlyList<string> RequiredMembers { get; }
 47        /// <summary> The list of required DNS zone names of the private link resource. </summary>
 048        public IReadOnlyList<string> RequiredZoneNames { get; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\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.AppConfiguration.Models
 13{
 14    public partial class PrivateLinkResource
 15    {
 16        internal static PrivateLinkResource DeserializePrivateLinkResource(JsonElement element)
 17        {
 2018            string id = default;
 2019            string name = default;
 2020            string type = default;
 2021            string groupId = default;
 2022            IReadOnlyList<string> requiredMembers = default;
 2023            IReadOnlyList<string> requiredZoneNames = default;
 20024            foreach (var property in element.EnumerateObject())
 25            {
 8026                if (property.NameEquals("id"))
 27                {
 2028                    if (property.Value.ValueKind == JsonValueKind.Null)
 29                    {
 30                        continue;
 31                    }
 2032                    id = property.Value.GetString();
 2033                    continue;
 34                }
 6035                if (property.NameEquals("name"))
 36                {
 2037                    if (property.Value.ValueKind == JsonValueKind.Null)
 38                    {
 39                        continue;
 40                    }
 2041                    name = property.Value.GetString();
 2042                    continue;
 43                }
 4044                if (property.NameEquals("type"))
 45                {
 2046                    if (property.Value.ValueKind == JsonValueKind.Null)
 47                    {
 48                        continue;
 49                    }
 2050                    type = property.Value.GetString();
 2051                    continue;
 52                }
 2053                if (property.NameEquals("properties"))
 54                {
 16055                    foreach (var property0 in property.Value.EnumerateObject())
 56                    {
 6057                        if (property0.NameEquals("groupId"))
 58                        {
 2059                            if (property0.Value.ValueKind == JsonValueKind.Null)
 60                            {
 61                                continue;
 62                            }
 2063                            groupId = property0.Value.GetString();
 2064                            continue;
 65                        }
 4066                        if (property0.NameEquals("requiredMembers"))
 67                        {
 2068                            if (property0.Value.ValueKind == JsonValueKind.Null)
 69                            {
 70                                continue;
 71                            }
 2072                            List<string> array = new List<string>();
 8073                            foreach (var item in property0.Value.EnumerateArray())
 74                            {
 2075                                if (item.ValueKind == JsonValueKind.Null)
 76                                {
 077                                    array.Add(null);
 78                                }
 79                                else
 80                                {
 2081                                    array.Add(item.GetString());
 82                                }
 83                            }
 2084                            requiredMembers = array;
 2085                            continue;
 86                        }
 2087                        if (property0.NameEquals("requiredZoneNames"))
 88                        {
 2089                            if (property0.Value.ValueKind == JsonValueKind.Null)
 90                            {
 91                                continue;
 92                            }
 2093                            List<string> array = new List<string>();
 8094                            foreach (var item in property0.Value.EnumerateArray())
 95                            {
 2096                                if (item.ValueKind == JsonValueKind.Null)
 97                                {
 098                                    array.Add(null);
 99                                }
 100                                else
 101                                {
 20102                                    array.Add(item.GetString());
 103                                }
 104                            }
 20105                            requiredZoneNames = array;
 106                            continue;
 107                        }
 108                    }
 109                    continue;
 110                }
 111            }
 20112            return new PrivateLinkResource(id, name, type, groupId, requiredMembers, requiredZoneNames);
 113        }
 114    }
 115}