< Summary

Class:Azure.ResourceManager.AppConfiguration.Models.PrivateEndpointConnectionReference
Assembly:Azure.ResourceManager.AppConfiguration
File(s):C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\PrivateEndpointConnectionReference.cs
C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\PrivateEndpointConnectionReference.Serialization.cs
Covered lines:43
Uncovered lines:30
Coverable lines:73
Total lines:177
Line coverage:58.9% (43 of 73)
Covered branches:30
Total branches:42
Branch coverage:71.4% (30 of 42)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Id()-100%100%
get_Name()-100%100%
get_Type()-0%100%
get_ProvisioningState()-0%100%
get_PrivateEndpoint()-0%100%
get_PrivateLinkServiceConnectionState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializePrivateEndpointConnectionReference(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\PrivateEndpointConnectionReference.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
 8namespace Azure.ResourceManager.AppConfiguration.Models
 9{
 10    /// <summary> A reference to a related private endpoint connection. </summary>
 11    public partial class PrivateEndpointConnectionReference
 12    {
 13        /// <summary> Initializes a new instance of PrivateEndpointConnectionReference. </summary>
 014        public PrivateEndpointConnectionReference()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of PrivateEndpointConnectionReference. </summary>
 19        /// <param name="id"> The resource ID. </param>
 20        /// <param name="name"> The name of the resource. </param>
 21        /// <param name="type"> The type of the resource. </param>
 22        /// <param name="provisioningState"> The provisioning status of the private endpoint connection. </param>
 23        /// <param name="privateEndpoint"> The resource of private endpoint. </param>
 24        /// <param name="privateLinkServiceConnectionState"> A collection of information about the state of the connecti
 1625        internal PrivateEndpointConnectionReference(string id, string name, string type, ProvisioningState? provisioning
 26        {
 1627            Id = id;
 1628            Name = name;
 1629            Type = type;
 1630            ProvisioningState = provisioningState;
 1631            PrivateEndpoint = privateEndpoint;
 1632            PrivateLinkServiceConnectionState = privateLinkServiceConnectionState;
 1633        }
 34
 35        /// <summary> The resource ID. </summary>
 436        public string Id { get; }
 37        /// <summary> The name of the resource. </summary>
 438        public string Name { get; }
 39        /// <summary> The type of the resource. </summary>
 040        public string Type { get; }
 41        /// <summary> The provisioning status of the private endpoint connection. </summary>
 042        public ProvisioningState? ProvisioningState { get; }
 43        /// <summary> The resource of private endpoint. </summary>
 044        public PrivateEndpoint PrivateEndpoint { get; set; }
 45        /// <summary> A collection of information about the state of the connection between service consumer and provide
 046        public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; }
 47    }
 48}

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\PrivateEndpointConnectionReference.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.AppConfiguration.Models
 12{
 13    public partial class PrivateEndpointConnectionReference : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Id != null)
 19            {
 020                writer.WritePropertyName("id");
 021                writer.WriteStringValue(Id);
 22            }
 023            if (Name != null)
 24            {
 025                writer.WritePropertyName("name");
 026                writer.WriteStringValue(Name);
 27            }
 028            if (Type != null)
 29            {
 030                writer.WritePropertyName("type");
 031                writer.WriteStringValue(Type);
 32            }
 033            writer.WritePropertyName("properties");
 034            writer.WriteStartObject();
 035            if (ProvisioningState != null)
 36            {
 037                writer.WritePropertyName("provisioningState");
 038                writer.WriteStringValue(ProvisioningState.Value.ToString());
 39            }
 040            if (PrivateEndpoint != null)
 41            {
 042                writer.WritePropertyName("privateEndpoint");
 043                writer.WriteObjectValue(PrivateEndpoint);
 44            }
 045            if (PrivateLinkServiceConnectionState != null)
 46            {
 047                writer.WritePropertyName("privateLinkServiceConnectionState");
 048                writer.WriteObjectValue(PrivateLinkServiceConnectionState);
 49            }
 050            writer.WriteEndObject();
 051            writer.WriteEndObject();
 052        }
 53
 54        internal static PrivateEndpointConnectionReference DeserializePrivateEndpointConnectionReference(JsonElement ele
 55        {
 1656            string id = default;
 1657            string name = default;
 1658            string type = default;
 1659            ProvisioningState? provisioningState = default;
 1660            PrivateEndpoint privateEndpoint = default;
 1661            PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default;
 16062            foreach (var property in element.EnumerateObject())
 63            {
 6464                if (property.NameEquals("id"))
 65                {
 1666                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 1670                    id = property.Value.GetString();
 1671                    continue;
 72                }
 4873                if (property.NameEquals("name"))
 74                {
 1675                    if (property.Value.ValueKind == JsonValueKind.Null)
 76                    {
 77                        continue;
 78                    }
 1679                    name = property.Value.GetString();
 1680                    continue;
 81                }
 3282                if (property.NameEquals("type"))
 83                {
 1684                    if (property.Value.ValueKind == JsonValueKind.Null)
 85                    {
 86                        continue;
 87                    }
 1688                    type = property.Value.GetString();
 1689                    continue;
 90                }
 1691                if (property.NameEquals("properties"))
 92                {
 12893                    foreach (var property0 in property.Value.EnumerateObject())
 94                    {
 4895                        if (property0.NameEquals("provisioningState"))
 96                        {
 1697                            if (property0.Value.ValueKind == JsonValueKind.Null)
 98                            {
 99                                continue;
 100                            }
 16101                            provisioningState = new ProvisioningState(property0.Value.GetString());
 16102                            continue;
 103                        }
 32104                        if (property0.NameEquals("privateEndpoint"))
 105                        {
 16106                            if (property0.Value.ValueKind == JsonValueKind.Null)
 107                            {
 108                                continue;
 109                            }
 16110                            privateEndpoint = PrivateEndpoint.DeserializePrivateEndpoint(property0.Value);
 16111                            continue;
 112                        }
 16113                        if (property0.NameEquals("privateLinkServiceConnectionState"))
 114                        {
 16115                            if (property0.Value.ValueKind == JsonValueKind.Null)
 116                            {
 117                                continue;
 118                            }
 16119                            privateLinkServiceConnectionState = PrivateLinkServiceConnectionState.DeserializePrivateLink
 120                            continue;
 121                        }
 122                    }
 123                    continue;
 124                }
 125            }
 16126            return new PrivateEndpointConnectionReference(id, name, type, provisioningState, privateEndpoint, privateLin
 127        }
 128    }
 129}