< Summary

Class:Azure.ResourceManager.Network.Models.PrivateLinkServiceConnection
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PrivateLinkServiceConnection.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PrivateLinkServiceConnection.Serialization.cs
Covered lines:0
Uncovered lines:109
Coverable lines:109
Total lines:251
Line coverage:0% (0 of 109)
Covered branches:0
Total branches:66
Branch coverage:0% (0 of 66)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Type()-0%100%
get_Etag()-0%100%
get_ProvisioningState()-0%100%
get_PrivateLinkServiceId()-0%100%
get_GroupIds()-0%100%
get_RequestMessage()-0%100%
get_PrivateLinkServiceConnectionState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializePrivateLinkServiceConnection(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PrivateLinkServiceConnection.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.Network.Models
 11{
 12    /// <summary> PrivateLinkServiceConnection resource. </summary>
 13    public partial class PrivateLinkServiceConnection : SubResource
 14    {
 15        /// <summary> Initializes a new instance of PrivateLinkServiceConnection. </summary>
 016        public PrivateLinkServiceConnection()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of PrivateLinkServiceConnection. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> The name of the resource that is unique within a resource group. This name can be used t
 23        /// <param name="type"> The resource type. </param>
 24        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 25        /// <param name="provisioningState"> The provisioning state of the private link service connection resource. </p
 26        /// <param name="privateLinkServiceId"> The resource id of private link service. </param>
 27        /// <param name="groupIds"> The ID(s) of the group(s) obtained from the remote resource that this private endpoi
 28        /// <param name="requestMessage"> A message passed to the owner of the remote resource with this connection requ
 29        /// <param name="privateLinkServiceConnectionState"> A collection of read-only information about the state of th
 030        internal PrivateLinkServiceConnection(string id, string name, string type, string etag, ProvisioningState? provi
 31        {
 032            Name = name;
 033            Type = type;
 034            Etag = etag;
 035            ProvisioningState = provisioningState;
 036            PrivateLinkServiceId = privateLinkServiceId;
 037            GroupIds = groupIds;
 038            RequestMessage = requestMessage;
 039            PrivateLinkServiceConnectionState = privateLinkServiceConnectionState;
 040        }
 41
 42        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 043        public string Name { get; set; }
 44        /// <summary> The resource type. </summary>
 045        public string Type { get; }
 46        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 047        public string Etag { get; }
 48        /// <summary> The provisioning state of the private link service connection resource. </summary>
 049        public ProvisioningState? ProvisioningState { get; }
 50        /// <summary> The resource id of private link service. </summary>
 051        public string PrivateLinkServiceId { get; set; }
 52        /// <summary> The ID(s) of the group(s) obtained from the remote resource that this private endpoint should conn
 053        public IList<string> GroupIds { get; set; }
 54        /// <summary> A message passed to the owner of the remote resource with this connection request. Restricted to 1
 055        public string RequestMessage { get; set; }
 56        /// <summary> A collection of read-only information about the state of the connection to the remote resource. </
 057        public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; }
 58    }
 59}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PrivateLinkServiceConnection.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.Network.Models
 13{
 14    public partial class PrivateLinkServiceConnection : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Name != null)
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            if (Type != null)
 25            {
 026                writer.WritePropertyName("type");
 027                writer.WriteStringValue(Type);
 28            }
 029            if (Etag != null)
 30            {
 031                writer.WritePropertyName("etag");
 032                writer.WriteStringValue(Etag);
 33            }
 034            if (Id != null)
 35            {
 036                writer.WritePropertyName("id");
 037                writer.WriteStringValue(Id);
 38            }
 039            writer.WritePropertyName("properties");
 040            writer.WriteStartObject();
 041            if (ProvisioningState != null)
 42            {
 043                writer.WritePropertyName("provisioningState");
 044                writer.WriteStringValue(ProvisioningState.Value.ToString());
 45            }
 046            if (PrivateLinkServiceId != null)
 47            {
 048                writer.WritePropertyName("privateLinkServiceId");
 049                writer.WriteStringValue(PrivateLinkServiceId);
 50            }
 051            if (GroupIds != null)
 52            {
 053                writer.WritePropertyName("groupIds");
 054                writer.WriteStartArray();
 055                foreach (var item in GroupIds)
 56                {
 057                    writer.WriteStringValue(item);
 58                }
 059                writer.WriteEndArray();
 60            }
 061            if (RequestMessage != null)
 62            {
 063                writer.WritePropertyName("requestMessage");
 064                writer.WriteStringValue(RequestMessage);
 65            }
 066            if (PrivateLinkServiceConnectionState != null)
 67            {
 068                writer.WritePropertyName("privateLinkServiceConnectionState");
 069                writer.WriteObjectValue(PrivateLinkServiceConnectionState);
 70            }
 071            writer.WriteEndObject();
 072            writer.WriteEndObject();
 073        }
 74
 75        internal static PrivateLinkServiceConnection DeserializePrivateLinkServiceConnection(JsonElement element)
 76        {
 077            string name = default;
 078            string type = default;
 079            string etag = default;
 080            string id = default;
 081            ProvisioningState? provisioningState = default;
 082            string privateLinkServiceId = default;
 083            IList<string> groupIds = default;
 084            string requestMessage = default;
 085            PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default;
 086            foreach (var property in element.EnumerateObject())
 87            {
 088                if (property.NameEquals("name"))
 89                {
 090                    if (property.Value.ValueKind == JsonValueKind.Null)
 91                    {
 92                        continue;
 93                    }
 094                    name = property.Value.GetString();
 095                    continue;
 96                }
 097                if (property.NameEquals("type"))
 98                {
 099                    if (property.Value.ValueKind == JsonValueKind.Null)
 100                    {
 101                        continue;
 102                    }
 0103                    type = property.Value.GetString();
 0104                    continue;
 105                }
 0106                if (property.NameEquals("etag"))
 107                {
 0108                    if (property.Value.ValueKind == JsonValueKind.Null)
 109                    {
 110                        continue;
 111                    }
 0112                    etag = property.Value.GetString();
 0113                    continue;
 114                }
 0115                if (property.NameEquals("id"))
 116                {
 0117                    if (property.Value.ValueKind == JsonValueKind.Null)
 118                    {
 119                        continue;
 120                    }
 0121                    id = property.Value.GetString();
 0122                    continue;
 123                }
 0124                if (property.NameEquals("properties"))
 125                {
 0126                    foreach (var property0 in property.Value.EnumerateObject())
 127                    {
 0128                        if (property0.NameEquals("provisioningState"))
 129                        {
 0130                            if (property0.Value.ValueKind == JsonValueKind.Null)
 131                            {
 132                                continue;
 133                            }
 0134                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0135                            continue;
 136                        }
 0137                        if (property0.NameEquals("privateLinkServiceId"))
 138                        {
 0139                            if (property0.Value.ValueKind == JsonValueKind.Null)
 140                            {
 141                                continue;
 142                            }
 0143                            privateLinkServiceId = property0.Value.GetString();
 0144                            continue;
 145                        }
 0146                        if (property0.NameEquals("groupIds"))
 147                        {
 0148                            if (property0.Value.ValueKind == JsonValueKind.Null)
 149                            {
 150                                continue;
 151                            }
 0152                            List<string> array = new List<string>();
 0153                            foreach (var item in property0.Value.EnumerateArray())
 154                            {
 0155                                if (item.ValueKind == JsonValueKind.Null)
 156                                {
 0157                                    array.Add(null);
 158                                }
 159                                else
 160                                {
 0161                                    array.Add(item.GetString());
 162                                }
 163                            }
 0164                            groupIds = array;
 0165                            continue;
 166                        }
 0167                        if (property0.NameEquals("requestMessage"))
 168                        {
 0169                            if (property0.Value.ValueKind == JsonValueKind.Null)
 170                            {
 171                                continue;
 172                            }
 0173                            requestMessage = property0.Value.GetString();
 0174                            continue;
 175                        }
 0176                        if (property0.NameEquals("privateLinkServiceConnectionState"))
 177                        {
 0178                            if (property0.Value.ValueKind == JsonValueKind.Null)
 179                            {
 180                                continue;
 181                            }
 0182                            privateLinkServiceConnectionState = PrivateLinkServiceConnectionState.DeserializePrivateLink
 183                            continue;
 184                        }
 185                    }
 186                    continue;
 187                }
 188            }
 0189            return new PrivateLinkServiceConnection(id, name, type, etag, provisioningState, privateLinkServiceId, group
 190        }
 191    }
 192}