< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_Subnet()-0%100%
get_NetworkInterfaces()-0%100%
get_ProvisioningState()-0%100%
get_PrivateLinkServiceConnections()-0%100%
get_ManualPrivateLinkServiceConnections()-0%100%
get_CustomDnsConfigs()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializePrivateEndpoint(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PrivateEndpoint.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> Private endpoint resource. </summary>
 13    public partial class PrivateEndpoint : Resource
 14    {
 15        /// <summary> Initializes a new instance of PrivateEndpoint. </summary>
 016        public PrivateEndpoint()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of PrivateEndpoint. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Resource name. </param>
 23        /// <param name="type"> Resource type. </param>
 24        /// <param name="location"> Resource location. </param>
 25        /// <param name="tags"> Resource tags. </param>
 26        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 27        /// <param name="subnet"> The ID of the subnet from which the private IP will be allocated. </param>
 28        /// <param name="networkInterfaces"> An array of references to the network interfaces created for this private e
 29        /// <param name="provisioningState"> The provisioning state of the private endpoint resource. </param>
 30        /// <param name="privateLinkServiceConnections"> A grouping of information about the connection to the remote re
 31        /// <param name="manualPrivateLinkServiceConnections"> A grouping of information about the connection to the rem
 32        /// <param name="customDnsConfigs"> An array of custom dns configurations. </param>
 033        internal PrivateEndpoint(string id, string name, string type, string location, IDictionary<string, string> tags,
 34        {
 035            Etag = etag;
 036            Subnet = subnet;
 037            NetworkInterfaces = networkInterfaces;
 038            ProvisioningState = provisioningState;
 039            PrivateLinkServiceConnections = privateLinkServiceConnections;
 040            ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnections;
 041            CustomDnsConfigs = customDnsConfigs;
 042        }
 43
 44        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 045        public string Etag { get; }
 46        /// <summary> The ID of the subnet from which the private IP will be allocated. </summary>
 047        public Subnet Subnet { get; set; }
 48        /// <summary> An array of references to the network interfaces created for this private endpoint. </summary>
 049        public IList<NetworkInterface> NetworkInterfaces { get; }
 50        /// <summary> The provisioning state of the private endpoint resource. </summary>
 051        public ProvisioningState? ProvisioningState { get; }
 52        /// <summary> A grouping of information about the connection to the remote resource. </summary>
 053        public IList<PrivateLinkServiceConnection> PrivateLinkServiceConnections { get; set; }
 54        /// <summary> A grouping of information about the connection to the remote resource. Used when the network admin
 055        public IList<PrivateLinkServiceConnection> ManualPrivateLinkServiceConnections { get; set; }
 56        /// <summary> An array of custom dns configurations. </summary>
 057        public IList<CustomDnsConfigPropertiesFormat> CustomDnsConfigs { get; set; }
 58    }
 59}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PrivateEndpoint.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 PrivateEndpoint : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Etag != null)
 20            {
 021                writer.WritePropertyName("etag");
 022                writer.WriteStringValue(Etag);
 23            }
 024            if (Id != null)
 25            {
 026                writer.WritePropertyName("id");
 027                writer.WriteStringValue(Id);
 28            }
 029            if (Name != null)
 30            {
 031                writer.WritePropertyName("name");
 032                writer.WriteStringValue(Name);
 33            }
 034            if (Type != null)
 35            {
 036                writer.WritePropertyName("type");
 037                writer.WriteStringValue(Type);
 38            }
 039            if (Location != null)
 40            {
 041                writer.WritePropertyName("location");
 042                writer.WriteStringValue(Location);
 43            }
 044            if (Tags != null)
 45            {
 046                writer.WritePropertyName("tags");
 047                writer.WriteStartObject();
 048                foreach (var item in Tags)
 49                {
 050                    writer.WritePropertyName(item.Key);
 051                    writer.WriteStringValue(item.Value);
 52                }
 053                writer.WriteEndObject();
 54            }
 055            writer.WritePropertyName("properties");
 056            writer.WriteStartObject();
 057            if (Subnet != null)
 58            {
 059                writer.WritePropertyName("subnet");
 060                writer.WriteObjectValue(Subnet);
 61            }
 062            if (NetworkInterfaces != null)
 63            {
 064                writer.WritePropertyName("networkInterfaces");
 065                writer.WriteStartArray();
 066                foreach (var item in NetworkInterfaces)
 67                {
 068                    writer.WriteObjectValue(item);
 69                }
 070                writer.WriteEndArray();
 71            }
 072            if (ProvisioningState != null)
 73            {
 074                writer.WritePropertyName("provisioningState");
 075                writer.WriteStringValue(ProvisioningState.Value.ToString());
 76            }
 077            if (PrivateLinkServiceConnections != null)
 78            {
 079                writer.WritePropertyName("privateLinkServiceConnections");
 080                writer.WriteStartArray();
 081                foreach (var item in PrivateLinkServiceConnections)
 82                {
 083                    writer.WriteObjectValue(item);
 84                }
 085                writer.WriteEndArray();
 86            }
 087            if (ManualPrivateLinkServiceConnections != null)
 88            {
 089                writer.WritePropertyName("manualPrivateLinkServiceConnections");
 090                writer.WriteStartArray();
 091                foreach (var item in ManualPrivateLinkServiceConnections)
 92                {
 093                    writer.WriteObjectValue(item);
 94                }
 095                writer.WriteEndArray();
 96            }
 097            if (CustomDnsConfigs != null)
 98            {
 099                writer.WritePropertyName("customDnsConfigs");
 0100                writer.WriteStartArray();
 0101                foreach (var item in CustomDnsConfigs)
 102                {
 0103                    writer.WriteObjectValue(item);
 104                }
 0105                writer.WriteEndArray();
 106            }
 0107            writer.WriteEndObject();
 0108            writer.WriteEndObject();
 0109        }
 110
 111        internal static PrivateEndpoint DeserializePrivateEndpoint(JsonElement element)
 112        {
 0113            string etag = default;
 0114            string id = default;
 0115            string name = default;
 0116            string type = default;
 0117            string location = default;
 0118            IDictionary<string, string> tags = default;
 0119            Subnet subnet = default;
 0120            IList<NetworkInterface> networkInterfaces = default;
 0121            ProvisioningState? provisioningState = default;
 0122            IList<PrivateLinkServiceConnection> privateLinkServiceConnections = default;
 0123            IList<PrivateLinkServiceConnection> manualPrivateLinkServiceConnections = default;
 0124            IList<CustomDnsConfigPropertiesFormat> customDnsConfigs = default;
 0125            foreach (var property in element.EnumerateObject())
 126            {
 0127                if (property.NameEquals("etag"))
 128                {
 0129                    if (property.Value.ValueKind == JsonValueKind.Null)
 130                    {
 131                        continue;
 132                    }
 0133                    etag = property.Value.GetString();
 0134                    continue;
 135                }
 0136                if (property.NameEquals("id"))
 137                {
 0138                    if (property.Value.ValueKind == JsonValueKind.Null)
 139                    {
 140                        continue;
 141                    }
 0142                    id = property.Value.GetString();
 0143                    continue;
 144                }
 0145                if (property.NameEquals("name"))
 146                {
 0147                    if (property.Value.ValueKind == JsonValueKind.Null)
 148                    {
 149                        continue;
 150                    }
 0151                    name = property.Value.GetString();
 0152                    continue;
 153                }
 0154                if (property.NameEquals("type"))
 155                {
 0156                    if (property.Value.ValueKind == JsonValueKind.Null)
 157                    {
 158                        continue;
 159                    }
 0160                    type = property.Value.GetString();
 0161                    continue;
 162                }
 0163                if (property.NameEquals("location"))
 164                {
 0165                    if (property.Value.ValueKind == JsonValueKind.Null)
 166                    {
 167                        continue;
 168                    }
 0169                    location = property.Value.GetString();
 0170                    continue;
 171                }
 0172                if (property.NameEquals("tags"))
 173                {
 0174                    if (property.Value.ValueKind == JsonValueKind.Null)
 175                    {
 176                        continue;
 177                    }
 0178                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0179                    foreach (var property0 in property.Value.EnumerateObject())
 180                    {
 0181                        if (property0.Value.ValueKind == JsonValueKind.Null)
 182                        {
 0183                            dictionary.Add(property0.Name, null);
 184                        }
 185                        else
 186                        {
 0187                            dictionary.Add(property0.Name, property0.Value.GetString());
 188                        }
 189                    }
 0190                    tags = dictionary;
 0191                    continue;
 192                }
 0193                if (property.NameEquals("properties"))
 194                {
 0195                    foreach (var property0 in property.Value.EnumerateObject())
 196                    {
 0197                        if (property0.NameEquals("subnet"))
 198                        {
 0199                            if (property0.Value.ValueKind == JsonValueKind.Null)
 200                            {
 201                                continue;
 202                            }
 0203                            subnet = Subnet.DeserializeSubnet(property0.Value);
 0204                            continue;
 205                        }
 0206                        if (property0.NameEquals("networkInterfaces"))
 207                        {
 0208                            if (property0.Value.ValueKind == JsonValueKind.Null)
 209                            {
 210                                continue;
 211                            }
 0212                            List<NetworkInterface> array = new List<NetworkInterface>();
 0213                            foreach (var item in property0.Value.EnumerateArray())
 214                            {
 0215                                if (item.ValueKind == JsonValueKind.Null)
 216                                {
 0217                                    array.Add(null);
 218                                }
 219                                else
 220                                {
 0221                                    array.Add(NetworkInterface.DeserializeNetworkInterface(item));
 222                                }
 223                            }
 0224                            networkInterfaces = array;
 0225                            continue;
 226                        }
 0227                        if (property0.NameEquals("provisioningState"))
 228                        {
 0229                            if (property0.Value.ValueKind == JsonValueKind.Null)
 230                            {
 231                                continue;
 232                            }
 0233                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0234                            continue;
 235                        }
 0236                        if (property0.NameEquals("privateLinkServiceConnections"))
 237                        {
 0238                            if (property0.Value.ValueKind == JsonValueKind.Null)
 239                            {
 240                                continue;
 241                            }
 0242                            List<PrivateLinkServiceConnection> array = new List<PrivateLinkServiceConnection>();
 0243                            foreach (var item in property0.Value.EnumerateArray())
 244                            {
 0245                                if (item.ValueKind == JsonValueKind.Null)
 246                                {
 0247                                    array.Add(null);
 248                                }
 249                                else
 250                                {
 0251                                    array.Add(PrivateLinkServiceConnection.DeserializePrivateLinkServiceConnection(item)
 252                                }
 253                            }
 0254                            privateLinkServiceConnections = array;
 0255                            continue;
 256                        }
 0257                        if (property0.NameEquals("manualPrivateLinkServiceConnections"))
 258                        {
 0259                            if (property0.Value.ValueKind == JsonValueKind.Null)
 260                            {
 261                                continue;
 262                            }
 0263                            List<PrivateLinkServiceConnection> array = new List<PrivateLinkServiceConnection>();
 0264                            foreach (var item in property0.Value.EnumerateArray())
 265                            {
 0266                                if (item.ValueKind == JsonValueKind.Null)
 267                                {
 0268                                    array.Add(null);
 269                                }
 270                                else
 271                                {
 0272                                    array.Add(PrivateLinkServiceConnection.DeserializePrivateLinkServiceConnection(item)
 273                                }
 274                            }
 0275                            manualPrivateLinkServiceConnections = array;
 0276                            continue;
 277                        }
 0278                        if (property0.NameEquals("customDnsConfigs"))
 279                        {
 0280                            if (property0.Value.ValueKind == JsonValueKind.Null)
 281                            {
 282                                continue;
 283                            }
 0284                            List<CustomDnsConfigPropertiesFormat> array = new List<CustomDnsConfigPropertiesFormat>();
 0285                            foreach (var item in property0.Value.EnumerateArray())
 286                            {
 0287                                if (item.ValueKind == JsonValueKind.Null)
 288                                {
 0289                                    array.Add(null);
 290                                }
 291                                else
 292                                {
 0293                                    array.Add(CustomDnsConfigPropertiesFormat.DeserializeCustomDnsConfigPropertiesFormat
 294                                }
 295                            }
 0296                            customDnsConfigs = array;
 297                            continue;
 298                        }
 299                    }
 300                    continue;
 301                }
 302            }
 0303            return new PrivateEndpoint(id, name, type, location, tags, etag, subnet, networkInterfaces, provisioningStat
 304        }
 305    }
 306}