< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\IpFilterRule.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> Single item in a List or Get IpFilterRules operation. </summary>
 11    public partial class IpFilterRule : Resource
 12    {
 13        /// <summary> Initializes a new instance of IpFilterRule. </summary>
 014        public IpFilterRule()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of IpFilterRule. </summary>
 19        /// <param name="id"> Resource ID. </param>
 20        /// <param name="name"> Resource name. </param>
 21        /// <param name="type"> Resource type. </param>
 22        /// <param name="ipMask"> IP Mask. </param>
 23        /// <param name="action"> The IP Filter Action. </param>
 24        /// <param name="filterName"> IP Filter name. </param>
 025        internal IpFilterRule(string id, string name, string type, string ipMask, IPAction? action, string filterName) :
 26        {
 027            IpMask = ipMask;
 028            Action = action;
 029            FilterName = filterName;
 030        }
 31
 32        /// <summary> IP Mask. </summary>
 033        public string IpMask { get; set; }
 34        /// <summary> The IP Filter Action. </summary>
 035        public IPAction? Action { get; set; }
 36        /// <summary> IP Filter name. </summary>
 037        public string FilterName { get; set; }
 38    }
 39}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\IpFilterRule.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 IpFilterRule : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Id != null)
 19            {
 020                writer.WritePropertyName("id");
 021                writer.WriteStringValue(Id);
 22            }
 023            if (Name != null)
 24            {
 025                writer.WritePropertyName("name");
 026                writer.WriteStringValue(Name);
 27            }
 028            if (Type != null)
 29            {
 030                writer.WritePropertyName("type");
 031                writer.WriteStringValue(Type);
 32            }
 033            writer.WritePropertyName("properties");
 034            writer.WriteStartObject();
 035            if (IpMask != null)
 36            {
 037                writer.WritePropertyName("ipMask");
 038                writer.WriteStringValue(IpMask);
 39            }
 040            if (Action != null)
 41            {
 042                writer.WritePropertyName("action");
 043                writer.WriteStringValue(Action.Value.ToString());
 44            }
 045            if (FilterName != null)
 46            {
 047                writer.WritePropertyName("filterName");
 048                writer.WriteStringValue(FilterName);
 49            }
 050            writer.WriteEndObject();
 051            writer.WriteEndObject();
 052        }
 53
 54        internal static IpFilterRule DeserializeIpFilterRule(JsonElement element)
 55        {
 056            string id = default;
 057            string name = default;
 058            string type = default;
 059            string ipMask = default;
 060            IPAction? action = default;
 061            string filterName = default;
 062            foreach (var property in element.EnumerateObject())
 63            {
 064                if (property.NameEquals("id"))
 65                {
 066                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 070                    id = property.Value.GetString();
 071                    continue;
 72                }
 073                if (property.NameEquals("name"))
 74                {
 075                    if (property.Value.ValueKind == JsonValueKind.Null)
 76                    {
 77                        continue;
 78                    }
 079                    name = property.Value.GetString();
 080                    continue;
 81                }
 082                if (property.NameEquals("type"))
 83                {
 084                    if (property.Value.ValueKind == JsonValueKind.Null)
 85                    {
 86                        continue;
 87                    }
 088                    type = property.Value.GetString();
 089                    continue;
 90                }
 091                if (property.NameEquals("properties"))
 92                {
 093                    foreach (var property0 in property.Value.EnumerateObject())
 94                    {
 095                        if (property0.NameEquals("ipMask"))
 96                        {
 097                            if (property0.Value.ValueKind == JsonValueKind.Null)
 98                            {
 99                                continue;
 100                            }
 0101                            ipMask = property0.Value.GetString();
 0102                            continue;
 103                        }
 0104                        if (property0.NameEquals("action"))
 105                        {
 0106                            if (property0.Value.ValueKind == JsonValueKind.Null)
 107                            {
 108                                continue;
 109                            }
 0110                            action = new IPAction(property0.Value.GetString());
 0111                            continue;
 112                        }
 0113                        if (property0.NameEquals("filterName"))
 114                        {
 0115                            if (property0.Value.ValueKind == JsonValueKind.Null)
 116                            {
 117                                continue;
 118                            }
 0119                            filterName = property0.Value.GetString();
 120                            continue;
 121                        }
 122                    }
 123                    continue;
 124                }
 125            }
 0126            return new IpFilterRule(id, name, type, ipMask, action, filterName);
 127        }
 128    }
 129}