| | 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.Spark.Models |
| | 12 | | { |
| | 13 | | public partial class SparkSessionOptions : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | if (Optional.IsCollectionDefined(Tags)) |
| | 19 | | { |
| 0 | 20 | | writer.WritePropertyName("tags"); |
| 0 | 21 | | writer.WriteStartObject(); |
| 0 | 22 | | foreach (var item in Tags) |
| | 23 | | { |
| 0 | 24 | | writer.WritePropertyName(item.Key); |
| 0 | 25 | | writer.WriteStringValue(item.Value); |
| | 26 | | } |
| 0 | 27 | | writer.WriteEndObject(); |
| | 28 | | } |
| 0 | 29 | | if (Optional.IsDefined(ArtifactId)) |
| | 30 | | { |
| 0 | 31 | | writer.WritePropertyName("artifactId"); |
| 0 | 32 | | writer.WriteStringValue(ArtifactId); |
| | 33 | | } |
| 0 | 34 | | writer.WritePropertyName("name"); |
| 0 | 35 | | writer.WriteStringValue(Name); |
| 0 | 36 | | if (Optional.IsDefined(File)) |
| | 37 | | { |
| 0 | 38 | | writer.WritePropertyName("file"); |
| 0 | 39 | | writer.WriteStringValue(File); |
| | 40 | | } |
| 0 | 41 | | if (Optional.IsDefined(ClassName)) |
| | 42 | | { |
| 0 | 43 | | writer.WritePropertyName("className"); |
| 0 | 44 | | writer.WriteStringValue(ClassName); |
| | 45 | | } |
| 0 | 46 | | if (Optional.IsCollectionDefined(Arguments)) |
| | 47 | | { |
| 0 | 48 | | writer.WritePropertyName("args"); |
| 0 | 49 | | writer.WriteStartArray(); |
| 0 | 50 | | foreach (var item in Arguments) |
| | 51 | | { |
| 0 | 52 | | writer.WriteStringValue(item); |
| | 53 | | } |
| 0 | 54 | | writer.WriteEndArray(); |
| | 55 | | } |
| 0 | 56 | | if (Optional.IsCollectionDefined(Jars)) |
| | 57 | | { |
| 0 | 58 | | writer.WritePropertyName("jars"); |
| 0 | 59 | | writer.WriteStartArray(); |
| 0 | 60 | | foreach (var item in Jars) |
| | 61 | | { |
| 0 | 62 | | writer.WriteStringValue(item); |
| | 63 | | } |
| 0 | 64 | | writer.WriteEndArray(); |
| | 65 | | } |
| 0 | 66 | | if (Optional.IsCollectionDefined(PythonFiles)) |
| | 67 | | { |
| 0 | 68 | | writer.WritePropertyName("pyFiles"); |
| 0 | 69 | | writer.WriteStartArray(); |
| 0 | 70 | | foreach (var item in PythonFiles) |
| | 71 | | { |
| 0 | 72 | | writer.WriteStringValue(item); |
| | 73 | | } |
| 0 | 74 | | writer.WriteEndArray(); |
| | 75 | | } |
| 0 | 76 | | if (Optional.IsCollectionDefined(Files)) |
| | 77 | | { |
| 0 | 78 | | writer.WritePropertyName("files"); |
| 0 | 79 | | writer.WriteStartArray(); |
| 0 | 80 | | foreach (var item in Files) |
| | 81 | | { |
| 0 | 82 | | writer.WriteStringValue(item); |
| | 83 | | } |
| 0 | 84 | | writer.WriteEndArray(); |
| | 85 | | } |
| 0 | 86 | | if (Optional.IsCollectionDefined(Archives)) |
| | 87 | | { |
| 0 | 88 | | writer.WritePropertyName("archives"); |
| 0 | 89 | | writer.WriteStartArray(); |
| 0 | 90 | | foreach (var item in Archives) |
| | 91 | | { |
| 0 | 92 | | writer.WriteStringValue(item); |
| | 93 | | } |
| 0 | 94 | | writer.WriteEndArray(); |
| | 95 | | } |
| 0 | 96 | | if (Optional.IsCollectionDefined(Configuration)) |
| | 97 | | { |
| 0 | 98 | | writer.WritePropertyName("conf"); |
| 0 | 99 | | writer.WriteStartObject(); |
| 0 | 100 | | foreach (var item in Configuration) |
| | 101 | | { |
| 0 | 102 | | writer.WritePropertyName(item.Key); |
| 0 | 103 | | writer.WriteStringValue(item.Value); |
| | 104 | | } |
| 0 | 105 | | writer.WriteEndObject(); |
| | 106 | | } |
| 0 | 107 | | if (Optional.IsDefined(DriverMemory)) |
| | 108 | | { |
| 0 | 109 | | writer.WritePropertyName("driverMemory"); |
| 0 | 110 | | writer.WriteStringValue(DriverMemory); |
| | 111 | | } |
| 0 | 112 | | if (Optional.IsDefined(DriverCores)) |
| | 113 | | { |
| 0 | 114 | | writer.WritePropertyName("driverCores"); |
| 0 | 115 | | writer.WriteNumberValue(DriverCores.Value); |
| | 116 | | } |
| 0 | 117 | | if (Optional.IsDefined(ExecutorMemory)) |
| | 118 | | { |
| 0 | 119 | | writer.WritePropertyName("executorMemory"); |
| 0 | 120 | | writer.WriteStringValue(ExecutorMemory); |
| | 121 | | } |
| 0 | 122 | | if (Optional.IsDefined(ExecutorCores)) |
| | 123 | | { |
| 0 | 124 | | writer.WritePropertyName("executorCores"); |
| 0 | 125 | | writer.WriteNumberValue(ExecutorCores.Value); |
| | 126 | | } |
| 0 | 127 | | if (Optional.IsDefined(ExecutorCount)) |
| | 128 | | { |
| 0 | 129 | | writer.WritePropertyName("numExecutors"); |
| 0 | 130 | | writer.WriteNumberValue(ExecutorCount.Value); |
| | 131 | | } |
| 0 | 132 | | writer.WriteEndObject(); |
| 0 | 133 | | } |
| | 134 | | } |
| | 135 | | } |