| | 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.Resources.Models |
| | 12 | | { |
| | 13 | | public partial class ParametersLink : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 24 | 17 | | writer.WriteStartObject(); |
| 24 | 18 | | writer.WritePropertyName("uri"); |
| 24 | 19 | | writer.WriteStringValue(Uri); |
| 24 | 20 | | if (ContentVersion != null) |
| | 21 | | { |
| 24 | 22 | | writer.WritePropertyName("contentVersion"); |
| 24 | 23 | | writer.WriteStringValue(ContentVersion); |
| | 24 | | } |
| 24 | 25 | | writer.WriteEndObject(); |
| 24 | 26 | | } |
| | 27 | |
|
| | 28 | | internal static ParametersLink DeserializeParametersLink(JsonElement element) |
| | 29 | | { |
| 24 | 30 | | string uri = default; |
| 24 | 31 | | string contentVersion = default; |
| 192 | 32 | | foreach (var property in element.EnumerateObject()) |
| | 33 | | { |
| 72 | 34 | | if (property.NameEquals("uri")) |
| | 35 | | { |
| 24 | 36 | | uri = property.Value.GetString(); |
| 24 | 37 | | continue; |
| | 38 | | } |
| 48 | 39 | | if (property.NameEquals("contentVersion")) |
| | 40 | | { |
| 24 | 41 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 42 | | { |
| | 43 | | continue; |
| | 44 | | } |
| 24 | 45 | | contentVersion = property.Value.GetString(); |
| | 46 | | continue; |
| | 47 | | } |
| | 48 | | } |
| 24 | 49 | | return new ParametersLink(uri, contentVersion); |
| | 50 | | } |
| | 51 | | } |
| | 52 | | } |