| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System.Text.Json; |
| | 9 | | using Azure.Core; |
| | 10 | |
|
| | 11 | | namespace Azure.ResourceManager.Network.Models |
| | 12 | | { |
| | 13 | | public partial class VpnClientIPsecParameters : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | writer.WritePropertyName("saLifeTimeSeconds"); |
| 0 | 19 | | writer.WriteNumberValue(SaLifeTimeSeconds); |
| 0 | 20 | | writer.WritePropertyName("saDataSizeKilobytes"); |
| 0 | 21 | | writer.WriteNumberValue(SaDataSizeKilobytes); |
| 0 | 22 | | writer.WritePropertyName("ipsecEncryption"); |
| 0 | 23 | | writer.WriteStringValue(IpsecEncryption.ToString()); |
| 0 | 24 | | writer.WritePropertyName("ipsecIntegrity"); |
| 0 | 25 | | writer.WriteStringValue(IpsecIntegrity.ToString()); |
| 0 | 26 | | writer.WritePropertyName("ikeEncryption"); |
| 0 | 27 | | writer.WriteStringValue(IkeEncryption.ToString()); |
| 0 | 28 | | writer.WritePropertyName("ikeIntegrity"); |
| 0 | 29 | | writer.WriteStringValue(IkeIntegrity.ToString()); |
| 0 | 30 | | writer.WritePropertyName("dhGroup"); |
| 0 | 31 | | writer.WriteStringValue(DhGroup.ToString()); |
| 0 | 32 | | writer.WritePropertyName("pfsGroup"); |
| 0 | 33 | | writer.WriteStringValue(PfsGroup.ToString()); |
| 0 | 34 | | writer.WriteEndObject(); |
| 0 | 35 | | } |
| | 36 | |
|
| | 37 | | internal static VpnClientIPsecParameters DeserializeVpnClientIPsecParameters(JsonElement element) |
| | 38 | | { |
| 0 | 39 | | int saLifeTimeSeconds = default; |
| 0 | 40 | | int saDataSizeKilobytes = default; |
| 0 | 41 | | IpsecEncryption ipsecEncryption = default; |
| 0 | 42 | | IpsecIntegrity ipsecIntegrity = default; |
| 0 | 43 | | IkeEncryption ikeEncryption = default; |
| 0 | 44 | | IkeIntegrity ikeIntegrity = default; |
| 0 | 45 | | DhGroup dhGroup = default; |
| 0 | 46 | | PfsGroup pfsGroup = default; |
| 0 | 47 | | foreach (var property in element.EnumerateObject()) |
| | 48 | | { |
| 0 | 49 | | if (property.NameEquals("saLifeTimeSeconds")) |
| | 50 | | { |
| 0 | 51 | | saLifeTimeSeconds = property.Value.GetInt32(); |
| 0 | 52 | | continue; |
| | 53 | | } |
| 0 | 54 | | if (property.NameEquals("saDataSizeKilobytes")) |
| | 55 | | { |
| 0 | 56 | | saDataSizeKilobytes = property.Value.GetInt32(); |
| 0 | 57 | | continue; |
| | 58 | | } |
| 0 | 59 | | if (property.NameEquals("ipsecEncryption")) |
| | 60 | | { |
| 0 | 61 | | ipsecEncryption = new IpsecEncryption(property.Value.GetString()); |
| 0 | 62 | | continue; |
| | 63 | | } |
| 0 | 64 | | if (property.NameEquals("ipsecIntegrity")) |
| | 65 | | { |
| 0 | 66 | | ipsecIntegrity = new IpsecIntegrity(property.Value.GetString()); |
| 0 | 67 | | continue; |
| | 68 | | } |
| 0 | 69 | | if (property.NameEquals("ikeEncryption")) |
| | 70 | | { |
| 0 | 71 | | ikeEncryption = new IkeEncryption(property.Value.GetString()); |
| 0 | 72 | | continue; |
| | 73 | | } |
| 0 | 74 | | if (property.NameEquals("ikeIntegrity")) |
| | 75 | | { |
| 0 | 76 | | ikeIntegrity = new IkeIntegrity(property.Value.GetString()); |
| 0 | 77 | | continue; |
| | 78 | | } |
| 0 | 79 | | if (property.NameEquals("dhGroup")) |
| | 80 | | { |
| 0 | 81 | | dhGroup = new DhGroup(property.Value.GetString()); |
| 0 | 82 | | continue; |
| | 83 | | } |
| 0 | 84 | | if (property.NameEquals("pfsGroup")) |
| | 85 | | { |
| 0 | 86 | | pfsGroup = new PfsGroup(property.Value.GetString()); |
| | 87 | | continue; |
| | 88 | | } |
| | 89 | | } |
| 0 | 90 | | return new VpnClientIPsecParameters(saLifeTimeSeconds, saDataSizeKilobytes, ipsecEncryption, ipsecIntegrity, |
| | 91 | | } |
| | 92 | | } |
| | 93 | | } |