| | 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.Collections.Generic; |
| | 9 | | using System.Text.Json; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.Analytics.Synapse.Artifacts.Models |
| | 13 | | { |
| | 14 | | public partial class DatasetZipDeflateCompression : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Optional.IsDefined(Level)) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("level"); |
| 0 | 22 | | writer.WriteStringValue(Level.Value.ToString()); |
| | 23 | | } |
| 0 | 24 | | writer.WritePropertyName("type"); |
| 0 | 25 | | writer.WriteStringValue(Type); |
| 0 | 26 | | foreach (var item in AdditionalProperties) |
| | 27 | | { |
| 0 | 28 | | writer.WritePropertyName(item.Key); |
| 0 | 29 | | writer.WriteObjectValue(item.Value); |
| | 30 | | } |
| 0 | 31 | | writer.WriteEndObject(); |
| 0 | 32 | | } |
| | 33 | |
|
| | 34 | | internal static DatasetZipDeflateCompression DeserializeDatasetZipDeflateCompression(JsonElement element) |
| | 35 | | { |
| 0 | 36 | | Optional<DatasetCompressionLevel> level = default; |
| 0 | 37 | | string type = default; |
| 0 | 38 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 39 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 40 | | foreach (var property in element.EnumerateObject()) |
| | 41 | | { |
| 0 | 42 | | if (property.NameEquals("level")) |
| | 43 | | { |
| 0 | 44 | | level = new DatasetCompressionLevel(property.Value.GetString()); |
| 0 | 45 | | continue; |
| | 46 | | } |
| 0 | 47 | | if (property.NameEquals("type")) |
| | 48 | | { |
| 0 | 49 | | type = property.Value.GetString(); |
| 0 | 50 | | continue; |
| | 51 | | } |
| 0 | 52 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 53 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 54 | | } |
| 0 | 55 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 56 | | return new DatasetZipDeflateCompression(type, additionalProperties, Optional.ToNullable(level)); |
| | 57 | | } |
| | 58 | | } |
| | 59 | | } |