| | 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.Artifacts.Models |
| | 13 | | { |
| | 14 | | public partial class DataLakeAnalyticsUsqlActivity : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Optional.IsDefined(LinkedServiceName)) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("linkedServiceName"); |
| 0 | 22 | | writer.WriteObjectValue(LinkedServiceName); |
| | 23 | | } |
| 0 | 24 | | if (Optional.IsDefined(Policy)) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("policy"); |
| 0 | 27 | | writer.WriteObjectValue(Policy); |
| | 28 | | } |
| 0 | 29 | | writer.WritePropertyName("name"); |
| 0 | 30 | | writer.WriteStringValue(Name); |
| 0 | 31 | | writer.WritePropertyName("type"); |
| 0 | 32 | | writer.WriteStringValue(Type); |
| 0 | 33 | | if (Optional.IsDefined(Description)) |
| | 34 | | { |
| 0 | 35 | | writer.WritePropertyName("description"); |
| 0 | 36 | | writer.WriteStringValue(Description); |
| | 37 | | } |
| 0 | 38 | | if (Optional.IsCollectionDefined(DependsOn)) |
| | 39 | | { |
| 0 | 40 | | writer.WritePropertyName("dependsOn"); |
| 0 | 41 | | writer.WriteStartArray(); |
| 0 | 42 | | foreach (var item in DependsOn) |
| | 43 | | { |
| 0 | 44 | | writer.WriteObjectValue(item); |
| | 45 | | } |
| 0 | 46 | | writer.WriteEndArray(); |
| | 47 | | } |
| 0 | 48 | | if (Optional.IsCollectionDefined(UserProperties)) |
| | 49 | | { |
| 0 | 50 | | writer.WritePropertyName("userProperties"); |
| 0 | 51 | | writer.WriteStartArray(); |
| 0 | 52 | | foreach (var item in UserProperties) |
| | 53 | | { |
| 0 | 54 | | writer.WriteObjectValue(item); |
| | 55 | | } |
| 0 | 56 | | writer.WriteEndArray(); |
| | 57 | | } |
| 0 | 58 | | writer.WritePropertyName("typeProperties"); |
| 0 | 59 | | writer.WriteStartObject(); |
| 0 | 60 | | writer.WritePropertyName("scriptPath"); |
| 0 | 61 | | writer.WriteObjectValue(ScriptPath); |
| 0 | 62 | | writer.WritePropertyName("scriptLinkedService"); |
| 0 | 63 | | writer.WriteObjectValue(ScriptLinkedService); |
| 0 | 64 | | if (Optional.IsDefined(DegreeOfParallelism)) |
| | 65 | | { |
| 0 | 66 | | writer.WritePropertyName("degreeOfParallelism"); |
| 0 | 67 | | writer.WriteObjectValue(DegreeOfParallelism); |
| | 68 | | } |
| 0 | 69 | | if (Optional.IsDefined(Priority)) |
| | 70 | | { |
| 0 | 71 | | writer.WritePropertyName("priority"); |
| 0 | 72 | | writer.WriteObjectValue(Priority); |
| | 73 | | } |
| 0 | 74 | | if (Optional.IsCollectionDefined(Parameters)) |
| | 75 | | { |
| 0 | 76 | | writer.WritePropertyName("parameters"); |
| 0 | 77 | | writer.WriteStartObject(); |
| 0 | 78 | | foreach (var item in Parameters) |
| | 79 | | { |
| 0 | 80 | | writer.WritePropertyName(item.Key); |
| 0 | 81 | | writer.WriteObjectValue(item.Value); |
| | 82 | | } |
| 0 | 83 | | writer.WriteEndObject(); |
| | 84 | | } |
| 0 | 85 | | if (Optional.IsDefined(RuntimeVersion)) |
| | 86 | | { |
| 0 | 87 | | writer.WritePropertyName("runtimeVersion"); |
| 0 | 88 | | writer.WriteObjectValue(RuntimeVersion); |
| | 89 | | } |
| 0 | 90 | | if (Optional.IsDefined(CompilationMode)) |
| | 91 | | { |
| 0 | 92 | | writer.WritePropertyName("compilationMode"); |
| 0 | 93 | | writer.WriteObjectValue(CompilationMode); |
| | 94 | | } |
| 0 | 95 | | writer.WriteEndObject(); |
| 0 | 96 | | foreach (var item in AdditionalProperties) |
| | 97 | | { |
| 0 | 98 | | writer.WritePropertyName(item.Key); |
| 0 | 99 | | writer.WriteObjectValue(item.Value); |
| | 100 | | } |
| 0 | 101 | | writer.WriteEndObject(); |
| 0 | 102 | | } |
| | 103 | |
|
| | 104 | | internal static DataLakeAnalyticsUsqlActivity DeserializeDataLakeAnalyticsUsqlActivity(JsonElement element) |
| | 105 | | { |
| 0 | 106 | | Optional<LinkedServiceReference> linkedServiceName = default; |
| 0 | 107 | | Optional<ActivityPolicy> policy = default; |
| 0 | 108 | | string name = default; |
| 0 | 109 | | string type = default; |
| 0 | 110 | | Optional<string> description = default; |
| 0 | 111 | | Optional<IList<ActivityDependency>> dependsOn = default; |
| 0 | 112 | | Optional<IList<UserProperty>> userProperties = default; |
| 0 | 113 | | object scriptPath = default; |
| 0 | 114 | | LinkedServiceReference scriptLinkedService = default; |
| 0 | 115 | | Optional<object> degreeOfParallelism = default; |
| 0 | 116 | | Optional<object> priority = default; |
| 0 | 117 | | Optional<IDictionary<string, object>> parameters = default; |
| 0 | 118 | | Optional<object> runtimeVersion = default; |
| 0 | 119 | | Optional<object> compilationMode = default; |
| 0 | 120 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 121 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 122 | | foreach (var property in element.EnumerateObject()) |
| | 123 | | { |
| 0 | 124 | | if (property.NameEquals("linkedServiceName")) |
| | 125 | | { |
| 0 | 126 | | linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value); |
| 0 | 127 | | continue; |
| | 128 | | } |
| 0 | 129 | | if (property.NameEquals("policy")) |
| | 130 | | { |
| 0 | 131 | | policy = ActivityPolicy.DeserializeActivityPolicy(property.Value); |
| 0 | 132 | | continue; |
| | 133 | | } |
| 0 | 134 | | if (property.NameEquals("name")) |
| | 135 | | { |
| 0 | 136 | | name = property.Value.GetString(); |
| 0 | 137 | | continue; |
| | 138 | | } |
| 0 | 139 | | if (property.NameEquals("type")) |
| | 140 | | { |
| 0 | 141 | | type = property.Value.GetString(); |
| 0 | 142 | | continue; |
| | 143 | | } |
| 0 | 144 | | if (property.NameEquals("description")) |
| | 145 | | { |
| 0 | 146 | | description = property.Value.GetString(); |
| 0 | 147 | | continue; |
| | 148 | | } |
| 0 | 149 | | if (property.NameEquals("dependsOn")) |
| | 150 | | { |
| 0 | 151 | | List<ActivityDependency> array = new List<ActivityDependency>(); |
| 0 | 152 | | foreach (var item in property.Value.EnumerateArray()) |
| | 153 | | { |
| 0 | 154 | | array.Add(ActivityDependency.DeserializeActivityDependency(item)); |
| | 155 | | } |
| 0 | 156 | | dependsOn = array; |
| 0 | 157 | | continue; |
| | 158 | | } |
| 0 | 159 | | if (property.NameEquals("userProperties")) |
| | 160 | | { |
| 0 | 161 | | List<UserProperty> array = new List<UserProperty>(); |
| 0 | 162 | | foreach (var item in property.Value.EnumerateArray()) |
| | 163 | | { |
| 0 | 164 | | array.Add(UserProperty.DeserializeUserProperty(item)); |
| | 165 | | } |
| 0 | 166 | | userProperties = array; |
| 0 | 167 | | continue; |
| | 168 | | } |
| 0 | 169 | | if (property.NameEquals("typeProperties")) |
| | 170 | | { |
| 0 | 171 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 172 | | { |
| 0 | 173 | | if (property0.NameEquals("scriptPath")) |
| | 174 | | { |
| 0 | 175 | | scriptPath = property0.Value.GetObject(); |
| 0 | 176 | | continue; |
| | 177 | | } |
| 0 | 178 | | if (property0.NameEquals("scriptLinkedService")) |
| | 179 | | { |
| 0 | 180 | | scriptLinkedService = LinkedServiceReference.DeserializeLinkedServiceReference(property0.Val |
| 0 | 181 | | continue; |
| | 182 | | } |
| 0 | 183 | | if (property0.NameEquals("degreeOfParallelism")) |
| | 184 | | { |
| 0 | 185 | | degreeOfParallelism = property0.Value.GetObject(); |
| 0 | 186 | | continue; |
| | 187 | | } |
| 0 | 188 | | if (property0.NameEquals("priority")) |
| | 189 | | { |
| 0 | 190 | | priority = property0.Value.GetObject(); |
| 0 | 191 | | continue; |
| | 192 | | } |
| 0 | 193 | | if (property0.NameEquals("parameters")) |
| | 194 | | { |
| 0 | 195 | | Dictionary<string, object> dictionary = new Dictionary<string, object>(); |
| 0 | 196 | | foreach (var property1 in property0.Value.EnumerateObject()) |
| | 197 | | { |
| 0 | 198 | | dictionary.Add(property1.Name, property1.Value.GetObject()); |
| | 199 | | } |
| 0 | 200 | | parameters = dictionary; |
| 0 | 201 | | continue; |
| | 202 | | } |
| 0 | 203 | | if (property0.NameEquals("runtimeVersion")) |
| | 204 | | { |
| 0 | 205 | | runtimeVersion = property0.Value.GetObject(); |
| 0 | 206 | | continue; |
| | 207 | | } |
| 0 | 208 | | if (property0.NameEquals("compilationMode")) |
| | 209 | | { |
| 0 | 210 | | compilationMode = property0.Value.GetObject(); |
| | 211 | | continue; |
| | 212 | | } |
| | 213 | | } |
| | 214 | | continue; |
| | 215 | | } |
| 0 | 216 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 217 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 218 | | } |
| 0 | 219 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 220 | | return new DataLakeAnalyticsUsqlActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional |
| | 221 | | } |
| | 222 | | } |
| | 223 | | } |