< Summary

Class:Azure.ResourceManager.Network.Models.LocalNetworkGateway
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\LocalNetworkGateway.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\LocalNetworkGateway.Serialization.cs
Covered lines:126
Uncovered lines:6
Coverable lines:132
Total lines:297
Line coverage:95.4% (126 of 132)
Covered branches:80
Total branches:84
Branch coverage:95.2% (80 of 84)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Etag()-100%100%
get_LocalNetworkAddressSpace()-100%100%
get_GatewayIpAddress()-100%100%
get_Fqdn()-100%100%
get_BgpSettings()-100%100%
get_ResourceGuid()-100%100%
get_ProvisioningState()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-95.65%96.15%
DeserializeLocalNetworkGateway(...)-94.12%94.83%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\LocalNetworkGateway.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> A common class for general resource information. </summary>
 13    public partial class LocalNetworkGateway : Resource
 14    {
 15        /// <summary> Initializes a new instance of LocalNetworkGateway. </summary>
 1616        public LocalNetworkGateway()
 17        {
 1618        }
 19
 20        /// <summary> Initializes a new instance of LocalNetworkGateway. </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="localNetworkAddressSpace"> Local network site address space. </param>
 28        /// <param name="gatewayIpAddress"> IP address of local network gateway. </param>
 29        /// <param name="fqdn"> FQDN of local network gateway. </param>
 30        /// <param name="bgpSettings"> Local network gateway&apos;s BGP speaker settings. </param>
 31        /// <param name="resourceGuid"> The resource GUID property of the local network gateway resource. </param>
 32        /// <param name="provisioningState"> The provisioning state of the local network gateway resource. </param>
 10433        internal LocalNetworkGateway(string id, string name, string type, string location, IDictionary<string, string> t
 34        {
 10435            Etag = etag;
 10436            LocalNetworkAddressSpace = localNetworkAddressSpace;
 10437            GatewayIpAddress = gatewayIpAddress;
 10438            Fqdn = fqdn;
 10439            BgpSettings = bgpSettings;
 10440            ResourceGuid = resourceGuid;
 10441            ProvisioningState = provisioningState;
 10442        }
 43
 44        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 14445        public string Etag { get; }
 46        /// <summary> Local network site address space. </summary>
 31647        public AddressSpace LocalNetworkAddressSpace { get; set; }
 48        /// <summary> IP address of local network gateway. </summary>
 30849        public string GatewayIpAddress { get; set; }
 50        /// <summary> FQDN of local network gateway. </summary>
 19251        public string Fqdn { get; set; }
 52        /// <summary> Local network gateway&apos;s BGP speaker settings. </summary>
 21253        public BgpSettings BgpSettings { get; set; }
 54        /// <summary> The resource GUID property of the local network gateway resource. </summary>
 14455        public string ResourceGuid { get; }
 56        /// <summary> The provisioning state of the local network gateway resource. </summary>
 16457        public ProvisioningState? ProvisioningState { get; }
 58    }
 59}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\LocalNetworkGateway.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 LocalNetworkGateway : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 8818            writer.WriteStartObject();
 8819            if (Etag != null)
 20            {
 5621                writer.WritePropertyName("etag");
 5622                writer.WriteStringValue(Etag);
 23            }
 8824            if (Id != null)
 25            {
 5626                writer.WritePropertyName("id");
 5627                writer.WriteStringValue(Id);
 28            }
 8829            if (Name != null)
 30            {
 5631                writer.WritePropertyName("name");
 5632                writer.WriteStringValue(Name);
 33            }
 8834            if (Type != null)
 35            {
 5636                writer.WritePropertyName("type");
 5637                writer.WriteStringValue(Type);
 38            }
 8839            if (Location != null)
 40            {
 8841                writer.WritePropertyName("location");
 8842                writer.WriteStringValue(Location);
 43            }
 8844            if (Tags != null)
 45            {
 8846                writer.WritePropertyName("tags");
 8847                writer.WriteStartObject();
 35248                foreach (var item in Tags)
 49                {
 8850                    writer.WritePropertyName(item.Key);
 8851                    writer.WriteStringValue(item.Value);
 52                }
 8853                writer.WriteEndObject();
 54            }
 8855            writer.WritePropertyName("properties");
 8856            writer.WriteStartObject();
 8857            if (LocalNetworkAddressSpace != null)
 58            {
 8859                writer.WritePropertyName("localNetworkAddressSpace");
 8860                writer.WriteObjectValue(LocalNetworkAddressSpace);
 61            }
 8862            if (GatewayIpAddress != null)
 63            {
 8864                writer.WritePropertyName("gatewayIpAddress");
 8865                writer.WriteStringValue(GatewayIpAddress);
 66            }
 8867            if (Fqdn != null)
 68            {
 069                writer.WritePropertyName("fqdn");
 070                writer.WriteStringValue(Fqdn);
 71            }
 8872            if (BgpSettings != null)
 73            {
 1674                writer.WritePropertyName("bgpSettings");
 1675                writer.WriteObjectValue(BgpSettings);
 76            }
 8877            if (ResourceGuid != null)
 78            {
 5679                writer.WritePropertyName("resourceGuid");
 5680                writer.WriteStringValue(ResourceGuid);
 81            }
 8882            if (ProvisioningState != null)
 83            {
 5684                writer.WritePropertyName("provisioningState");
 5685                writer.WriteStringValue(ProvisioningState.Value.ToString());
 86            }
 8887            writer.WriteEndObject();
 8888            writer.WriteEndObject();
 8889        }
 90
 91        internal static LocalNetworkGateway DeserializeLocalNetworkGateway(JsonElement element)
 92        {
 10493            string etag = default;
 10494            string id = default;
 10495            string name = default;
 10496            string type = default;
 10497            string location = default;
 10498            IDictionary<string, string> tags = default;
 10499            AddressSpace localNetworkAddressSpace = default;
 104100            string gatewayIpAddress = default;
 104101            string fqdn = default;
 104102            BgpSettings bgpSettings = default;
 104103            string resourceGuid = default;
 104104            ProvisioningState? provisioningState = default;
 944105            foreach (var property in element.EnumerateObject())
 106            {
 368107                if (property.NameEquals("etag"))
 108                {
 44109                    if (property.Value.ValueKind == JsonValueKind.Null)
 110                    {
 111                        continue;
 112                    }
 44113                    etag = property.Value.GetString();
 44114                    continue;
 115                }
 324116                if (property.NameEquals("id"))
 117                {
 104118                    if (property.Value.ValueKind == JsonValueKind.Null)
 119                    {
 120                        continue;
 121                    }
 104122                    id = property.Value.GetString();
 104123                    continue;
 124                }
 220125                if (property.NameEquals("name"))
 126                {
 44127                    if (property.Value.ValueKind == JsonValueKind.Null)
 128                    {
 129                        continue;
 130                    }
 44131                    name = property.Value.GetString();
 44132                    continue;
 133                }
 176134                if (property.NameEquals("type"))
 135                {
 44136                    if (property.Value.ValueKind == JsonValueKind.Null)
 137                    {
 138                        continue;
 139                    }
 44140                    type = property.Value.GetString();
 44141                    continue;
 142                }
 132143                if (property.NameEquals("location"))
 144                {
 44145                    if (property.Value.ValueKind == JsonValueKind.Null)
 146                    {
 147                        continue;
 148                    }
 44149                    location = property.Value.GetString();
 44150                    continue;
 151                }
 88152                if (property.NameEquals("tags"))
 153                {
 44154                    if (property.Value.ValueKind == JsonValueKind.Null)
 155                    {
 156                        continue;
 157                    }
 44158                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 176159                    foreach (var property0 in property.Value.EnumerateObject())
 160                    {
 44161                        if (property0.Value.ValueKind == JsonValueKind.Null)
 162                        {
 0163                            dictionary.Add(property0.Name, null);
 164                        }
 165                        else
 166                        {
 44167                            dictionary.Add(property0.Name, property0.Value.GetString());
 168                        }
 169                    }
 44170                    tags = dictionary;
 44171                    continue;
 172                }
 44173                if (property.NameEquals("properties"))
 174                {
 456175                    foreach (var property0 in property.Value.EnumerateObject())
 176                    {
 184177                        if (property0.NameEquals("localNetworkAddressSpace"))
 178                        {
 44179                            if (property0.Value.ValueKind == JsonValueKind.Null)
 180                            {
 181                                continue;
 182                            }
 44183                            localNetworkAddressSpace = AddressSpace.DeserializeAddressSpace(property0.Value);
 44184                            continue;
 185                        }
 140186                        if (property0.NameEquals("gatewayIpAddress"))
 187                        {
 44188                            if (property0.Value.ValueKind == JsonValueKind.Null)
 189                            {
 190                                continue;
 191                            }
 44192                            gatewayIpAddress = property0.Value.GetString();
 44193                            continue;
 194                        }
 96195                        if (property0.NameEquals("fqdn"))
 196                        {
 0197                            if (property0.Value.ValueKind == JsonValueKind.Null)
 198                            {
 199                                continue;
 200                            }
 0201                            fqdn = property0.Value.GetString();
 0202                            continue;
 203                        }
 96204                        if (property0.NameEquals("bgpSettings"))
 205                        {
 8206                            if (property0.Value.ValueKind == JsonValueKind.Null)
 207                            {
 208                                continue;
 209                            }
 8210                            bgpSettings = BgpSettings.DeserializeBgpSettings(property0.Value);
 8211                            continue;
 212                        }
 88213                        if (property0.NameEquals("resourceGuid"))
 214                        {
 44215                            if (property0.Value.ValueKind == JsonValueKind.Null)
 216                            {
 217                                continue;
 218                            }
 44219                            resourceGuid = property0.Value.GetString();
 44220                            continue;
 221                        }
 44222                        if (property0.NameEquals("provisioningState"))
 223                        {
 44224                            if (property0.Value.ValueKind == JsonValueKind.Null)
 225                            {
 226                                continue;
 227                            }
 44228                            provisioningState = new ProvisioningState(property0.Value.GetString());
 229                            continue;
 230                        }
 231                    }
 232                    continue;
 233                }
 234            }
 104235            return new LocalNetworkGateway(id, name, type, location, tags, etag, localNetworkAddressSpace, gatewayIpAddr
 236        }
 237    }
 238}