< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_Type()-0%100%
get_Subnet()-0%100%
get_PublicIPAddress()-0%100%
get_ProvisioningState()-0%100%
get_PrivateIPAllocationMethod()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeBastionHostIPConfiguration(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BastionHostIPConfiguration.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> IP configuration of an Bastion Host. </summary>
 11    public partial class BastionHostIPConfiguration : SubResource
 12    {
 13        /// <summary> Initializes a new instance of BastionHostIPConfiguration. </summary>
 014        public BastionHostIPConfiguration()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of BastionHostIPConfiguration. </summary>
 19        /// <param name="id"> Resource ID. </param>
 20        /// <param name="name"> Name of the resource that is unique within a resource group. This name can be used to ac
 21        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 22        /// <param name="type"> Ip configuration type. </param>
 23        /// <param name="subnet"> Reference of the subnet resource. </param>
 24        /// <param name="publicIPAddress"> Reference of the PublicIP resource. </param>
 25        /// <param name="provisioningState"> The provisioning state of the bastion host IP configuration resource. </par
 26        /// <param name="privateIPAllocationMethod"> Private IP allocation method. </param>
 027        internal BastionHostIPConfiguration(string id, string name, string etag, string type, SubResource subnet, SubRes
 28        {
 029            Name = name;
 030            Etag = etag;
 031            Type = type;
 032            Subnet = subnet;
 033            PublicIPAddress = publicIPAddress;
 034            ProvisioningState = provisioningState;
 035            PrivateIPAllocationMethod = privateIPAllocationMethod;
 036        }
 37
 38        /// <summary> Name of the resource that is unique within a resource group. This name can be used to access the r
 039        public string Name { get; set; }
 40        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 041        public string Etag { get; }
 42        /// <summary> Ip configuration type. </summary>
 043        public string Type { get; }
 44        /// <summary> Reference of the subnet resource. </summary>
 045        public SubResource Subnet { get; set; }
 46        /// <summary> Reference of the PublicIP resource. </summary>
 047        public SubResource PublicIPAddress { get; set; }
 48        /// <summary> The provisioning state of the bastion host IP configuration resource. </summary>
 049        public ProvisioningState? ProvisioningState { get; }
 50        /// <summary> Private IP allocation method. </summary>
 051        public IPAllocationMethod? PrivateIPAllocationMethod { get; set; }
 52    }
 53}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BastionHostIPConfiguration.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 BastionHostIPConfiguration : 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 (Type != null)
 29            {
 030                writer.WritePropertyName("type");
 031                writer.WriteStringValue(Type);
 32            }
 033            if (Id != null)
 34            {
 035                writer.WritePropertyName("id");
 036                writer.WriteStringValue(Id);
 37            }
 038            writer.WritePropertyName("properties");
 039            writer.WriteStartObject();
 040            if (Subnet != null)
 41            {
 042                writer.WritePropertyName("subnet");
 043                writer.WriteObjectValue(Subnet);
 44            }
 045            if (PublicIPAddress != null)
 46            {
 047                writer.WritePropertyName("publicIPAddress");
 048                writer.WriteObjectValue(PublicIPAddress);
 49            }
 050            if (ProvisioningState != null)
 51            {
 052                writer.WritePropertyName("provisioningState");
 053                writer.WriteStringValue(ProvisioningState.Value.ToString());
 54            }
 055            if (PrivateIPAllocationMethod != null)
 56            {
 057                writer.WritePropertyName("privateIPAllocationMethod");
 058                writer.WriteStringValue(PrivateIPAllocationMethod.Value.ToString());
 59            }
 060            writer.WriteEndObject();
 061            writer.WriteEndObject();
 062        }
 63
 64        internal static BastionHostIPConfiguration DeserializeBastionHostIPConfiguration(JsonElement element)
 65        {
 066            string name = default;
 067            string etag = default;
 068            string type = default;
 069            string id = default;
 070            SubResource subnet = default;
 071            SubResource publicIPAddress = default;
 072            ProvisioningState? provisioningState = default;
 073            IPAllocationMethod? privateIPAllocationMethod = default;
 074            foreach (var property in element.EnumerateObject())
 75            {
 076                if (property.NameEquals("name"))
 77                {
 078                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 082                    name = property.Value.GetString();
 083                    continue;
 84                }
 085                if (property.NameEquals("etag"))
 86                {
 087                    if (property.Value.ValueKind == JsonValueKind.Null)
 88                    {
 89                        continue;
 90                    }
 091                    etag = property.Value.GetString();
 092                    continue;
 93                }
 094                if (property.NameEquals("type"))
 95                {
 096                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 0100                    type = 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("properties"))
 113                {
 0114                    foreach (var property0 in property.Value.EnumerateObject())
 115                    {
 0116                        if (property0.NameEquals("subnet"))
 117                        {
 0118                            if (property0.Value.ValueKind == JsonValueKind.Null)
 119                            {
 120                                continue;
 121                            }
 0122                            subnet = DeserializeSubResource(property0.Value);
 0123                            continue;
 124                        }
 0125                        if (property0.NameEquals("publicIPAddress"))
 126                        {
 0127                            if (property0.Value.ValueKind == JsonValueKind.Null)
 128                            {
 129                                continue;
 130                            }
 0131                            publicIPAddress = DeserializeSubResource(property0.Value);
 0132                            continue;
 133                        }
 0134                        if (property0.NameEquals("provisioningState"))
 135                        {
 0136                            if (property0.Value.ValueKind == JsonValueKind.Null)
 137                            {
 138                                continue;
 139                            }
 0140                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0141                            continue;
 142                        }
 0143                        if (property0.NameEquals("privateIPAllocationMethod"))
 144                        {
 0145                            if (property0.Value.ValueKind == JsonValueKind.Null)
 146                            {
 147                                continue;
 148                            }
 0149                            privateIPAllocationMethod = new IPAllocationMethod(property0.Value.GetString());
 150                            continue;
 151                        }
 152                    }
 153                    continue;
 154                }
 155            }
 0156            return new BastionHostIPConfiguration(id, name, etag, type, subnet, publicIPAddress, provisioningState, priv
 157        }
 158    }
 159}