| | 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.Compute.Models |
| | 12 | | { |
| | 13 | | public partial class VirtualMachineScaleSetManagedDiskParameters : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 16 | 17 | | writer.WriteStartObject(); |
| 16 | 18 | | if (StorageAccountType != null) |
| | 19 | | { |
| 16 | 20 | | writer.WritePropertyName("storageAccountType"); |
| 16 | 21 | | writer.WriteStringValue(StorageAccountType.Value.ToString()); |
| | 22 | | } |
| 16 | 23 | | if (DiskEncryptionSet != null) |
| | 24 | | { |
| 0 | 25 | | writer.WritePropertyName("diskEncryptionSet"); |
| 0 | 26 | | writer.WriteObjectValue(DiskEncryptionSet); |
| | 27 | | } |
| 16 | 28 | | writer.WriteEndObject(); |
| 16 | 29 | | } |
| | 30 | |
|
| | 31 | | internal static VirtualMachineScaleSetManagedDiskParameters DeserializeVirtualMachineScaleSetManagedDiskParamete |
| | 32 | | { |
| 600 | 33 | | StorageAccountTypes? storageAccountType = default; |
| 600 | 34 | | SubResource diskEncryptionSet = default; |
| 2400 | 35 | | foreach (var property in element.EnumerateObject()) |
| | 36 | | { |
| 600 | 37 | | if (property.NameEquals("storageAccountType")) |
| | 38 | | { |
| 600 | 39 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 40 | | { |
| | 41 | | continue; |
| | 42 | | } |
| 600 | 43 | | storageAccountType = new StorageAccountTypes(property.Value.GetString()); |
| 600 | 44 | | continue; |
| | 45 | | } |
| 0 | 46 | | if (property.NameEquals("diskEncryptionSet")) |
| | 47 | | { |
| 0 | 48 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 49 | | { |
| | 50 | | continue; |
| | 51 | | } |
| 0 | 52 | | diskEncryptionSet = SubResource.DeserializeSubResource(property.Value); |
| | 53 | | continue; |
| | 54 | | } |
| | 55 | | } |
| 600 | 56 | | return new VirtualMachineScaleSetManagedDiskParameters(storageAccountType, diskEncryptionSet); |
| | 57 | | } |
| | 58 | | } |
| | 59 | | } |