| | 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.Compute.Models |
| | 13 | | { |
| | 14 | | public partial class ContainerServiceSshConfiguration : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | writer.WritePropertyName("publicKeys"); |
| 0 | 20 | | writer.WriteStartArray(); |
| 0 | 21 | | foreach (var item in PublicKeys) |
| | 22 | | { |
| 0 | 23 | | writer.WriteObjectValue(item); |
| | 24 | | } |
| 0 | 25 | | writer.WriteEndArray(); |
| 0 | 26 | | writer.WriteEndObject(); |
| 0 | 27 | | } |
| | 28 | |
|
| | 29 | | internal static ContainerServiceSshConfiguration DeserializeContainerServiceSshConfiguration(JsonElement element |
| | 30 | | { |
| 0 | 31 | | IList<ContainerServiceSshPublicKey> publicKeys = default; |
| 0 | 32 | | foreach (var property in element.EnumerateObject()) |
| | 33 | | { |
| 0 | 34 | | if (property.NameEquals("publicKeys")) |
| | 35 | | { |
| 0 | 36 | | List<ContainerServiceSshPublicKey> array = new List<ContainerServiceSshPublicKey>(); |
| 0 | 37 | | foreach (var item in property.Value.EnumerateArray()) |
| | 38 | | { |
| 0 | 39 | | if (item.ValueKind == JsonValueKind.Null) |
| | 40 | | { |
| 0 | 41 | | array.Add(null); |
| | 42 | | } |
| | 43 | | else |
| | 44 | | { |
| 0 | 45 | | array.Add(ContainerServiceSshPublicKey.DeserializeContainerServiceSshPublicKey(item)); |
| | 46 | | } |
| | 47 | | } |
| 0 | 48 | | publicKeys = array; |
| | 49 | | continue; |
| | 50 | | } |
| | 51 | | } |
| 0 | 52 | | return new ContainerServiceSshConfiguration(publicKeys); |
| | 53 | | } |
| | 54 | | } |
| | 55 | | } |