| | 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 SparkBatchJobOptions : 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 | | writer.WritePropertyName("file"); |
| 0 | 37 | | writer.WriteStringValue(File); |
| 0 | 38 | | if (Optional.IsDefined(ClassName)) |
| | 39 | | { |
| 0 | 40 | | writer.WritePropertyName("className"); |
| 0 | 41 | | writer.WriteStringValue(ClassName); |
| | 42 | | } |
| 0 | 43 | | if (Optional.IsCollectionDefined(Arguments)) |
| | 44 | | { |
| 0 | 45 | | writer.WritePropertyName("args"); |
| 0 | 46 | | writer.WriteStartArray(); |
| 0 | 47 | | foreach (var item in Arguments) |
| | 48 | | { |
| 0 | 49 | | writer.WriteStringValue(item); |
| | 50 | | } |
| 0 | 51 | | writer.WriteEndArray(); |
| | 52 | | } |
| 0 | 53 | | if (Optional.IsCollectionDefined(Jars)) |
| | 54 | | { |
| 0 | 55 | | writer.WritePropertyName("jars"); |
| 0 | 56 | | writer.WriteStartArray(); |
| 0 | 57 | | foreach (var item in Jars) |
| | 58 | | { |
| 0 | 59 | | writer.WriteStringValue(item); |
| | 60 | | } |
| 0 | 61 | | writer.WriteEndArray(); |
| | 62 | | } |
| 0 | 63 | | if (Optional.IsCollectionDefined(PythonFiles)) |
| | 64 | | { |
| 0 | 65 | | writer.WritePropertyName("pyFiles"); |
| 0 | 66 | | writer.WriteStartArray(); |
| 0 | 67 | | foreach (var item in PythonFiles) |
| | 68 | | { |
| 0 | 69 | | writer.WriteStringValue(item); |
| | 70 | | } |
| 0 | 71 | | writer.WriteEndArray(); |
| | 72 | | } |
| 0 | 73 | | if (Optional.IsCollectionDefined(Files)) |
| | 74 | | { |
| 0 | 75 | | writer.WritePropertyName("files"); |
| 0 | 76 | | writer.WriteStartArray(); |
| 0 | 77 | | foreach (var item in Files) |
| | 78 | | { |
| 0 | 79 | | writer.WriteStringValue(item); |
| | 80 | | } |
| 0 | 81 | | writer.WriteEndArray(); |
| | 82 | | } |
| 0 | 83 | | if (Optional.IsCollectionDefined(Archives)) |
| | 84 | | { |
| 0 | 85 | | writer.WritePropertyName("archives"); |
| 0 | 86 | | writer.WriteStartArray(); |
| 0 | 87 | | foreach (var item in Archives) |
| | 88 | | { |
| 0 | 89 | | writer.WriteStringValue(item); |
| | 90 | | } |
| 0 | 91 | | writer.WriteEndArray(); |
| | 92 | | } |
| 0 | 93 | | if (Optional.IsCollectionDefined(Configuration)) |
| | 94 | | { |
| 0 | 95 | | writer.WritePropertyName("conf"); |
| 0 | 96 | | writer.WriteStartObject(); |
| 0 | 97 | | foreach (var item in Configuration) |
| | 98 | | { |
| 0 | 99 | | writer.WritePropertyName(item.Key); |
| 0 | 100 | | writer.WriteStringValue(item.Value); |
| | 101 | | } |
| 0 | 102 | | writer.WriteEndObject(); |
| | 103 | | } |
| 0 | 104 | | if (Optional.IsDefined(DriverMemory)) |
| | 105 | | { |
| 0 | 106 | | writer.WritePropertyName("driverMemory"); |
| 0 | 107 | | writer.WriteStringValue(DriverMemory); |
| | 108 | | } |
| 0 | 109 | | if (Optional.IsDefined(DriverCores)) |
| | 110 | | { |
| 0 | 111 | | writer.WritePropertyName("driverCores"); |
| 0 | 112 | | writer.WriteNumberValue(DriverCores.Value); |
| | 113 | | } |
| 0 | 114 | | if (Optional.IsDefined(ExecutorMemory)) |
| | 115 | | { |
| 0 | 116 | | writer.WritePropertyName("executorMemory"); |
| 0 | 117 | | writer.WriteStringValue(ExecutorMemory); |
| | 118 | | } |
| 0 | 119 | | if (Optional.IsDefined(ExecutorCores)) |
| | 120 | | { |
| 0 | 121 | | writer.WritePropertyName("executorCores"); |
| 0 | 122 | | writer.WriteNumberValue(ExecutorCores.Value); |
| | 123 | | } |
| 0 | 124 | | if (Optional.IsDefined(ExecutorCount)) |
| | 125 | | { |
| 0 | 126 | | writer.WritePropertyName("numExecutors"); |
| 0 | 127 | | writer.WriteNumberValue(ExecutorCount.Value); |
| | 128 | | } |
| 0 | 129 | | writer.WriteEndObject(); |
| 0 | 130 | | } |
| | 131 | | } |
| | 132 | | } |