< Summary

Class:Azure.ResourceManager.Storage.Models.PrivateLinkResource
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\PrivateLinkResource.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\PrivateLinkResource.Serialization.cs
Covered lines:46
Uncovered lines:37
Coverable lines:83
Total lines:205
Line coverage:55.4% (46 of 83)
Covered branches:36
Total branches:54
Branch coverage:66.6% (36 of 54)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\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.Storage.Models
 11{
 12    /// <summary> A private link resource. </summary>
 13    public partial class PrivateLinkResource : Resource
 14    {
 15        /// <summary> Initializes a new instance of PrivateLinkResource. </summary>
 016        public PrivateLinkResource()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of PrivateLinkResource. </summary>
 21        /// <param name="id"> Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourc
 22        /// <param name="name"> The name of the resource. </param>
 23        /// <param name="type"> The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/sto
 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 private link resource Private link DNS zone name. </param>
 2427        internal PrivateLinkResource(string id, string name, string type, string groupId, IList<string> requiredMembers,
 28        {
 2429            GroupId = groupId;
 2430            RequiredMembers = requiredMembers;
 2431            RequiredZoneNames = requiredZoneNames;
 2432        }
 33
 34        /// <summary> The private link resource group id. </summary>
 035        public string GroupId { get; }
 36        /// <summary> The private link resource required member names. </summary>
 037        public IList<string> RequiredMembers { get; }
 38        /// <summary> The private link resource Private link DNS zone name. </summary>
 039        public IList<string> RequiredZoneNames { get; set; }
 40    }
 41}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\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.Storage.Models
 13{
 14    public partial class PrivateLinkResource : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Id != null)
 20            {
 021                writer.WritePropertyName("id");
 022                writer.WriteStringValue(Id);
 23            }
 024            if (Name != null)
 25            {
 026                writer.WritePropertyName("name");
 027                writer.WriteStringValue(Name);
 28            }
 029            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            writer.WritePropertyName("properties");
 035            writer.WriteStartObject();
 036            if (GroupId != null)
 37            {
 038                writer.WritePropertyName("groupId");
 039                writer.WriteStringValue(GroupId);
 40            }
 041            if (RequiredMembers != null)
 42            {
 043                writer.WritePropertyName("requiredMembers");
 044                writer.WriteStartArray();
 045                foreach (var item in RequiredMembers)
 46                {
 047                    writer.WriteStringValue(item);
 48                }
 049                writer.WriteEndArray();
 50            }
 051            if (RequiredZoneNames != null)
 52            {
 053                writer.WritePropertyName("requiredZoneNames");
 054                writer.WriteStartArray();
 055                foreach (var item in RequiredZoneNames)
 56                {
 057                    writer.WriteStringValue(item);
 58                }
 059                writer.WriteEndArray();
 60            }
 061            writer.WriteEndObject();
 062            writer.WriteEndObject();
 063        }
 64
 65        internal static PrivateLinkResource DeserializePrivateLinkResource(JsonElement element)
 66        {
 2467            string id = default;
 2468            string name = default;
 2469            string type = default;
 2470            string groupId = default;
 2471            IList<string> requiredMembers = default;
 2472            IList<string> requiredZoneNames = default;
 24073            foreach (var property in element.EnumerateObject())
 74            {
 9675                if (property.NameEquals("id"))
 76                {
 2477                    if (property.Value.ValueKind == JsonValueKind.Null)
 78                    {
 79                        continue;
 80                    }
 2481                    id = property.Value.GetString();
 2482                    continue;
 83                }
 7284                if (property.NameEquals("name"))
 85                {
 2486                    if (property.Value.ValueKind == JsonValueKind.Null)
 87                    {
 88                        continue;
 89                    }
 2490                    name = property.Value.GetString();
 2491                    continue;
 92                }
 4893                if (property.NameEquals("type"))
 94                {
 2495                    if (property.Value.ValueKind == JsonValueKind.Null)
 96                    {
 97                        continue;
 98                    }
 2499                    type = property.Value.GetString();
 24100                    continue;
 101                }
 24102                if (property.NameEquals("properties"))
 103                {
 192104                    foreach (var property0 in property.Value.EnumerateObject())
 105                    {
 72106                        if (property0.NameEquals("groupId"))
 107                        {
 24108                            if (property0.Value.ValueKind == JsonValueKind.Null)
 109                            {
 110                                continue;
 111                            }
 24112                            groupId = property0.Value.GetString();
 24113                            continue;
 114                        }
 48115                        if (property0.NameEquals("requiredMembers"))
 116                        {
 24117                            if (property0.Value.ValueKind == JsonValueKind.Null)
 118                            {
 119                                continue;
 120                            }
 24121                            List<string> array = new List<string>();
 96122                            foreach (var item in property0.Value.EnumerateArray())
 123                            {
 24124                                if (item.ValueKind == JsonValueKind.Null)
 125                                {
 0126                                    array.Add(null);
 127                                }
 128                                else
 129                                {
 24130                                    array.Add(item.GetString());
 131                                }
 132                            }
 24133                            requiredMembers = array;
 24134                            continue;
 135                        }
 24136                        if (property0.NameEquals("requiredZoneNames"))
 137                        {
 24138                            if (property0.Value.ValueKind == JsonValueKind.Null)
 139                            {
 140                                continue;
 141                            }
 24142                            List<string> array = new List<string>();
 96143                            foreach (var item in property0.Value.EnumerateArray())
 144                            {
 24145                                if (item.ValueKind == JsonValueKind.Null)
 146                                {
 0147                                    array.Add(null);
 148                                }
 149                                else
 150                                {
 24151                                    array.Add(item.GetString());
 152                                }
 153                            }
 24154                            requiredZoneNames = array;
 155                            continue;
 156                        }
 157                    }
 158                    continue;
 159                }
 160            }
 24161            return new PrivateLinkResource(id, name, type, groupId, requiredMembers, requiredZoneNames);
 162        }
 163    }
 164}