< Summary

Class:Azure.ResourceManager.Network.Models.ContainerNetworkInterface
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ContainerNetworkInterface.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ContainerNetworkInterface.Serialization.cs
Covered lines:0
Uncovered lines:99
Coverable lines:99
Total lines:232
Line coverage:0% (0 of 99)
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_Type()-0%100%
get_Etag()-0%100%
get_ContainerNetworkInterfaceConfiguration()-0%100%
get_Container()-0%100%
get_IpConfigurations()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeContainerNetworkInterface(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ContainerNetworkInterface.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> Container network interface child resource. </summary>
 13    public partial class ContainerNetworkInterface : SubResource
 14    {
 15        /// <summary> Initializes a new instance of ContainerNetworkInterface. </summary>
 016        public ContainerNetworkInterface()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ContainerNetworkInterface. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> The name of the resource. This name can be used to access the resource. </param>
 23        /// <param name="type"> Sub Resource type. </param>
 24        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 25        /// <param name="containerNetworkInterfaceConfiguration"> Container network interface configuration from which t
 26        /// <param name="container"> Reference to the container to which this container network interface is attached. <
 27        /// <param name="ipConfigurations"> Reference to the ip configuration on this container nic. </param>
 28        /// <param name="provisioningState"> The provisioning state of the container network interface resource. </param
 029        internal ContainerNetworkInterface(string id, string name, string type, string etag, ContainerNetworkInterfaceCo
 30        {
 031            Name = name;
 032            Type = type;
 033            Etag = etag;
 034            ContainerNetworkInterfaceConfiguration = containerNetworkInterfaceConfiguration;
 035            Container = container;
 036            IpConfigurations = ipConfigurations;
 037            ProvisioningState = provisioningState;
 038        }
 39
 40        /// <summary> The name of the resource. This name can be used to access the resource. </summary>
 041        public string Name { get; set; }
 42        /// <summary> Sub Resource type. </summary>
 043        public string Type { get; }
 44        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 045        public string Etag { get; }
 46        /// <summary> Container network interface configuration from which this container network interface is created. 
 047        public ContainerNetworkInterfaceConfiguration ContainerNetworkInterfaceConfiguration { get; }
 48        /// <summary> Reference to the container to which this container network interface is attached. </summary>
 049        public SubResource Container { get; set; }
 50        /// <summary> Reference to the ip configuration on this container nic. </summary>
 051        public IList<ContainerNetworkInterfaceIpConfiguration> IpConfigurations { get; }
 52        /// <summary> The provisioning state of the container network interface resource. </summary>
 053        public ProvisioningState? ProvisioningState { get; }
 54    }
 55}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ContainerNetworkInterface.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 ContainerNetworkInterface : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Name != null)
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            if (Type != null)
 25            {
 026                writer.WritePropertyName("type");
 027                writer.WriteStringValue(Type);
 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            writer.WritePropertyName("properties");
 040            writer.WriteStartObject();
 041            if (ContainerNetworkInterfaceConfiguration != null)
 42            {
 043                writer.WritePropertyName("containerNetworkInterfaceConfiguration");
 044                writer.WriteObjectValue(ContainerNetworkInterfaceConfiguration);
 45            }
 046            if (Container != null)
 47            {
 048                writer.WritePropertyName("container");
 049                writer.WriteObjectValue(Container);
 50            }
 051            if (IpConfigurations != null)
 52            {
 053                writer.WritePropertyName("ipConfigurations");
 054                writer.WriteStartArray();
 055                foreach (var item in IpConfigurations)
 56                {
 057                    writer.WriteObjectValue(item);
 58                }
 059                writer.WriteEndArray();
 60            }
 061            if (ProvisioningState != null)
 62            {
 063                writer.WritePropertyName("provisioningState");
 064                writer.WriteStringValue(ProvisioningState.Value.ToString());
 65            }
 066            writer.WriteEndObject();
 067            writer.WriteEndObject();
 068        }
 69
 70        internal static ContainerNetworkInterface DeserializeContainerNetworkInterface(JsonElement element)
 71        {
 072            string name = default;
 073            string type = default;
 074            string etag = default;
 075            string id = default;
 076            ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration = default;
 077            SubResource container = default;
 078            IList<ContainerNetworkInterfaceIpConfiguration> ipConfigurations = 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("type"))
 92                {
 093                    if (property.Value.ValueKind == JsonValueKind.Null)
 94                    {
 95                        continue;
 96                    }
 097                    type = property.Value.GetString();
 098                    continue;
 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("properties"))
 119                {
 0120                    foreach (var property0 in property.Value.EnumerateObject())
 121                    {
 0122                        if (property0.NameEquals("containerNetworkInterfaceConfiguration"))
 123                        {
 0124                            if (property0.Value.ValueKind == JsonValueKind.Null)
 125                            {
 126                                continue;
 127                            }
 0128                            containerNetworkInterfaceConfiguration = ContainerNetworkInterfaceConfiguration.DeserializeC
 0129                            continue;
 130                        }
 0131                        if (property0.NameEquals("container"))
 132                        {
 0133                            if (property0.Value.ValueKind == JsonValueKind.Null)
 134                            {
 135                                continue;
 136                            }
 0137                            container = DeserializeSubResource(property0.Value);
 0138                            continue;
 139                        }
 0140                        if (property0.NameEquals("ipConfigurations"))
 141                        {
 0142                            if (property0.Value.ValueKind == JsonValueKind.Null)
 143                            {
 144                                continue;
 145                            }
 0146                            List<ContainerNetworkInterfaceIpConfiguration> array = new List<ContainerNetworkInterfaceIpC
 0147                            foreach (var item in property0.Value.EnumerateArray())
 148                            {
 0149                                if (item.ValueKind == JsonValueKind.Null)
 150                                {
 0151                                    array.Add(null);
 152                                }
 153                                else
 154                                {
 0155                                    array.Add(ContainerNetworkInterfaceIpConfiguration.DeserializeContainerNetworkInterf
 156                                }
 157                            }
 0158                            ipConfigurations = array;
 0159                            continue;
 160                        }
 0161                        if (property0.NameEquals("provisioningState"))
 162                        {
 0163                            if (property0.Value.ValueKind == JsonValueKind.Null)
 164                            {
 165                                continue;
 166                            }
 0167                            provisioningState = new ProvisioningState(property0.Value.GetString());
 168                            continue;
 169                        }
 170                    }
 171                    continue;
 172                }
 173            }
 0174            return new ContainerNetworkInterface(id, name, type, etag, containerNetworkInterfaceConfiguration, container
 175        }
 176    }
 177}