| | 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 SparkStatementCollection |
| | 15 | | { |
| | 16 | | internal static SparkStatementCollection DeserializeSparkStatementCollection(JsonElement element) |
| | 17 | | { |
| 0 | 18 | | int totalStatements = default; |
| 0 | 19 | | Optional<IReadOnlyList<SparkStatement>> statements = default; |
| 0 | 20 | | foreach (var property in element.EnumerateObject()) |
| | 21 | | { |
| 0 | 22 | | if (property.NameEquals("total_statements")) |
| | 23 | | { |
| 0 | 24 | | totalStatements = property.Value.GetInt32(); |
| 0 | 25 | | continue; |
| | 26 | | } |
| 0 | 27 | | if (property.NameEquals("statements")) |
| | 28 | | { |
| 0 | 29 | | List<SparkStatement> array = new List<SparkStatement>(); |
| 0 | 30 | | foreach (var item in property.Value.EnumerateArray()) |
| | 31 | | { |
| 0 | 32 | | array.Add(SparkStatement.DeserializeSparkStatement(item)); |
| | 33 | | } |
| 0 | 34 | | statements = array; |
| | 35 | | continue; |
| | 36 | | } |
| | 37 | | } |
| 0 | 38 | | return new SparkStatementCollection(totalStatements, Optional.ToList(statements)); |
| | 39 | | } |
| | 40 | | } |
| | 41 | | } |