< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_Type()-0%100%
get_LinkedResourceType()-0%100%
get_Link()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeResourceNavigationLink(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ResourceNavigationLink.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.Network.Models
 9{
 10    /// <summary> ResourceNavigationLink resource. </summary>
 11    public partial class ResourceNavigationLink : SubResource
 12    {
 13        /// <summary> Initializes a new instance of ResourceNavigationLink. </summary>
 014        public ResourceNavigationLink()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of ResourceNavigationLink. </summary>
 19        /// <param name="id"> Resource ID. </param>
 20        /// <param name="name"> Name of the resource that is unique within a resource group. This name can be used to ac
 21        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 22        /// <param name="type"> Resource type. </param>
 23        /// <param name="linkedResourceType"> Resource type of the linked resource. </param>
 24        /// <param name="link"> Link to the external resource. </param>
 25        /// <param name="provisioningState"> The provisioning state of the resource navigation link resource. </param>
 026        internal ResourceNavigationLink(string id, string name, string etag, string type, string linkedResourceType, str
 27        {
 028            Name = name;
 029            Etag = etag;
 030            Type = type;
 031            LinkedResourceType = linkedResourceType;
 032            Link = link;
 033            ProvisioningState = provisioningState;
 034        }
 35
 36        /// <summary> Name of the resource that is unique within a resource group. This name can be used to access the r
 037        public string Name { get; set; }
 38        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 039        public string Etag { get; }
 40        /// <summary> Resource type. </summary>
 041        public string Type { get; }
 42        /// <summary> Resource type of the linked resource. </summary>
 043        public string LinkedResourceType { get; set; }
 44        /// <summary> Link to the external resource. </summary>
 045        public string Link { get; set; }
 46        /// <summary> The provisioning state of the resource navigation link resource. </summary>
 047        public ProvisioningState? ProvisioningState { get; }
 48    }
 49}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ResourceNavigationLink.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.Network.Models
 12{
 13    public partial class ResourceNavigationLink : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Name != null)
 19            {
 020                writer.WritePropertyName("name");
 021                writer.WriteStringValue(Name);
 22            }
 023            if (Etag != null)
 24            {
 025                writer.WritePropertyName("etag");
 026                writer.WriteStringValue(Etag);
 27            }
 028            if (Type != null)
 29            {
 030                writer.WritePropertyName("type");
 031                writer.WriteStringValue(Type);
 32            }
 033            if (Id != null)
 34            {
 035                writer.WritePropertyName("id");
 036                writer.WriteStringValue(Id);
 37            }
 038            writer.WritePropertyName("properties");
 039            writer.WriteStartObject();
 040            if (LinkedResourceType != null)
 41            {
 042                writer.WritePropertyName("linkedResourceType");
 043                writer.WriteStringValue(LinkedResourceType);
 44            }
 045            if (Link != null)
 46            {
 047                writer.WritePropertyName("link");
 048                writer.WriteStringValue(Link);
 49            }
 050            if (ProvisioningState != null)
 51            {
 052                writer.WritePropertyName("provisioningState");
 053                writer.WriteStringValue(ProvisioningState.Value.ToString());
 54            }
 055            writer.WriteEndObject();
 056            writer.WriteEndObject();
 057        }
 58
 59        internal static ResourceNavigationLink DeserializeResourceNavigationLink(JsonElement element)
 60        {
 061            string name = default;
 062            string etag = default;
 063            string type = default;
 064            string id = default;
 065            string linkedResourceType = default;
 066            string link = default;
 067            ProvisioningState? provisioningState = default;
 068            foreach (var property in element.EnumerateObject())
 69            {
 070                if (property.NameEquals("name"))
 71                {
 072                    if (property.Value.ValueKind == JsonValueKind.Null)
 73                    {
 74                        continue;
 75                    }
 076                    name = property.Value.GetString();
 077                    continue;
 78                }
 079                if (property.NameEquals("etag"))
 80                {
 081                    if (property.Value.ValueKind == JsonValueKind.Null)
 82                    {
 83                        continue;
 84                    }
 085                    etag = property.Value.GetString();
 086                    continue;
 87                }
 088                if (property.NameEquals("type"))
 89                {
 090                    if (property.Value.ValueKind == JsonValueKind.Null)
 91                    {
 92                        continue;
 93                    }
 094                    type = property.Value.GetString();
 095                    continue;
 96                }
 097                if (property.NameEquals("id"))
 98                {
 099                    if (property.Value.ValueKind == JsonValueKind.Null)
 100                    {
 101                        continue;
 102                    }
 0103                    id = property.Value.GetString();
 0104                    continue;
 105                }
 0106                if (property.NameEquals("properties"))
 107                {
 0108                    foreach (var property0 in property.Value.EnumerateObject())
 109                    {
 0110                        if (property0.NameEquals("linkedResourceType"))
 111                        {
 0112                            if (property0.Value.ValueKind == JsonValueKind.Null)
 113                            {
 114                                continue;
 115                            }
 0116                            linkedResourceType = property0.Value.GetString();
 0117                            continue;
 118                        }
 0119                        if (property0.NameEquals("link"))
 120                        {
 0121                            if (property0.Value.ValueKind == JsonValueKind.Null)
 122                            {
 123                                continue;
 124                            }
 0125                            link = property0.Value.GetString();
 0126                            continue;
 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());
 135                            continue;
 136                        }
 137                    }
 138                    continue;
 139                }
 140            }
 0141            return new ResourceNavigationLink(id, name, etag, type, linkedResourceType, link, provisioningState);
 142        }
 143    }
 144}