< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
get_SaLifeTimeSeconds()-100%100%
get_SaDataSizeKilobytes()-100%100%
get_IpsecEncryption()-100%100%
get_IpsecIntegrity()-100%100%
get_IkeEncryption()-100%100%
get_IkeIntegrity()-100%100%
get_DhGroup()-100%100%
get_PfsGroup()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeIpsecPolicy(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IpsecPolicy.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> An IPSec Policy configuration for a virtual network gateway connection. </summary>
 11    public partial class IpsecPolicy
 12    {
 13        /// <summary> Initializes a new instance of IpsecPolicy. </summary>
 14        /// <param name="saLifeTimeSeconds"> The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifet
 15        /// <param name="saDataSizeKilobytes"> The IPSec Security Association (also called Quick Mode or Phase 2 SA) pay
 16        /// <param name="ipsecEncryption"> The IPSec encryption algorithm (IKE phase 1). </param>
 17        /// <param name="ipsecIntegrity"> The IPSec integrity algorithm (IKE phase 1). </param>
 18        /// <param name="ikeEncryption"> The IKE encryption algorithm (IKE phase 2). </param>
 19        /// <param name="ikeIntegrity"> The IKE integrity algorithm (IKE phase 2). </param>
 20        /// <param name="dhGroup"> The DH Group used in IKE Phase 1 for initial SA. </param>
 21        /// <param name="pfsGroup"> The Pfs Group used in IKE Phase 2 for new child SA. </param>
 2422        public IpsecPolicy(int saLifeTimeSeconds, int saDataSizeKilobytes, IpsecEncryption ipsecEncryption, IpsecIntegri
 23        {
 2424            SaLifeTimeSeconds = saLifeTimeSeconds;
 2425            SaDataSizeKilobytes = saDataSizeKilobytes;
 2426            IpsecEncryption = ipsecEncryption;
 2427            IpsecIntegrity = ipsecIntegrity;
 2428            IkeEncryption = ikeEncryption;
 2429            IkeIntegrity = ikeIntegrity;
 2430            DhGroup = dhGroup;
 2431            PfsGroup = pfsGroup;
 2432        }
 33
 34        /// <summary> The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a si
 5635        public int SaLifeTimeSeconds { get; set; }
 36        /// <summary> The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a sit
 5637        public int SaDataSizeKilobytes { get; set; }
 38        /// <summary> The IPSec encryption algorithm (IKE phase 1). </summary>
 5639        public IpsecEncryption IpsecEncryption { get; set; }
 40        /// <summary> The IPSec integrity algorithm (IKE phase 1). </summary>
 5641        public IpsecIntegrity IpsecIntegrity { get; set; }
 42        /// <summary> The IKE encryption algorithm (IKE phase 2). </summary>
 5643        public IkeEncryption IkeEncryption { get; set; }
 44        /// <summary> The IKE integrity algorithm (IKE phase 2). </summary>
 5645        public IkeIntegrity IkeIntegrity { get; set; }
 46        /// <summary> The DH Group used in IKE Phase 1 for initial SA. </summary>
 5647        public DhGroup DhGroup { get; set; }
 48        /// <summary> The Pfs Group used in IKE Phase 2 for new child SA. </summary>
 5649        public PfsGroup PfsGroup { get; set; }
 50    }
 51}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IpsecPolicy.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 IpsecPolicy : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1617            writer.WriteStartObject();
 1618            writer.WritePropertyName("saLifeTimeSeconds");
 1619            writer.WriteNumberValue(SaLifeTimeSeconds);
 1620            writer.WritePropertyName("saDataSizeKilobytes");
 1621            writer.WriteNumberValue(SaDataSizeKilobytes);
 1622            writer.WritePropertyName("ipsecEncryption");
 1623            writer.WriteStringValue(IpsecEncryption.ToString());
 1624            writer.WritePropertyName("ipsecIntegrity");
 1625            writer.WriteStringValue(IpsecIntegrity.ToString());
 1626            writer.WritePropertyName("ikeEncryption");
 1627            writer.WriteStringValue(IkeEncryption.ToString());
 1628            writer.WritePropertyName("ikeIntegrity");
 1629            writer.WriteStringValue(IkeIntegrity.ToString());
 1630            writer.WritePropertyName("dhGroup");
 1631            writer.WriteStringValue(DhGroup.ToString());
 1632            writer.WritePropertyName("pfsGroup");
 1633            writer.WriteStringValue(PfsGroup.ToString());
 1634            writer.WriteEndObject();
 1635        }
 36
 37        internal static IpsecPolicy DeserializeIpsecPolicy(JsonElement element)
 38        {
 1639            int saLifeTimeSeconds = default;
 1640            int saDataSizeKilobytes = default;
 1641            IpsecEncryption ipsecEncryption = default;
 1642            IpsecIntegrity ipsecIntegrity = default;
 1643            IkeEncryption ikeEncryption = default;
 1644            IkeIntegrity ikeIntegrity = default;
 1645            DhGroup dhGroup = default;
 1646            PfsGroup pfsGroup = default;
 28847            foreach (var property in element.EnumerateObject())
 48            {
 12849                if (property.NameEquals("saLifeTimeSeconds"))
 50                {
 1651                    saLifeTimeSeconds = property.Value.GetInt32();
 1652                    continue;
 53                }
 11254                if (property.NameEquals("saDataSizeKilobytes"))
 55                {
 1656                    saDataSizeKilobytes = property.Value.GetInt32();
 1657                    continue;
 58                }
 9659                if (property.NameEquals("ipsecEncryption"))
 60                {
 1661                    ipsecEncryption = new IpsecEncryption(property.Value.GetString());
 1662                    continue;
 63                }
 8064                if (property.NameEquals("ipsecIntegrity"))
 65                {
 1666                    ipsecIntegrity = new IpsecIntegrity(property.Value.GetString());
 1667                    continue;
 68                }
 6469                if (property.NameEquals("ikeEncryption"))
 70                {
 1671                    ikeEncryption = new IkeEncryption(property.Value.GetString());
 1672                    continue;
 73                }
 4874                if (property.NameEquals("ikeIntegrity"))
 75                {
 1676                    ikeIntegrity = new IkeIntegrity(property.Value.GetString());
 1677                    continue;
 78                }
 3279                if (property.NameEquals("dhGroup"))
 80                {
 1681                    dhGroup = new DhGroup(property.Value.GetString());
 1682                    continue;
 83                }
 1684                if (property.NameEquals("pfsGroup"))
 85                {
 1686                    pfsGroup = new PfsGroup(property.Value.GetString());
 87                    continue;
 88                }
 89            }
 1690            return new IpsecPolicy(saLifeTimeSeconds, saDataSizeKilobytes, ipsecEncryption, ipsecIntegrity, ikeEncryptio
 91        }
 92    }
 93}