| | 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 KeyVaultAndKeyReference : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 44 | 17 | | writer.WriteStartObject(); |
| 44 | 18 | | writer.WritePropertyName("sourceVault"); |
| 44 | 19 | | writer.WriteObjectValue(SourceVault); |
| 44 | 20 | | writer.WritePropertyName("keyUrl"); |
| 44 | 21 | | writer.WriteStringValue(KeyUrl); |
| 44 | 22 | | writer.WriteEndObject(); |
| 44 | 23 | | } |
| | 24 | |
|
| | 25 | | internal static KeyVaultAndKeyReference DeserializeKeyVaultAndKeyReference(JsonElement element) |
| | 26 | | { |
| 60 | 27 | | SourceVault sourceVault = default; |
| 60 | 28 | | string keyUrl = default; |
| 360 | 29 | | foreach (var property in element.EnumerateObject()) |
| | 30 | | { |
| 120 | 31 | | if (property.NameEquals("sourceVault")) |
| | 32 | | { |
| 60 | 33 | | sourceVault = SourceVault.DeserializeSourceVault(property.Value); |
| 60 | 34 | | continue; |
| | 35 | | } |
| 60 | 36 | | if (property.NameEquals("keyUrl")) |
| | 37 | | { |
| 60 | 38 | | keyUrl = property.Value.GetString(); |
| | 39 | | continue; |
| | 40 | | } |
| | 41 | | } |
| 60 | 42 | | return new KeyVaultAndKeyReference(sourceVault, keyUrl); |
| | 43 | | } |
| | 44 | | } |
| | 45 | | } |