< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Protocol()-0%100%
get_TriggerRateOverride()-0%100%
get_SourceRateOverride()-0%100%
get_TriggerSensitivityOverride()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeProtocolCustomSettingsFormat(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ProtocolCustomSettingsFormat.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> DDoS custom policy properties. </summary>
 11    public partial class ProtocolCustomSettingsFormat
 12    {
 13        /// <summary> Initializes a new instance of ProtocolCustomSettingsFormat. </summary>
 014        public ProtocolCustomSettingsFormat()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of ProtocolCustomSettingsFormat. </summary>
 19        /// <param name="protocol"> The protocol for which the DDoS protection policy is being customized. </param>
 20        /// <param name="triggerRateOverride"> The customized DDoS protection trigger rate. </param>
 21        /// <param name="sourceRateOverride"> The customized DDoS protection source rate. </param>
 22        /// <param name="triggerSensitivityOverride"> The customized DDoS protection trigger rate sensitivity degrees. H
 023        internal ProtocolCustomSettingsFormat(DdosCustomPolicyProtocol? protocol, string triggerRateOverride, string sou
 24        {
 025            Protocol = protocol;
 026            TriggerRateOverride = triggerRateOverride;
 027            SourceRateOverride = sourceRateOverride;
 028            TriggerSensitivityOverride = triggerSensitivityOverride;
 029        }
 30
 31        /// <summary> The protocol for which the DDoS protection policy is being customized. </summary>
 032        public DdosCustomPolicyProtocol? Protocol { get; set; }
 33        /// <summary> The customized DDoS protection trigger rate. </summary>
 034        public string TriggerRateOverride { get; set; }
 35        /// <summary> The customized DDoS protection source rate. </summary>
 036        public string SourceRateOverride { get; set; }
 37        /// <summary> The customized DDoS protection trigger rate sensitivity degrees. High: Trigger rate set with most 
 038        public DdosCustomPolicyTriggerSensitivityOverride? TriggerSensitivityOverride { get; set; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ProtocolCustomSettingsFormat.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 ProtocolCustomSettingsFormat : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Protocol != null)
 19            {
 020                writer.WritePropertyName("protocol");
 021                writer.WriteStringValue(Protocol.Value.ToString());
 22            }
 023            if (TriggerRateOverride != null)
 24            {
 025                writer.WritePropertyName("triggerRateOverride");
 026                writer.WriteStringValue(TriggerRateOverride);
 27            }
 028            if (SourceRateOverride != null)
 29            {
 030                writer.WritePropertyName("sourceRateOverride");
 031                writer.WriteStringValue(SourceRateOverride);
 32            }
 033            if (TriggerSensitivityOverride != null)
 34            {
 035                writer.WritePropertyName("triggerSensitivityOverride");
 036                writer.WriteStringValue(TriggerSensitivityOverride.Value.ToString());
 37            }
 038            writer.WriteEndObject();
 039        }
 40
 41        internal static ProtocolCustomSettingsFormat DeserializeProtocolCustomSettingsFormat(JsonElement element)
 42        {
 043            DdosCustomPolicyProtocol? protocol = default;
 044            string triggerRateOverride = default;
 045            string sourceRateOverride = default;
 046            DdosCustomPolicyTriggerSensitivityOverride? triggerSensitivityOverride = default;
 047            foreach (var property in element.EnumerateObject())
 48            {
 049                if (property.NameEquals("protocol"))
 50                {
 051                    if (property.Value.ValueKind == JsonValueKind.Null)
 52                    {
 53                        continue;
 54                    }
 055                    protocol = new DdosCustomPolicyProtocol(property.Value.GetString());
 056                    continue;
 57                }
 058                if (property.NameEquals("triggerRateOverride"))
 59                {
 060                    if (property.Value.ValueKind == JsonValueKind.Null)
 61                    {
 62                        continue;
 63                    }
 064                    triggerRateOverride = property.Value.GetString();
 065                    continue;
 66                }
 067                if (property.NameEquals("sourceRateOverride"))
 68                {
 069                    if (property.Value.ValueKind == JsonValueKind.Null)
 70                    {
 71                        continue;
 72                    }
 073                    sourceRateOverride = property.Value.GetString();
 074                    continue;
 75                }
 076                if (property.NameEquals("triggerSensitivityOverride"))
 77                {
 078                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 082                    triggerSensitivityOverride = new DdosCustomPolicyTriggerSensitivityOverride(property.Value.GetString
 83                    continue;
 84                }
 85            }
 086            return new ProtocolCustomSettingsFormat(protocol, triggerRateOverride, sourceRateOverride, triggerSensitivit
 87        }
 88    }
 89}