< Summary

Class:Azure.ResourceManager.EventHubs.Models.NWRuleSetIpRules
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\NWRuleSetIpRules.cs
C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\NWRuleSetIpRules.Serialization.cs
Covered lines:29
Uncovered lines:0
Coverable lines:29
Total lines:92
Line coverage:100% (29 of 29)
Covered branches:14
Total branches:14
Branch coverage:100% (14 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_IpMask()-100%100%
get_Action()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeNWRuleSetIpRules(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\NWRuleSetIpRules.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.EventHubs.Models
 9{
 10    /// <summary> The response from the List namespace operation. </summary>
 11    public partial class NWRuleSetIpRules
 12    {
 13        /// <summary> Initializes a new instance of NWRuleSetIpRules. </summary>
 2014        public NWRuleSetIpRules()
 15        {
 2016            Action = "Allow";
 2017        }
 18
 19        /// <summary> Initializes a new instance of NWRuleSetIpRules. </summary>
 20        /// <param name="ipMask"> IP Mask. </param>
 21        /// <param name="action"> The IP Filter Action. </param>
 4022        internal NWRuleSetIpRules(string ipMask, string action)
 23        {
 4024            IpMask = ipMask;
 4025            Action = action;
 4026        }
 27
 28        /// <summary> IP Mask. </summary>
 10029        public string IpMask { get; set; }
 30        /// <summary> The IP Filter Action. </summary>
 12031        public string Action { get; set; }
 32    }
 33}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\NWRuleSetIpRules.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.EventHubs.Models
 12{
 13    public partial class NWRuleSetIpRules : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 2017            writer.WriteStartObject();
 2018            if (IpMask != null)
 19            {
 2020                writer.WritePropertyName("ipMask");
 2021                writer.WriteStringValue(IpMask);
 22            }
 2023            if (Action != null)
 24            {
 2025                writer.WritePropertyName("action");
 2026                writer.WriteStringValue(Action);
 27            }
 2028            writer.WriteEndObject();
 2029        }
 30
 31        internal static NWRuleSetIpRules DeserializeNWRuleSetIpRules(JsonElement element)
 32        {
 4033            string ipMask = default;
 4034            string action = default;
 24035            foreach (var property in element.EnumerateObject())
 36            {
 8037                if (property.NameEquals("ipMask"))
 38                {
 4039                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 4043                    ipMask = property.Value.GetString();
 4044                    continue;
 45                }
 4046                if (property.NameEquals("action"))
 47                {
 4048                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 4052                    action = property.Value.GetString();
 53                    continue;
 54                }
 55            }
 4056            return new NWRuleSetIpRules(ipMask, action);
 57        }
 58    }
 59}