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