| | 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.Spark.Models |
| | 13 | | { |
| | 14 | | public partial class SparkStatementOutput |
| | 15 | | { |
| | 16 | | internal static SparkStatementOutput DeserializeSparkStatementOutput(JsonElement element) |
| | 17 | | { |
| 0 | 18 | | Optional<string> status = default; |
| 0 | 19 | | int executionCount = default; |
| 0 | 20 | | Optional<object> data = default; |
| 0 | 21 | | Optional<string> ename = default; |
| 0 | 22 | | Optional<string> evalue = default; |
| 0 | 23 | | Optional<IReadOnlyList<string>> traceback = default; |
| 0 | 24 | | foreach (var property in element.EnumerateObject()) |
| | 25 | | { |
| 0 | 26 | | if (property.NameEquals("status")) |
| | 27 | | { |
| 0 | 28 | | status = property.Value.GetString(); |
| 0 | 29 | | continue; |
| | 30 | | } |
| 0 | 31 | | if (property.NameEquals("execution_count")) |
| | 32 | | { |
| 0 | 33 | | executionCount = property.Value.GetInt32(); |
| 0 | 34 | | continue; |
| | 35 | | } |
| 0 | 36 | | if (property.NameEquals("data")) |
| | 37 | | { |
| 0 | 38 | | data = property.Value.GetObject(); |
| 0 | 39 | | continue; |
| | 40 | | } |
| 0 | 41 | | if (property.NameEquals("ename")) |
| | 42 | | { |
| 0 | 43 | | ename = property.Value.GetString(); |
| 0 | 44 | | continue; |
| | 45 | | } |
| 0 | 46 | | if (property.NameEquals("evalue")) |
| | 47 | | { |
| 0 | 48 | | evalue = property.Value.GetString(); |
| 0 | 49 | | continue; |
| | 50 | | } |
| 0 | 51 | | if (property.NameEquals("traceback")) |
| | 52 | | { |
| 0 | 53 | | List<string> array = new List<string>(); |
| 0 | 54 | | foreach (var item in property.Value.EnumerateArray()) |
| | 55 | | { |
| 0 | 56 | | array.Add(item.GetString()); |
| | 57 | | } |
| 0 | 58 | | traceback = array; |
| | 59 | | continue; |
| | 60 | | } |
| | 61 | | } |
| 0 | 62 | | return new SparkStatementOutput(status.Value, executionCount, data.Value, ename.Value, evalue.Value, Optiona |
| | 63 | | } |
| | 64 | | } |
| | 65 | | } |