< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_IpConfigurations()-0%100%
get_DnsName()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeBastionHost(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BastionHost.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> Bastion Host resource. </summary>
 13    public partial class BastionHost : Resource
 14    {
 15        /// <summary> Initializes a new instance of BastionHost. </summary>
 016        public BastionHost()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of BastionHost. </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="ipConfigurations"> IP configuration of the Bastion Host resource. </param>
 28        /// <param name="dnsName"> FQDN for the endpoint on which bastion host is accessible. </param>
 29        /// <param name="provisioningState"> The provisioning state of the bastion host resource. </param>
 030        internal BastionHost(string id, string name, string type, string location, IDictionary<string, string> tags, str
 31        {
 032            Etag = etag;
 033            IpConfigurations = ipConfigurations;
 034            DnsName = dnsName;
 035            ProvisioningState = provisioningState;
 036        }
 37
 38        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 039        public string Etag { get; }
 40        /// <summary> IP configuration of the Bastion Host resource. </summary>
 041        public IList<BastionHostIPConfiguration> IpConfigurations { get; set; }
 42        /// <summary> FQDN for the endpoint on which bastion host is accessible. </summary>
 043        public string DnsName { get; set; }
 44        /// <summary> The provisioning state of the bastion host resource. </summary>
 045        public ProvisioningState? ProvisioningState { get; }
 46    }
 47}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BastionHost.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 BastionHost : 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 (IpConfigurations != null)
 58            {
 059                writer.WritePropertyName("ipConfigurations");
 060                writer.WriteStartArray();
 061                foreach (var item in IpConfigurations)
 62                {
 063                    writer.WriteObjectValue(item);
 64                }
 065                writer.WriteEndArray();
 66            }
 067            if (DnsName != null)
 68            {
 069                writer.WritePropertyName("dnsName");
 070                writer.WriteStringValue(DnsName);
 71            }
 072            if (ProvisioningState != null)
 73            {
 074                writer.WritePropertyName("provisioningState");
 075                writer.WriteStringValue(ProvisioningState.Value.ToString());
 76            }
 077            writer.WriteEndObject();
 078            writer.WriteEndObject();
 079        }
 80
 81        internal static BastionHost DeserializeBastionHost(JsonElement element)
 82        {
 083            string etag = default;
 084            string id = default;
 085            string name = default;
 086            string type = default;
 087            string location = default;
 088            IDictionary<string, string> tags = default;
 089            IList<BastionHostIPConfiguration> ipConfigurations = default;
 090            string dnsName = default;
 091            ProvisioningState? provisioningState = default;
 092            foreach (var property in element.EnumerateObject())
 93            {
 094                if (property.NameEquals("etag"))
 95                {
 096                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 0100                    etag = property.Value.GetString();
 0101                    continue;
 102                }
 0103                if (property.NameEquals("id"))
 104                {
 0105                    if (property.Value.ValueKind == JsonValueKind.Null)
 106                    {
 107                        continue;
 108                    }
 0109                    id = property.Value.GetString();
 0110                    continue;
 111                }
 0112                if (property.NameEquals("name"))
 113                {
 0114                    if (property.Value.ValueKind == JsonValueKind.Null)
 115                    {
 116                        continue;
 117                    }
 0118                    name = property.Value.GetString();
 0119                    continue;
 120                }
 0121                if (property.NameEquals("type"))
 122                {
 0123                    if (property.Value.ValueKind == JsonValueKind.Null)
 124                    {
 125                        continue;
 126                    }
 0127                    type = property.Value.GetString();
 0128                    continue;
 129                }
 0130                if (property.NameEquals("location"))
 131                {
 0132                    if (property.Value.ValueKind == JsonValueKind.Null)
 133                    {
 134                        continue;
 135                    }
 0136                    location = property.Value.GetString();
 0137                    continue;
 138                }
 0139                if (property.NameEquals("tags"))
 140                {
 0141                    if (property.Value.ValueKind == JsonValueKind.Null)
 142                    {
 143                        continue;
 144                    }
 0145                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0146                    foreach (var property0 in property.Value.EnumerateObject())
 147                    {
 0148                        if (property0.Value.ValueKind == JsonValueKind.Null)
 149                        {
 0150                            dictionary.Add(property0.Name, null);
 151                        }
 152                        else
 153                        {
 0154                            dictionary.Add(property0.Name, property0.Value.GetString());
 155                        }
 156                    }
 0157                    tags = dictionary;
 0158                    continue;
 159                }
 0160                if (property.NameEquals("properties"))
 161                {
 0162                    foreach (var property0 in property.Value.EnumerateObject())
 163                    {
 0164                        if (property0.NameEquals("ipConfigurations"))
 165                        {
 0166                            if (property0.Value.ValueKind == JsonValueKind.Null)
 167                            {
 168                                continue;
 169                            }
 0170                            List<BastionHostIPConfiguration> array = new List<BastionHostIPConfiguration>();
 0171                            foreach (var item in property0.Value.EnumerateArray())
 172                            {
 0173                                if (item.ValueKind == JsonValueKind.Null)
 174                                {
 0175                                    array.Add(null);
 176                                }
 177                                else
 178                                {
 0179                                    array.Add(BastionHostIPConfiguration.DeserializeBastionHostIPConfiguration(item));
 180                                }
 181                            }
 0182                            ipConfigurations = array;
 0183                            continue;
 184                        }
 0185                        if (property0.NameEquals("dnsName"))
 186                        {
 0187                            if (property0.Value.ValueKind == JsonValueKind.Null)
 188                            {
 189                                continue;
 190                            }
 0191                            dnsName = property0.Value.GetString();
 0192                            continue;
 193                        }
 0194                        if (property0.NameEquals("provisioningState"))
 195                        {
 0196                            if (property0.Value.ValueKind == JsonValueKind.Null)
 197                            {
 198                                continue;
 199                            }
 0200                            provisioningState = new ProvisioningState(property0.Value.GetString());
 201                            continue;
 202                        }
 203                    }
 204                    continue;
 205                }
 206            }
 0207            return new BastionHost(id, name, type, location, tags, etag, ipConfigurations, dnsName, provisioningState);
 208        }
 209    }
 210}