< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_RemoteVirtualNetwork()-0%100%
get_AllowHubToRemoteVnetTransit()-0%100%
get_AllowRemoteVnetToUseHubVnetGateways()-0%100%
get_EnableInternetSecurity()-0%100%
get_RoutingConfiguration()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeHubVirtualNetworkConnection(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\HubVirtualNetworkConnection.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> HubVirtualNetworkConnection Resource. </summary>
 11    public partial class HubVirtualNetworkConnection : SubResource
 12    {
 13        /// <summary> Initializes a new instance of HubVirtualNetworkConnection. </summary>
 014        public HubVirtualNetworkConnection()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of HubVirtualNetworkConnection. </summary>
 19        /// <param name="id"> Resource ID. </param>
 20        /// <param name="name"> The name of the resource that is unique within a resource group. This name can be used t
 21        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 22        /// <param name="remoteVirtualNetwork"> Reference to the remote virtual network. </param>
 23        /// <param name="allowHubToRemoteVnetTransit"> VirtualHub to RemoteVnet transit to enabled or not. </param>
 24        /// <param name="allowRemoteVnetToUseHubVnetGateways"> Allow RemoteVnet to use Virtual Hub&apos;s gateways. </pa
 25        /// <param name="enableInternetSecurity"> Enable internet security. </param>
 26        /// <param name="routingConfiguration"> The Routing Configuration indicating the associated and propagated route
 27        /// <param name="provisioningState"> The provisioning state of the hub virtual network connection resource. </pa
 028        internal HubVirtualNetworkConnection(string id, string name, string etag, SubResource remoteVirtualNetwork, bool
 29        {
 030            Name = name;
 031            Etag = etag;
 032            RemoteVirtualNetwork = remoteVirtualNetwork;
 033            AllowHubToRemoteVnetTransit = allowHubToRemoteVnetTransit;
 034            AllowRemoteVnetToUseHubVnetGateways = allowRemoteVnetToUseHubVnetGateways;
 035            EnableInternetSecurity = enableInternetSecurity;
 036            RoutingConfiguration = routingConfiguration;
 037            ProvisioningState = provisioningState;
 038        }
 39
 40        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 041        public string Name { get; set; }
 42        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 043        public string Etag { get; }
 44        /// <summary> Reference to the remote virtual network. </summary>
 045        public SubResource RemoteVirtualNetwork { get; set; }
 46        /// <summary> VirtualHub to RemoteVnet transit to enabled or not. </summary>
 047        public bool? AllowHubToRemoteVnetTransit { get; set; }
 48        /// <summary> Allow RemoteVnet to use Virtual Hub&apos;s gateways. </summary>
 049        public bool? AllowRemoteVnetToUseHubVnetGateways { get; set; }
 50        /// <summary> Enable internet security. </summary>
 051        public bool? EnableInternetSecurity { get; set; }
 52        /// <summary> The Routing Configuration indicating the associated and propagated route tables on this connection
 053        public RoutingConfiguration RoutingConfiguration { get; set; }
 54        /// <summary> The provisioning state of the hub virtual network connection resource. </summary>
 055        public ProvisioningState? ProvisioningState { get; }
 56    }
 57}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\HubVirtualNetworkConnection.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 HubVirtualNetworkConnection : 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 (Id != null)
 29            {
 030                writer.WritePropertyName("id");
 031                writer.WriteStringValue(Id);
 32            }
 033            writer.WritePropertyName("properties");
 034            writer.WriteStartObject();
 035            if (RemoteVirtualNetwork != null)
 36            {
 037                writer.WritePropertyName("remoteVirtualNetwork");
 038                writer.WriteObjectValue(RemoteVirtualNetwork);
 39            }
 040            if (AllowHubToRemoteVnetTransit != null)
 41            {
 042                writer.WritePropertyName("allowHubToRemoteVnetTransit");
 043                writer.WriteBooleanValue(AllowHubToRemoteVnetTransit.Value);
 44            }
 045            if (AllowRemoteVnetToUseHubVnetGateways != null)
 46            {
 047                writer.WritePropertyName("allowRemoteVnetToUseHubVnetGateways");
 048                writer.WriteBooleanValue(AllowRemoteVnetToUseHubVnetGateways.Value);
 49            }
 050            if (EnableInternetSecurity != null)
 51            {
 052                writer.WritePropertyName("enableInternetSecurity");
 053                writer.WriteBooleanValue(EnableInternetSecurity.Value);
 54            }
 055            if (RoutingConfiguration != null)
 56            {
 057                writer.WritePropertyName("routingConfiguration");
 058                writer.WriteObjectValue(RoutingConfiguration);
 59            }
 060            if (ProvisioningState != null)
 61            {
 062                writer.WritePropertyName("provisioningState");
 063                writer.WriteStringValue(ProvisioningState.Value.ToString());
 64            }
 065            writer.WriteEndObject();
 066            writer.WriteEndObject();
 067        }
 68
 69        internal static HubVirtualNetworkConnection DeserializeHubVirtualNetworkConnection(JsonElement element)
 70        {
 071            string name = default;
 072            string etag = default;
 073            string id = default;
 074            SubResource remoteVirtualNetwork = default;
 075            bool? allowHubToRemoteVnetTransit = default;
 076            bool? allowRemoteVnetToUseHubVnetGateways = default;
 077            bool? enableInternetSecurity = default;
 078            RoutingConfiguration routingConfiguration = default;
 079            ProvisioningState? provisioningState = default;
 080            foreach (var property in element.EnumerateObject())
 81            {
 082                if (property.NameEquals("name"))
 83                {
 084                    if (property.Value.ValueKind == JsonValueKind.Null)
 85                    {
 86                        continue;
 87                    }
 088                    name = property.Value.GetString();
 089                    continue;
 90                }
 091                if (property.NameEquals("etag"))
 92                {
 093                    if (property.Value.ValueKind == JsonValueKind.Null)
 94                    {
 95                        continue;
 96                    }
 097                    etag = property.Value.GetString();
 098                    continue;
 99                }
 0100                if (property.NameEquals("id"))
 101                {
 0102                    if (property.Value.ValueKind == JsonValueKind.Null)
 103                    {
 104                        continue;
 105                    }
 0106                    id = property.Value.GetString();
 0107                    continue;
 108                }
 0109                if (property.NameEquals("properties"))
 110                {
 0111                    foreach (var property0 in property.Value.EnumerateObject())
 112                    {
 0113                        if (property0.NameEquals("remoteVirtualNetwork"))
 114                        {
 0115                            if (property0.Value.ValueKind == JsonValueKind.Null)
 116                            {
 117                                continue;
 118                            }
 0119                            remoteVirtualNetwork = DeserializeSubResource(property0.Value);
 0120                            continue;
 121                        }
 0122                        if (property0.NameEquals("allowHubToRemoteVnetTransit"))
 123                        {
 0124                            if (property0.Value.ValueKind == JsonValueKind.Null)
 125                            {
 126                                continue;
 127                            }
 0128                            allowHubToRemoteVnetTransit = property0.Value.GetBoolean();
 0129                            continue;
 130                        }
 0131                        if (property0.NameEquals("allowRemoteVnetToUseHubVnetGateways"))
 132                        {
 0133                            if (property0.Value.ValueKind == JsonValueKind.Null)
 134                            {
 135                                continue;
 136                            }
 0137                            allowRemoteVnetToUseHubVnetGateways = property0.Value.GetBoolean();
 0138                            continue;
 139                        }
 0140                        if (property0.NameEquals("enableInternetSecurity"))
 141                        {
 0142                            if (property0.Value.ValueKind == JsonValueKind.Null)
 143                            {
 144                                continue;
 145                            }
 0146                            enableInternetSecurity = property0.Value.GetBoolean();
 0147                            continue;
 148                        }
 0149                        if (property0.NameEquals("routingConfiguration"))
 150                        {
 0151                            if (property0.Value.ValueKind == JsonValueKind.Null)
 152                            {
 153                                continue;
 154                            }
 0155                            routingConfiguration = RoutingConfiguration.DeserializeRoutingConfiguration(property0.Value)
 0156                            continue;
 157                        }
 0158                        if (property0.NameEquals("provisioningState"))
 159                        {
 0160                            if (property0.Value.ValueKind == JsonValueKind.Null)
 161                            {
 162                                continue;
 163                            }
 0164                            provisioningState = new ProvisioningState(property0.Value.GetString());
 165                            continue;
 166                        }
 167                    }
 168                    continue;
 169                }
 170            }
 0171            return new HubVirtualNetworkConnection(id, name, etag, remoteVirtualNetwork, allowHubToRemoteVnetTransit, al
 172        }
 173    }
 174}