| | 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.Analytics.Synapse.Artifacts.Models |
| | 12 | | { |
| | 13 | | public partial class SparkJobDefinitionResource : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | writer.WritePropertyName("properties"); |
| 0 | 19 | | writer.WriteObjectValue(Properties); |
| 0 | 20 | | writer.WriteEndObject(); |
| 0 | 21 | | } |
| | 22 | |
|
| | 23 | | internal static SparkJobDefinitionResource DeserializeSparkJobDefinitionResource(JsonElement element) |
| | 24 | | { |
| 0 | 25 | | SparkJobDefinition properties = default; |
| 0 | 26 | | Optional<string> id = default; |
| 0 | 27 | | Optional<string> name = default; |
| 0 | 28 | | Optional<string> type = default; |
| 0 | 29 | | Optional<string> etag = default; |
| 0 | 30 | | foreach (var property in element.EnumerateObject()) |
| | 31 | | { |
| 0 | 32 | | if (property.NameEquals("properties")) |
| | 33 | | { |
| 0 | 34 | | properties = SparkJobDefinition.DeserializeSparkJobDefinition(property.Value); |
| 0 | 35 | | continue; |
| | 36 | | } |
| 0 | 37 | | if (property.NameEquals("id")) |
| | 38 | | { |
| 0 | 39 | | id = property.Value.GetString(); |
| 0 | 40 | | continue; |
| | 41 | | } |
| 0 | 42 | | if (property.NameEquals("name")) |
| | 43 | | { |
| 0 | 44 | | name = 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 | | if (property.NameEquals("etag")) |
| | 53 | | { |
| 0 | 54 | | etag = property.Value.GetString(); |
| | 55 | | continue; |
| | 56 | | } |
| | 57 | | } |
| 0 | 58 | | return new SparkJobDefinitionResource(id.Value, name.Value, type.Value, etag.Value, properties); |
| | 59 | | } |
| | 60 | | } |
| | 61 | | } |