< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_AutoScaleConfiguration()-0%100%
get_ExpressRouteConnections()-0%100%
get_ProvisioningState()-0%100%
get_VirtualHub()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeExpressRouteGateway(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRouteGateway.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> ExpressRoute gateway resource. </summary>
 13    public partial class ExpressRouteGateway : Resource
 14    {
 15        /// <summary> Initializes a new instance of ExpressRouteGateway. </summary>
 016        public ExpressRouteGateway()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ExpressRouteGateway. </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="autoScaleConfiguration"> Configuration for auto scaling. </param>
 28        /// <param name="expressRouteConnections"> List of ExpressRoute connections to the ExpressRoute gateway. </param
 29        /// <param name="provisioningState"> The provisioning state of the express route gateway resource. </param>
 30        /// <param name="virtualHub"> The Virtual Hub where the ExpressRoute gateway is or will be deployed. </param>
 031        internal ExpressRouteGateway(string id, string name, string type, string location, IDictionary<string, string> t
 32        {
 033            Etag = etag;
 034            AutoScaleConfiguration = autoScaleConfiguration;
 035            ExpressRouteConnections = expressRouteConnections;
 036            ProvisioningState = provisioningState;
 037            VirtualHub = virtualHub;
 038        }
 39
 40        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 041        public string Etag { get; }
 42        /// <summary> Configuration for auto scaling. </summary>
 043        public ExpressRouteGatewayPropertiesAutoScaleConfiguration AutoScaleConfiguration { get; set; }
 44        /// <summary> List of ExpressRoute connections to the ExpressRoute gateway. </summary>
 045        public IList<ExpressRouteConnection> ExpressRouteConnections { get; }
 46        /// <summary> The provisioning state of the express route gateway resource. </summary>
 047        public ProvisioningState? ProvisioningState { get; }
 48        /// <summary> The Virtual Hub where the ExpressRoute gateway is or will be deployed. </summary>
 049        public VirtualHubId VirtualHub { get; set; }
 50    }
 51}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRouteGateway.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 ExpressRouteGateway : 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 (AutoScaleConfiguration != null)
 58            {
 059                writer.WritePropertyName("autoScaleConfiguration");
 060                writer.WriteObjectValue(AutoScaleConfiguration);
 61            }
 062            if (ExpressRouteConnections != null)
 63            {
 064                writer.WritePropertyName("expressRouteConnections");
 065                writer.WriteStartArray();
 066                foreach (var item in ExpressRouteConnections)
 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 (VirtualHub != null)
 78            {
 079                writer.WritePropertyName("virtualHub");
 080                writer.WriteObjectValue(VirtualHub);
 81            }
 082            writer.WriteEndObject();
 083            writer.WriteEndObject();
 084        }
 85
 86        internal static ExpressRouteGateway DeserializeExpressRouteGateway(JsonElement element)
 87        {
 088            string etag = default;
 089            string id = default;
 090            string name = default;
 091            string type = default;
 092            string location = default;
 093            IDictionary<string, string> tags = default;
 094            ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration = default;
 095            IList<ExpressRouteConnection> expressRouteConnections = default;
 096            ProvisioningState? provisioningState = default;
 097            VirtualHubId virtualHub = default;
 098            foreach (var property in element.EnumerateObject())
 99            {
 0100                if (property.NameEquals("etag"))
 101                {
 0102                    if (property.Value.ValueKind == JsonValueKind.Null)
 103                    {
 104                        continue;
 105                    }
 0106                    etag = property.Value.GetString();
 0107                    continue;
 108                }
 0109                if (property.NameEquals("id"))
 110                {
 0111                    if (property.Value.ValueKind == JsonValueKind.Null)
 112                    {
 113                        continue;
 114                    }
 0115                    id = property.Value.GetString();
 0116                    continue;
 117                }
 0118                if (property.NameEquals("name"))
 119                {
 0120                    if (property.Value.ValueKind == JsonValueKind.Null)
 121                    {
 122                        continue;
 123                    }
 0124                    name = property.Value.GetString();
 0125                    continue;
 126                }
 0127                if (property.NameEquals("type"))
 128                {
 0129                    if (property.Value.ValueKind == JsonValueKind.Null)
 130                    {
 131                        continue;
 132                    }
 0133                    type = property.Value.GetString();
 0134                    continue;
 135                }
 0136                if (property.NameEquals("location"))
 137                {
 0138                    if (property.Value.ValueKind == JsonValueKind.Null)
 139                    {
 140                        continue;
 141                    }
 0142                    location = property.Value.GetString();
 0143                    continue;
 144                }
 0145                if (property.NameEquals("tags"))
 146                {
 0147                    if (property.Value.ValueKind == JsonValueKind.Null)
 148                    {
 149                        continue;
 150                    }
 0151                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0152                    foreach (var property0 in property.Value.EnumerateObject())
 153                    {
 0154                        if (property0.Value.ValueKind == JsonValueKind.Null)
 155                        {
 0156                            dictionary.Add(property0.Name, null);
 157                        }
 158                        else
 159                        {
 0160                            dictionary.Add(property0.Name, property0.Value.GetString());
 161                        }
 162                    }
 0163                    tags = dictionary;
 0164                    continue;
 165                }
 0166                if (property.NameEquals("properties"))
 167                {
 0168                    foreach (var property0 in property.Value.EnumerateObject())
 169                    {
 0170                        if (property0.NameEquals("autoScaleConfiguration"))
 171                        {
 0172                            if (property0.Value.ValueKind == JsonValueKind.Null)
 173                            {
 174                                continue;
 175                            }
 0176                            autoScaleConfiguration = ExpressRouteGatewayPropertiesAutoScaleConfiguration.DeserializeExpr
 0177                            continue;
 178                        }
 0179                        if (property0.NameEquals("expressRouteConnections"))
 180                        {
 0181                            if (property0.Value.ValueKind == JsonValueKind.Null)
 182                            {
 183                                continue;
 184                            }
 0185                            List<ExpressRouteConnection> array = new List<ExpressRouteConnection>();
 0186                            foreach (var item in property0.Value.EnumerateArray())
 187                            {
 0188                                if (item.ValueKind == JsonValueKind.Null)
 189                                {
 0190                                    array.Add(null);
 191                                }
 192                                else
 193                                {
 0194                                    array.Add(ExpressRouteConnection.DeserializeExpressRouteConnection(item));
 195                                }
 196                            }
 0197                            expressRouteConnections = array;
 0198                            continue;
 199                        }
 0200                        if (property0.NameEquals("provisioningState"))
 201                        {
 0202                            if (property0.Value.ValueKind == JsonValueKind.Null)
 203                            {
 204                                continue;
 205                            }
 0206                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0207                            continue;
 208                        }
 0209                        if (property0.NameEquals("virtualHub"))
 210                        {
 0211                            if (property0.Value.ValueKind == JsonValueKind.Null)
 212                            {
 213                                continue;
 214                            }
 0215                            virtualHub = VirtualHubId.DeserializeVirtualHubId(property0.Value);
 216                            continue;
 217                        }
 218                    }
 219                    continue;
 220                }
 221            }
 0222            return new ExpressRouteGateway(id, name, type, location, tags, etag, autoScaleConfiguration, expressRouteCon
 223        }
 224    }
 225}