| | 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.Storage.Models |
| | 12 | | { |
| | 13 | | public partial class ChangeFeed : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 8 | 17 | | writer.WriteStartObject(); |
| 8 | 18 | | if (Enabled != null) |
| | 19 | | { |
| 8 | 20 | | writer.WritePropertyName("enabled"); |
| 8 | 21 | | writer.WriteBooleanValue(Enabled.Value); |
| | 22 | | } |
| 8 | 23 | | writer.WriteEndObject(); |
| 8 | 24 | | } |
| | 25 | |
|
| | 26 | | internal static ChangeFeed DeserializeChangeFeed(JsonElement element) |
| | 27 | | { |
| 16 | 28 | | bool? enabled = default; |
| 64 | 29 | | foreach (var property in element.EnumerateObject()) |
| | 30 | | { |
| 16 | 31 | | if (property.NameEquals("enabled")) |
| | 32 | | { |
| 16 | 33 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 34 | | { |
| | 35 | | continue; |
| | 36 | | } |
| 16 | 37 | | enabled = property.Value.GetBoolean(); |
| | 38 | | continue; |
| | 39 | | } |
| | 40 | | } |
| 16 | 41 | | return new ChangeFeed(enabled); |
| | 42 | | } |
| | 43 | | } |
| | 44 | | } |