| | 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 CopyActivity : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Optional.IsCollectionDefined(Inputs)) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("inputs"); |
| 0 | 22 | | writer.WriteStartArray(); |
| 0 | 23 | | foreach (var item in Inputs) |
| | 24 | | { |
| 0 | 25 | | writer.WriteObjectValue(item); |
| | 26 | | } |
| 0 | 27 | | writer.WriteEndArray(); |
| | 28 | | } |
| 0 | 29 | | if (Optional.IsCollectionDefined(Outputs)) |
| | 30 | | { |
| 0 | 31 | | writer.WritePropertyName("outputs"); |
| 0 | 32 | | writer.WriteStartArray(); |
| 0 | 33 | | foreach (var item in Outputs) |
| | 34 | | { |
| 0 | 35 | | writer.WriteObjectValue(item); |
| | 36 | | } |
| 0 | 37 | | writer.WriteEndArray(); |
| | 38 | | } |
| 0 | 39 | | if (Optional.IsDefined(LinkedServiceName)) |
| | 40 | | { |
| 0 | 41 | | writer.WritePropertyName("linkedServiceName"); |
| 0 | 42 | | writer.WriteObjectValue(LinkedServiceName); |
| | 43 | | } |
| 0 | 44 | | if (Optional.IsDefined(Policy)) |
| | 45 | | { |
| 0 | 46 | | writer.WritePropertyName("policy"); |
| 0 | 47 | | writer.WriteObjectValue(Policy); |
| | 48 | | } |
| 0 | 49 | | writer.WritePropertyName("name"); |
| 0 | 50 | | writer.WriteStringValue(Name); |
| 0 | 51 | | writer.WritePropertyName("type"); |
| 0 | 52 | | writer.WriteStringValue(Type); |
| 0 | 53 | | if (Optional.IsDefined(Description)) |
| | 54 | | { |
| 0 | 55 | | writer.WritePropertyName("description"); |
| 0 | 56 | | writer.WriteStringValue(Description); |
| | 57 | | } |
| 0 | 58 | | if (Optional.IsCollectionDefined(DependsOn)) |
| | 59 | | { |
| 0 | 60 | | writer.WritePropertyName("dependsOn"); |
| 0 | 61 | | writer.WriteStartArray(); |
| 0 | 62 | | foreach (var item in DependsOn) |
| | 63 | | { |
| 0 | 64 | | writer.WriteObjectValue(item); |
| | 65 | | } |
| 0 | 66 | | writer.WriteEndArray(); |
| | 67 | | } |
| 0 | 68 | | if (Optional.IsCollectionDefined(UserProperties)) |
| | 69 | | { |
| 0 | 70 | | writer.WritePropertyName("userProperties"); |
| 0 | 71 | | writer.WriteStartArray(); |
| 0 | 72 | | foreach (var item in UserProperties) |
| | 73 | | { |
| 0 | 74 | | writer.WriteObjectValue(item); |
| | 75 | | } |
| 0 | 76 | | writer.WriteEndArray(); |
| | 77 | | } |
| 0 | 78 | | writer.WritePropertyName("typeProperties"); |
| 0 | 79 | | writer.WriteStartObject(); |
| 0 | 80 | | writer.WritePropertyName("source"); |
| 0 | 81 | | writer.WriteObjectValue(Source); |
| 0 | 82 | | writer.WritePropertyName("sink"); |
| 0 | 83 | | writer.WriteObjectValue(Sink); |
| 0 | 84 | | if (Optional.IsDefined(Translator)) |
| | 85 | | { |
| 0 | 86 | | writer.WritePropertyName("translator"); |
| 0 | 87 | | writer.WriteObjectValue(Translator); |
| | 88 | | } |
| 0 | 89 | | if (Optional.IsDefined(EnableStaging)) |
| | 90 | | { |
| 0 | 91 | | writer.WritePropertyName("enableStaging"); |
| 0 | 92 | | writer.WriteObjectValue(EnableStaging); |
| | 93 | | } |
| 0 | 94 | | if (Optional.IsDefined(StagingSettings)) |
| | 95 | | { |
| 0 | 96 | | writer.WritePropertyName("stagingSettings"); |
| 0 | 97 | | writer.WriteObjectValue(StagingSettings); |
| | 98 | | } |
| 0 | 99 | | if (Optional.IsDefined(ParallelCopies)) |
| | 100 | | { |
| 0 | 101 | | writer.WritePropertyName("parallelCopies"); |
| 0 | 102 | | writer.WriteObjectValue(ParallelCopies); |
| | 103 | | } |
| 0 | 104 | | if (Optional.IsDefined(DataIntegrationUnits)) |
| | 105 | | { |
| 0 | 106 | | writer.WritePropertyName("dataIntegrationUnits"); |
| 0 | 107 | | writer.WriteObjectValue(DataIntegrationUnits); |
| | 108 | | } |
| 0 | 109 | | if (Optional.IsDefined(EnableSkipIncompatibleRow)) |
| | 110 | | { |
| 0 | 111 | | writer.WritePropertyName("enableSkipIncompatibleRow"); |
| 0 | 112 | | writer.WriteObjectValue(EnableSkipIncompatibleRow); |
| | 113 | | } |
| 0 | 114 | | if (Optional.IsDefined(RedirectIncompatibleRowSettings)) |
| | 115 | | { |
| 0 | 116 | | writer.WritePropertyName("redirectIncompatibleRowSettings"); |
| 0 | 117 | | writer.WriteObjectValue(RedirectIncompatibleRowSettings); |
| | 118 | | } |
| 0 | 119 | | if (Optional.IsCollectionDefined(PreserveRules)) |
| | 120 | | { |
| 0 | 121 | | writer.WritePropertyName("preserveRules"); |
| 0 | 122 | | writer.WriteStartArray(); |
| 0 | 123 | | foreach (var item in PreserveRules) |
| | 124 | | { |
| 0 | 125 | | writer.WriteObjectValue(item); |
| | 126 | | } |
| 0 | 127 | | writer.WriteEndArray(); |
| | 128 | | } |
| 0 | 129 | | if (Optional.IsCollectionDefined(Preserve)) |
| | 130 | | { |
| 0 | 131 | | writer.WritePropertyName("preserve"); |
| 0 | 132 | | writer.WriteStartArray(); |
| 0 | 133 | | foreach (var item in Preserve) |
| | 134 | | { |
| 0 | 135 | | writer.WriteObjectValue(item); |
| | 136 | | } |
| 0 | 137 | | writer.WriteEndArray(); |
| | 138 | | } |
| 0 | 139 | | writer.WriteEndObject(); |
| 0 | 140 | | foreach (var item in AdditionalProperties) |
| | 141 | | { |
| 0 | 142 | | writer.WritePropertyName(item.Key); |
| 0 | 143 | | writer.WriteObjectValue(item.Value); |
| | 144 | | } |
| 0 | 145 | | writer.WriteEndObject(); |
| 0 | 146 | | } |
| | 147 | |
|
| | 148 | | internal static CopyActivity DeserializeCopyActivity(JsonElement element) |
| | 149 | | { |
| 0 | 150 | | Optional<IList<DatasetReference>> inputs = default; |
| 0 | 151 | | Optional<IList<DatasetReference>> outputs = default; |
| 0 | 152 | | Optional<LinkedServiceReference> linkedServiceName = default; |
| 0 | 153 | | Optional<ActivityPolicy> policy = default; |
| 0 | 154 | | string name = default; |
| 0 | 155 | | string type = default; |
| 0 | 156 | | Optional<string> description = default; |
| 0 | 157 | | Optional<IList<ActivityDependency>> dependsOn = default; |
| 0 | 158 | | Optional<IList<UserProperty>> userProperties = default; |
| 0 | 159 | | CopySource source = default; |
| 0 | 160 | | CopySink sink = default; |
| 0 | 161 | | Optional<object> translator = default; |
| 0 | 162 | | Optional<object> enableStaging = default; |
| 0 | 163 | | Optional<StagingSettings> stagingSettings = default; |
| 0 | 164 | | Optional<object> parallelCopies = default; |
| 0 | 165 | | Optional<object> dataIntegrationUnits = default; |
| 0 | 166 | | Optional<object> enableSkipIncompatibleRow = default; |
| 0 | 167 | | Optional<RedirectIncompatibleRowSettings> redirectIncompatibleRowSettings = default; |
| 0 | 168 | | Optional<IList<object>> preserveRules = default; |
| 0 | 169 | | Optional<IList<object>> preserve = default; |
| 0 | 170 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 171 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 172 | | foreach (var property in element.EnumerateObject()) |
| | 173 | | { |
| 0 | 174 | | if (property.NameEquals("inputs")) |
| | 175 | | { |
| 0 | 176 | | List<DatasetReference> array = new List<DatasetReference>(); |
| 0 | 177 | | foreach (var item in property.Value.EnumerateArray()) |
| | 178 | | { |
| 0 | 179 | | array.Add(DatasetReference.DeserializeDatasetReference(item)); |
| | 180 | | } |
| 0 | 181 | | inputs = array; |
| 0 | 182 | | continue; |
| | 183 | | } |
| 0 | 184 | | if (property.NameEquals("outputs")) |
| | 185 | | { |
| 0 | 186 | | List<DatasetReference> array = new List<DatasetReference>(); |
| 0 | 187 | | foreach (var item in property.Value.EnumerateArray()) |
| | 188 | | { |
| 0 | 189 | | array.Add(DatasetReference.DeserializeDatasetReference(item)); |
| | 190 | | } |
| 0 | 191 | | outputs = array; |
| 0 | 192 | | continue; |
| | 193 | | } |
| 0 | 194 | | if (property.NameEquals("linkedServiceName")) |
| | 195 | | { |
| 0 | 196 | | linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value); |
| 0 | 197 | | continue; |
| | 198 | | } |
| 0 | 199 | | if (property.NameEquals("policy")) |
| | 200 | | { |
| 0 | 201 | | policy = ActivityPolicy.DeserializeActivityPolicy(property.Value); |
| 0 | 202 | | continue; |
| | 203 | | } |
| 0 | 204 | | if (property.NameEquals("name")) |
| | 205 | | { |
| 0 | 206 | | name = property.Value.GetString(); |
| 0 | 207 | | continue; |
| | 208 | | } |
| 0 | 209 | | if (property.NameEquals("type")) |
| | 210 | | { |
| 0 | 211 | | type = property.Value.GetString(); |
| 0 | 212 | | continue; |
| | 213 | | } |
| 0 | 214 | | if (property.NameEquals("description")) |
| | 215 | | { |
| 0 | 216 | | description = property.Value.GetString(); |
| 0 | 217 | | continue; |
| | 218 | | } |
| 0 | 219 | | if (property.NameEquals("dependsOn")) |
| | 220 | | { |
| 0 | 221 | | List<ActivityDependency> array = new List<ActivityDependency>(); |
| 0 | 222 | | foreach (var item in property.Value.EnumerateArray()) |
| | 223 | | { |
| 0 | 224 | | array.Add(ActivityDependency.DeserializeActivityDependency(item)); |
| | 225 | | } |
| 0 | 226 | | dependsOn = array; |
| 0 | 227 | | continue; |
| | 228 | | } |
| 0 | 229 | | if (property.NameEquals("userProperties")) |
| | 230 | | { |
| 0 | 231 | | List<UserProperty> array = new List<UserProperty>(); |
| 0 | 232 | | foreach (var item in property.Value.EnumerateArray()) |
| | 233 | | { |
| 0 | 234 | | array.Add(UserProperty.DeserializeUserProperty(item)); |
| | 235 | | } |
| 0 | 236 | | userProperties = array; |
| 0 | 237 | | continue; |
| | 238 | | } |
| 0 | 239 | | if (property.NameEquals("typeProperties")) |
| | 240 | | { |
| 0 | 241 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 242 | | { |
| 0 | 243 | | if (property0.NameEquals("source")) |
| | 244 | | { |
| 0 | 245 | | source = CopySource.DeserializeCopySource(property0.Value); |
| 0 | 246 | | continue; |
| | 247 | | } |
| 0 | 248 | | if (property0.NameEquals("sink")) |
| | 249 | | { |
| 0 | 250 | | sink = CopySink.DeserializeCopySink(property0.Value); |
| 0 | 251 | | continue; |
| | 252 | | } |
| 0 | 253 | | if (property0.NameEquals("translator")) |
| | 254 | | { |
| 0 | 255 | | translator = property0.Value.GetObject(); |
| 0 | 256 | | continue; |
| | 257 | | } |
| 0 | 258 | | if (property0.NameEquals("enableStaging")) |
| | 259 | | { |
| 0 | 260 | | enableStaging = property0.Value.GetObject(); |
| 0 | 261 | | continue; |
| | 262 | | } |
| 0 | 263 | | if (property0.NameEquals("stagingSettings")) |
| | 264 | | { |
| 0 | 265 | | stagingSettings = StagingSettings.DeserializeStagingSettings(property0.Value); |
| 0 | 266 | | continue; |
| | 267 | | } |
| 0 | 268 | | if (property0.NameEquals("parallelCopies")) |
| | 269 | | { |
| 0 | 270 | | parallelCopies = property0.Value.GetObject(); |
| 0 | 271 | | continue; |
| | 272 | | } |
| 0 | 273 | | if (property0.NameEquals("dataIntegrationUnits")) |
| | 274 | | { |
| 0 | 275 | | dataIntegrationUnits = property0.Value.GetObject(); |
| 0 | 276 | | continue; |
| | 277 | | } |
| 0 | 278 | | if (property0.NameEquals("enableSkipIncompatibleRow")) |
| | 279 | | { |
| 0 | 280 | | enableSkipIncompatibleRow = property0.Value.GetObject(); |
| 0 | 281 | | continue; |
| | 282 | | } |
| 0 | 283 | | if (property0.NameEquals("redirectIncompatibleRowSettings")) |
| | 284 | | { |
| 0 | 285 | | redirectIncompatibleRowSettings = RedirectIncompatibleRowSettings.DeserializeRedirectIncompa |
| 0 | 286 | | continue; |
| | 287 | | } |
| 0 | 288 | | if (property0.NameEquals("preserveRules")) |
| | 289 | | { |
| 0 | 290 | | List<object> array = new List<object>(); |
| 0 | 291 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 292 | | { |
| 0 | 293 | | array.Add(item.GetObject()); |
| | 294 | | } |
| 0 | 295 | | preserveRules = array; |
| 0 | 296 | | continue; |
| | 297 | | } |
| 0 | 298 | | if (property0.NameEquals("preserve")) |
| | 299 | | { |
| 0 | 300 | | List<object> array = new List<object>(); |
| 0 | 301 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 302 | | { |
| 0 | 303 | | array.Add(item.GetObject()); |
| | 304 | | } |
| 0 | 305 | | preserve = array; |
| | 306 | | continue; |
| | 307 | | } |
| | 308 | | } |
| | 309 | | continue; |
| | 310 | | } |
| 0 | 311 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 312 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 313 | | } |
| 0 | 314 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 315 | | return new CopyActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userPrope |
| | 316 | | } |
| | 317 | | } |
| | 318 | | } |