| | 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; |
| | 9 | | using System.Text.Json; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.Analytics.Synapse.Spark.Models |
| | 13 | | { |
| | 14 | | public partial class SparkSessionState |
| | 15 | | { |
| | 16 | | internal static SparkSessionState DeserializeSparkSessionState(JsonElement element) |
| | 17 | | { |
| 0 | 18 | | Optional<DateTimeOffset> notStartedAt = default; |
| 0 | 19 | | Optional<DateTimeOffset> startingAt = default; |
| 0 | 20 | | Optional<DateTimeOffset> idleAt = default; |
| 0 | 21 | | Optional<DateTimeOffset> deadAt = default; |
| 0 | 22 | | Optional<DateTimeOffset> shuttingDownAt = default; |
| 0 | 23 | | Optional<DateTimeOffset> killedAt = default; |
| 0 | 24 | | Optional<DateTimeOffset> recoveringAt = default; |
| 0 | 25 | | Optional<DateTimeOffset> busyAt = default; |
| 0 | 26 | | Optional<DateTimeOffset> errorAt = default; |
| 0 | 27 | | Optional<string> currentState = default; |
| 0 | 28 | | Optional<SparkRequest> jobCreationRequest = default; |
| 0 | 29 | | foreach (var property in element.EnumerateObject()) |
| | 30 | | { |
| 0 | 31 | | if (property.NameEquals("notStartedAt")) |
| | 32 | | { |
| 0 | 33 | | notStartedAt = property.Value.GetDateTimeOffset("O"); |
| 0 | 34 | | continue; |
| | 35 | | } |
| 0 | 36 | | if (property.NameEquals("startingAt")) |
| | 37 | | { |
| 0 | 38 | | startingAt = property.Value.GetDateTimeOffset("O"); |
| 0 | 39 | | continue; |
| | 40 | | } |
| 0 | 41 | | if (property.NameEquals("idleAt")) |
| | 42 | | { |
| 0 | 43 | | idleAt = property.Value.GetDateTimeOffset("O"); |
| 0 | 44 | | continue; |
| | 45 | | } |
| 0 | 46 | | if (property.NameEquals("deadAt")) |
| | 47 | | { |
| 0 | 48 | | deadAt = property.Value.GetDateTimeOffset("O"); |
| 0 | 49 | | continue; |
| | 50 | | } |
| 0 | 51 | | if (property.NameEquals("shuttingDownAt")) |
| | 52 | | { |
| 0 | 53 | | shuttingDownAt = property.Value.GetDateTimeOffset("O"); |
| 0 | 54 | | continue; |
| | 55 | | } |
| 0 | 56 | | if (property.NameEquals("killedAt")) |
| | 57 | | { |
| 0 | 58 | | killedAt = property.Value.GetDateTimeOffset("O"); |
| 0 | 59 | | continue; |
| | 60 | | } |
| 0 | 61 | | if (property.NameEquals("recoveringAt")) |
| | 62 | | { |
| 0 | 63 | | recoveringAt = property.Value.GetDateTimeOffset("O"); |
| 0 | 64 | | continue; |
| | 65 | | } |
| 0 | 66 | | if (property.NameEquals("busyAt")) |
| | 67 | | { |
| 0 | 68 | | busyAt = property.Value.GetDateTimeOffset("O"); |
| 0 | 69 | | continue; |
| | 70 | | } |
| 0 | 71 | | if (property.NameEquals("errorAt")) |
| | 72 | | { |
| 0 | 73 | | errorAt = property.Value.GetDateTimeOffset("O"); |
| 0 | 74 | | continue; |
| | 75 | | } |
| 0 | 76 | | if (property.NameEquals("currentState")) |
| | 77 | | { |
| 0 | 78 | | currentState = property.Value.GetString(); |
| 0 | 79 | | continue; |
| | 80 | | } |
| 0 | 81 | | if (property.NameEquals("jobCreationRequest")) |
| | 82 | | { |
| 0 | 83 | | jobCreationRequest = SparkRequest.DeserializeSparkRequest(property.Value); |
| | 84 | | continue; |
| | 85 | | } |
| | 86 | | } |
| 0 | 87 | | return new SparkSessionState(Optional.ToNullable(notStartedAt), Optional.ToNullable(startingAt), Optional.To |
| | 88 | | } |
| | 89 | | } |
| | 90 | | } |