| | 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.Collections.Generic; |
| | 9 | | using System.Text.Json; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.ResourceManager.Network.Models |
| | 13 | | { |
| | 14 | | public partial class ApplicationGatewaySslPredefinedPolicy : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Name != null) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("name"); |
| 0 | 22 | | writer.WriteStringValue(Name); |
| | 23 | | } |
| 0 | 24 | | if (Id != null) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("id"); |
| 0 | 27 | | writer.WriteStringValue(Id); |
| | 28 | | } |
| 0 | 29 | | writer.WritePropertyName("properties"); |
| 0 | 30 | | writer.WriteStartObject(); |
| 0 | 31 | | if (CipherSuites != null) |
| | 32 | | { |
| 0 | 33 | | writer.WritePropertyName("cipherSuites"); |
| 0 | 34 | | writer.WriteStartArray(); |
| 0 | 35 | | foreach (var item in CipherSuites) |
| | 36 | | { |
| 0 | 37 | | writer.WriteStringValue(item.ToString()); |
| | 38 | | } |
| 0 | 39 | | writer.WriteEndArray(); |
| | 40 | | } |
| 0 | 41 | | if (MinProtocolVersion != null) |
| | 42 | | { |
| 0 | 43 | | writer.WritePropertyName("minProtocolVersion"); |
| 0 | 44 | | writer.WriteStringValue(MinProtocolVersion.Value.ToString()); |
| | 45 | | } |
| 0 | 46 | | writer.WriteEndObject(); |
| 0 | 47 | | writer.WriteEndObject(); |
| 0 | 48 | | } |
| | 49 | |
|
| | 50 | | internal static ApplicationGatewaySslPredefinedPolicy DeserializeApplicationGatewaySslPredefinedPolicy(JsonEleme |
| | 51 | | { |
| 0 | 52 | | string name = default; |
| 0 | 53 | | string id = default; |
| 0 | 54 | | IList<ApplicationGatewaySslCipherSuite> cipherSuites = default; |
| 0 | 55 | | ApplicationGatewaySslProtocol? minProtocolVersion = default; |
| 0 | 56 | | foreach (var property in element.EnumerateObject()) |
| | 57 | | { |
| 0 | 58 | | if (property.NameEquals("name")) |
| | 59 | | { |
| 0 | 60 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 61 | | { |
| | 62 | | continue; |
| | 63 | | } |
| 0 | 64 | | name = property.Value.GetString(); |
| 0 | 65 | | continue; |
| | 66 | | } |
| 0 | 67 | | if (property.NameEquals("id")) |
| | 68 | | { |
| 0 | 69 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 70 | | { |
| | 71 | | continue; |
| | 72 | | } |
| 0 | 73 | | id = property.Value.GetString(); |
| 0 | 74 | | continue; |
| | 75 | | } |
| 0 | 76 | | if (property.NameEquals("properties")) |
| | 77 | | { |
| 0 | 78 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 79 | | { |
| 0 | 80 | | if (property0.NameEquals("cipherSuites")) |
| | 81 | | { |
| 0 | 82 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 83 | | { |
| | 84 | | continue; |
| | 85 | | } |
| 0 | 86 | | List<ApplicationGatewaySslCipherSuite> array = new List<ApplicationGatewaySslCipherSuite>(); |
| 0 | 87 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 88 | | { |
| 0 | 89 | | array.Add(new ApplicationGatewaySslCipherSuite(item.GetString())); |
| | 90 | | } |
| 0 | 91 | | cipherSuites = array; |
| 0 | 92 | | continue; |
| | 93 | | } |
| 0 | 94 | | if (property0.NameEquals("minProtocolVersion")) |
| | 95 | | { |
| 0 | 96 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 97 | | { |
| | 98 | | continue; |
| | 99 | | } |
| 0 | 100 | | minProtocolVersion = new ApplicationGatewaySslProtocol(property0.Value.GetString()); |
| | 101 | | continue; |
| | 102 | | } |
| | 103 | | } |
| | 104 | | continue; |
| | 105 | | } |
| | 106 | | } |
| 0 | 107 | | return new ApplicationGatewaySslPredefinedPolicy(id, name, cipherSuites, minProtocolVersion); |
| | 108 | | } |
| | 109 | | } |
| | 110 | | } |