< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_DdosCustomPolicy()-0%100%
get_ProtectionCoverage()-0%100%
get_ProtectedIP()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeDdosSettings(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\DdosSettings.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> Contains the DDoS protection settings of the public IP. </summary>
 11    public partial class DdosSettings
 12    {
 13        /// <summary> Initializes a new instance of DdosSettings. </summary>
 014        public DdosSettings()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of DdosSettings. </summary>
 19        /// <param name="ddosCustomPolicy"> The DDoS custom policy associated with the public IP. </param>
 20        /// <param name="protectionCoverage"> The DDoS protection policy customizability of the public IP. Only standard
 21        /// <param name="protectedIP"> Enables DDoS protection on the public IP. </param>
 022        internal DdosSettings(SubResource ddosCustomPolicy, DdosSettingsProtectionCoverage? protectionCoverage, bool? pr
 23        {
 024            DdosCustomPolicy = ddosCustomPolicy;
 025            ProtectionCoverage = protectionCoverage;
 026            ProtectedIP = protectedIP;
 027        }
 28
 29        /// <summary> The DDoS custom policy associated with the public IP. </summary>
 030        public SubResource DdosCustomPolicy { get; set; }
 31        /// <summary> The DDoS protection policy customizability of the public IP. Only standard coverage will have the 
 032        public DdosSettingsProtectionCoverage? ProtectionCoverage { get; set; }
 33        /// <summary> Enables DDoS protection on the public IP. </summary>
 034        public bool? ProtectedIP { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\DdosSettings.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 DdosSettings : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (DdosCustomPolicy != null)
 19            {
 020                writer.WritePropertyName("ddosCustomPolicy");
 021                writer.WriteObjectValue(DdosCustomPolicy);
 22            }
 023            if (ProtectionCoverage != null)
 24            {
 025                writer.WritePropertyName("protectionCoverage");
 026                writer.WriteStringValue(ProtectionCoverage.Value.ToString());
 27            }
 028            if (ProtectedIP != null)
 29            {
 030                writer.WritePropertyName("protectedIP");
 031                writer.WriteBooleanValue(ProtectedIP.Value);
 32            }
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static DdosSettings DeserializeDdosSettings(JsonElement element)
 37        {
 038            SubResource ddosCustomPolicy = default;
 039            DdosSettingsProtectionCoverage? protectionCoverage = default;
 040            bool? protectedIP = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("ddosCustomPolicy"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    ddosCustomPolicy = SubResource.DeserializeSubResource(property.Value);
 050                    continue;
 51                }
 052                if (property.NameEquals("protectionCoverage"))
 53                {
 054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 058                    protectionCoverage = new DdosSettingsProtectionCoverage(property.Value.GetString());
 059                    continue;
 60                }
 061                if (property.NameEquals("protectedIP"))
 62                {
 063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 067                    protectedIP = property.Value.GetBoolean();
 68                    continue;
 69                }
 70            }
 071            return new DdosSettings(ddosCustomPolicy, protectionCoverage, protectedIP);
 72        }
 73    }
 74}