< Summary

Class:Azure.ResourceManager.Network.Models.VirtualRouterPeering
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualRouterPeering.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualRouterPeering.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_PeerAsn()-0%100%
get_PeerIp()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVirtualRouterPeering(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualRouterPeering.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> Virtual Router Peering resource. </summary>
 11    public partial class VirtualRouterPeering : SubResource
 12    {
 13        /// <summary> Initializes a new instance of VirtualRouterPeering. </summary>
 014        public VirtualRouterPeering()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of VirtualRouterPeering. </summary>
 19        /// <param name="id"> Resource ID. </param>
 20        /// <param name="name"> Name of the virtual router peering that is unique within a virtual router. </param>
 21        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 22        /// <param name="type"> Peering type. </param>
 23        /// <param name="peerAsn"> Peer ASN. </param>
 24        /// <param name="peerIp"> Peer IP. </param>
 25        /// <param name="provisioningState"> The provisioning state of the resource. </param>
 026        internal VirtualRouterPeering(string id, string name, string etag, string type, long? peerAsn, string peerIp, Pr
 27        {
 028            Name = name;
 029            Etag = etag;
 030            Type = type;
 031            PeerAsn = peerAsn;
 032            PeerIp = peerIp;
 033            ProvisioningState = provisioningState;
 034        }
 35
 36        /// <summary> Name of the virtual router peering that is unique within a virtual router. </summary>
 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> Peering type. </summary>
 041        public string Type { get; }
 42        /// <summary> Peer ASN. </summary>
 043        public long? PeerAsn { get; set; }
 44        /// <summary> Peer IP. </summary>
 045        public string PeerIp { get; set; }
 46        /// <summary> The provisioning state of the resource. </summary>
 047        public ProvisioningState? ProvisioningState { get; }
 48    }
 49}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualRouterPeering.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 VirtualRouterPeering : 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 (PeerAsn != null)
 41            {
 042                writer.WritePropertyName("peerAsn");
 043                writer.WriteNumberValue(PeerAsn.Value);
 44            }
 045            if (PeerIp != null)
 46            {
 047                writer.WritePropertyName("peerIp");
 048                writer.WriteStringValue(PeerIp);
 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 VirtualRouterPeering DeserializeVirtualRouterPeering(JsonElement element)
 60        {
 061            string name = default;
 062            string etag = default;
 063            string type = default;
 064            string id = default;
 065            long? peerAsn = default;
 066            string peerIp = 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("peerAsn"))
 111                        {
 0112                            if (property0.Value.ValueKind == JsonValueKind.Null)
 113                            {
 114                                continue;
 115                            }
 0116                            peerAsn = property0.Value.GetInt64();
 0117                            continue;
 118                        }
 0119                        if (property0.NameEquals("peerIp"))
 120                        {
 0121                            if (property0.Value.ValueKind == JsonValueKind.Null)
 122                            {
 123                                continue;
 124                            }
 0125                            peerIp = 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 VirtualRouterPeering(id, name, etag, type, peerAsn, peerIp, provisioningState);
 142        }
 143    }
 144}