< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Identity()-0%100%
get_Sku()-0%100%
get_Etag()-0%100%
get_BootStrapConfigurationBlob()-0%100%
get_VirtualHub()-0%100%
get_CloudInitConfigurationBlob()-0%100%
get_VirtualApplianceAsn()-0%100%
get_VirtualApplianceNics()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeNetworkVirtualAppliance(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkVirtualAppliance.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> NetworkVirtualAppliance Resource. </summary>
 13    public partial class NetworkVirtualAppliance : Resource
 14    {
 15        /// <summary> Initializes a new instance of NetworkVirtualAppliance. </summary>
 016        public NetworkVirtualAppliance()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of NetworkVirtualAppliance. </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="identity"> The service principal that has read access to cloud-init and config blob. </param>
 27        /// <param name="sku"> Network Virtual Appliance SKU. </param>
 28        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 29        /// <param name="bootStrapConfigurationBlob"> BootStrapConfigurationBlob storage URLs. </param>
 30        /// <param name="virtualHub"> The Virtual Hub where Network Virtual Appliance is being deployed. </param>
 31        /// <param name="cloudInitConfigurationBlob"> CloudInitConfigurationBlob storage URLs. </param>
 32        /// <param name="virtualApplianceAsn"> VirtualAppliance ASN. </param>
 33        /// <param name="virtualApplianceNics"> List of Virtual Appliance Network Interfaces. </param>
 34        /// <param name="provisioningState"> The provisioning state of the resource. </param>
 035        internal NetworkVirtualAppliance(string id, string name, string type, string location, IDictionary<string, strin
 36        {
 037            Identity = identity;
 038            Sku = sku;
 039            Etag = etag;
 040            BootStrapConfigurationBlob = bootStrapConfigurationBlob;
 041            VirtualHub = virtualHub;
 042            CloudInitConfigurationBlob = cloudInitConfigurationBlob;
 043            VirtualApplianceAsn = virtualApplianceAsn;
 044            VirtualApplianceNics = virtualApplianceNics;
 045            ProvisioningState = provisioningState;
 046        }
 47
 48        /// <summary> The service principal that has read access to cloud-init and config blob. </summary>
 049        public ManagedServiceIdentity Identity { get; set; }
 50        /// <summary> Network Virtual Appliance SKU. </summary>
 051        public VirtualApplianceSkuProperties Sku { get; set; }
 52        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 053        public string Etag { get; }
 54        /// <summary> BootStrapConfigurationBlob storage URLs. </summary>
 055        public IList<string> BootStrapConfigurationBlob { get; set; }
 56        /// <summary> The Virtual Hub where Network Virtual Appliance is being deployed. </summary>
 057        public SubResource VirtualHub { get; set; }
 58        /// <summary> CloudInitConfigurationBlob storage URLs. </summary>
 059        public IList<string> CloudInitConfigurationBlob { get; set; }
 60        /// <summary> VirtualAppliance ASN. </summary>
 061        public long? VirtualApplianceAsn { get; set; }
 62        /// <summary> List of Virtual Appliance Network Interfaces. </summary>
 063        public IList<VirtualApplianceNicProperties> VirtualApplianceNics { get; }
 64        /// <summary> The provisioning state of the resource. </summary>
 065        public ProvisioningState? ProvisioningState { get; }
 66    }
 67}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkVirtualAppliance.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 NetworkVirtualAppliance : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Identity != null)
 20            {
 021                writer.WritePropertyName("identity");
 022                writer.WriteObjectValue(Identity);
 23            }
 024            if (Sku != null)
 25            {
 026                writer.WritePropertyName("sku");
 027                writer.WriteObjectValue(Sku);
 28            }
 029            if (Etag != null)
 30            {
 031                writer.WritePropertyName("etag");
 032                writer.WriteStringValue(Etag);
 33            }
 034            if (Id != null)
 35            {
 036                writer.WritePropertyName("id");
 037                writer.WriteStringValue(Id);
 38            }
 039            if (Name != null)
 40            {
 041                writer.WritePropertyName("name");
 042                writer.WriteStringValue(Name);
 43            }
 044            if (Type != null)
 45            {
 046                writer.WritePropertyName("type");
 047                writer.WriteStringValue(Type);
 48            }
 049            if (Location != null)
 50            {
 051                writer.WritePropertyName("location");
 052                writer.WriteStringValue(Location);
 53            }
 054            if (Tags != null)
 55            {
 056                writer.WritePropertyName("tags");
 057                writer.WriteStartObject();
 058                foreach (var item in Tags)
 59                {
 060                    writer.WritePropertyName(item.Key);
 061                    writer.WriteStringValue(item.Value);
 62                }
 063                writer.WriteEndObject();
 64            }
 065            writer.WritePropertyName("properties");
 066            writer.WriteStartObject();
 067            if (BootStrapConfigurationBlob != null)
 68            {
 069                writer.WritePropertyName("bootStrapConfigurationBlob");
 070                writer.WriteStartArray();
 071                foreach (var item in BootStrapConfigurationBlob)
 72                {
 073                    writer.WriteStringValue(item);
 74                }
 075                writer.WriteEndArray();
 76            }
 077            if (VirtualHub != null)
 78            {
 079                writer.WritePropertyName("virtualHub");
 080                writer.WriteObjectValue(VirtualHub);
 81            }
 082            if (CloudInitConfigurationBlob != null)
 83            {
 084                writer.WritePropertyName("cloudInitConfigurationBlob");
 085                writer.WriteStartArray();
 086                foreach (var item in CloudInitConfigurationBlob)
 87                {
 088                    writer.WriteStringValue(item);
 89                }
 090                writer.WriteEndArray();
 91            }
 092            if (VirtualApplianceAsn != null)
 93            {
 094                writer.WritePropertyName("virtualApplianceAsn");
 095                writer.WriteNumberValue(VirtualApplianceAsn.Value);
 96            }
 097            if (VirtualApplianceNics != null)
 98            {
 099                writer.WritePropertyName("virtualApplianceNics");
 0100                writer.WriteStartArray();
 0101                foreach (var item in VirtualApplianceNics)
 102                {
 0103                    writer.WriteObjectValue(item);
 104                }
 0105                writer.WriteEndArray();
 106            }
 0107            if (ProvisioningState != null)
 108            {
 0109                writer.WritePropertyName("provisioningState");
 0110                writer.WriteStringValue(ProvisioningState.Value.ToString());
 111            }
 0112            writer.WriteEndObject();
 0113            writer.WriteEndObject();
 0114        }
 115
 116        internal static NetworkVirtualAppliance DeserializeNetworkVirtualAppliance(JsonElement element)
 117        {
 0118            ManagedServiceIdentity identity = default;
 0119            VirtualApplianceSkuProperties sku = default;
 0120            string etag = default;
 0121            string id = default;
 0122            string name = default;
 0123            string type = default;
 0124            string location = default;
 0125            IDictionary<string, string> tags = default;
 0126            IList<string> bootStrapConfigurationBlob = default;
 0127            SubResource virtualHub = default;
 0128            IList<string> cloudInitConfigurationBlob = default;
 0129            long? virtualApplianceAsn = default;
 0130            IList<VirtualApplianceNicProperties> virtualApplianceNics = default;
 0131            ProvisioningState? provisioningState = default;
 0132            foreach (var property in element.EnumerateObject())
 133            {
 0134                if (property.NameEquals("identity"))
 135                {
 0136                    if (property.Value.ValueKind == JsonValueKind.Null)
 137                    {
 138                        continue;
 139                    }
 0140                    identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value);
 0141                    continue;
 142                }
 0143                if (property.NameEquals("sku"))
 144                {
 0145                    if (property.Value.ValueKind == JsonValueKind.Null)
 146                    {
 147                        continue;
 148                    }
 0149                    sku = VirtualApplianceSkuProperties.DeserializeVirtualApplianceSkuProperties(property.Value);
 0150                    continue;
 151                }
 0152                if (property.NameEquals("etag"))
 153                {
 0154                    if (property.Value.ValueKind == JsonValueKind.Null)
 155                    {
 156                        continue;
 157                    }
 0158                    etag = property.Value.GetString();
 0159                    continue;
 160                }
 0161                if (property.NameEquals("id"))
 162                {
 0163                    if (property.Value.ValueKind == JsonValueKind.Null)
 164                    {
 165                        continue;
 166                    }
 0167                    id = property.Value.GetString();
 0168                    continue;
 169                }
 0170                if (property.NameEquals("name"))
 171                {
 0172                    if (property.Value.ValueKind == JsonValueKind.Null)
 173                    {
 174                        continue;
 175                    }
 0176                    name = property.Value.GetString();
 0177                    continue;
 178                }
 0179                if (property.NameEquals("type"))
 180                {
 0181                    if (property.Value.ValueKind == JsonValueKind.Null)
 182                    {
 183                        continue;
 184                    }
 0185                    type = property.Value.GetString();
 0186                    continue;
 187                }
 0188                if (property.NameEquals("location"))
 189                {
 0190                    if (property.Value.ValueKind == JsonValueKind.Null)
 191                    {
 192                        continue;
 193                    }
 0194                    location = property.Value.GetString();
 0195                    continue;
 196                }
 0197                if (property.NameEquals("tags"))
 198                {
 0199                    if (property.Value.ValueKind == JsonValueKind.Null)
 200                    {
 201                        continue;
 202                    }
 0203                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0204                    foreach (var property0 in property.Value.EnumerateObject())
 205                    {
 0206                        if (property0.Value.ValueKind == JsonValueKind.Null)
 207                        {
 0208                            dictionary.Add(property0.Name, null);
 209                        }
 210                        else
 211                        {
 0212                            dictionary.Add(property0.Name, property0.Value.GetString());
 213                        }
 214                    }
 0215                    tags = dictionary;
 0216                    continue;
 217                }
 0218                if (property.NameEquals("properties"))
 219                {
 0220                    foreach (var property0 in property.Value.EnumerateObject())
 221                    {
 0222                        if (property0.NameEquals("bootStrapConfigurationBlob"))
 223                        {
 0224                            if (property0.Value.ValueKind == JsonValueKind.Null)
 225                            {
 226                                continue;
 227                            }
 0228                            List<string> array = new List<string>();
 0229                            foreach (var item in property0.Value.EnumerateArray())
 230                            {
 0231                                if (item.ValueKind == JsonValueKind.Null)
 232                                {
 0233                                    array.Add(null);
 234                                }
 235                                else
 236                                {
 0237                                    array.Add(item.GetString());
 238                                }
 239                            }
 0240                            bootStrapConfigurationBlob = array;
 0241                            continue;
 242                        }
 0243                        if (property0.NameEquals("virtualHub"))
 244                        {
 0245                            if (property0.Value.ValueKind == JsonValueKind.Null)
 246                            {
 247                                continue;
 248                            }
 0249                            virtualHub = SubResource.DeserializeSubResource(property0.Value);
 0250                            continue;
 251                        }
 0252                        if (property0.NameEquals("cloudInitConfigurationBlob"))
 253                        {
 0254                            if (property0.Value.ValueKind == JsonValueKind.Null)
 255                            {
 256                                continue;
 257                            }
 0258                            List<string> array = new List<string>();
 0259                            foreach (var item in property0.Value.EnumerateArray())
 260                            {
 0261                                if (item.ValueKind == JsonValueKind.Null)
 262                                {
 0263                                    array.Add(null);
 264                                }
 265                                else
 266                                {
 0267                                    array.Add(item.GetString());
 268                                }
 269                            }
 0270                            cloudInitConfigurationBlob = array;
 0271                            continue;
 272                        }
 0273                        if (property0.NameEquals("virtualApplianceAsn"))
 274                        {
 0275                            if (property0.Value.ValueKind == JsonValueKind.Null)
 276                            {
 277                                continue;
 278                            }
 0279                            virtualApplianceAsn = property0.Value.GetInt64();
 0280                            continue;
 281                        }
 0282                        if (property0.NameEquals("virtualApplianceNics"))
 283                        {
 0284                            if (property0.Value.ValueKind == JsonValueKind.Null)
 285                            {
 286                                continue;
 287                            }
 0288                            List<VirtualApplianceNicProperties> array = new List<VirtualApplianceNicProperties>();
 0289                            foreach (var item in property0.Value.EnumerateArray())
 290                            {
 0291                                if (item.ValueKind == JsonValueKind.Null)
 292                                {
 0293                                    array.Add(null);
 294                                }
 295                                else
 296                                {
 0297                                    array.Add(VirtualApplianceNicProperties.DeserializeVirtualApplianceNicProperties(ite
 298                                }
 299                            }
 0300                            virtualApplianceNics = array;
 0301                            continue;
 302                        }
 0303                        if (property0.NameEquals("provisioningState"))
 304                        {
 0305                            if (property0.Value.ValueKind == JsonValueKind.Null)
 306                            {
 307                                continue;
 308                            }
 0309                            provisioningState = new ProvisioningState(property0.Value.GetString());
 310                            continue;
 311                        }
 312                    }
 313                    continue;
 314                }
 315            }
 0316            return new NetworkVirtualAppliance(id, name, type, location, tags, identity, sku, etag, bootStrapConfigurati
 317        }
 318    }
 319}