| | 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 Activity : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | writer.WritePropertyName("name"); |
| 0 | 20 | | writer.WriteStringValue(Name); |
| 0 | 21 | | writer.WritePropertyName("type"); |
| 0 | 22 | | writer.WriteStringValue(Type); |
| 0 | 23 | | if (Optional.IsDefined(Description)) |
| | 24 | | { |
| 0 | 25 | | writer.WritePropertyName("description"); |
| 0 | 26 | | writer.WriteStringValue(Description); |
| | 27 | | } |
| 0 | 28 | | if (Optional.IsCollectionDefined(DependsOn)) |
| | 29 | | { |
| 0 | 30 | | writer.WritePropertyName("dependsOn"); |
| 0 | 31 | | writer.WriteStartArray(); |
| 0 | 32 | | foreach (var item in DependsOn) |
| | 33 | | { |
| 0 | 34 | | writer.WriteObjectValue(item); |
| | 35 | | } |
| 0 | 36 | | writer.WriteEndArray(); |
| | 37 | | } |
| 0 | 38 | | if (Optional.IsCollectionDefined(UserProperties)) |
| | 39 | | { |
| 0 | 40 | | writer.WritePropertyName("userProperties"); |
| 0 | 41 | | writer.WriteStartArray(); |
| 0 | 42 | | foreach (var item in UserProperties) |
| | 43 | | { |
| 0 | 44 | | writer.WriteObjectValue(item); |
| | 45 | | } |
| 0 | 46 | | writer.WriteEndArray(); |
| | 47 | | } |
| 0 | 48 | | foreach (var item in AdditionalProperties) |
| | 49 | | { |
| 0 | 50 | | writer.WritePropertyName(item.Key); |
| 0 | 51 | | writer.WriteObjectValue(item.Value); |
| | 52 | | } |
| 0 | 53 | | writer.WriteEndObject(); |
| 0 | 54 | | } |
| | 55 | |
|
| | 56 | | internal static Activity DeserializeActivity(JsonElement element) |
| | 57 | | { |
| 8 | 58 | | if (element.TryGetProperty("type", out JsonElement discriminator)) |
| | 59 | | { |
| 8 | 60 | | switch (discriminator.GetString()) |
| | 61 | | { |
| 0 | 62 | | case "AppendVariable": return AppendVariableActivity.DeserializeAppendVariableActivity(element); |
| 0 | 63 | | case "AzureDataExplorerCommand": return AzureDataExplorerCommandActivity.DeserializeAzureDataExplore |
| 0 | 64 | | case "AzureFunctionActivity": return AzureFunctionActivity.DeserializeAzureFunctionActivity(element) |
| 0 | 65 | | case "AzureMLBatchExecution": return AzureMLBatchExecutionActivity.DeserializeAzureMLBatchExecutionA |
| 0 | 66 | | case "AzureMLExecutePipeline": return AzureMLExecutePipelineActivity.DeserializeAzureMLExecutePipeli |
| 0 | 67 | | case "AzureMLUpdateResource": return AzureMLUpdateResourceActivity.DeserializeAzureMLUpdateResourceA |
| 0 | 68 | | case "Container": return ControlActivity.DeserializeControlActivity(element); |
| 0 | 69 | | case "Copy": return CopyActivity.DeserializeCopyActivity(element); |
| 0 | 70 | | case "Custom": return CustomActivity.DeserializeCustomActivity(element); |
| 0 | 71 | | case "DataLakeAnalyticsU-SQL": return DataLakeAnalyticsUsqlActivity.DeserializeDataLakeAnalyticsUsql |
| 0 | 72 | | case "DatabricksNotebook": return DatabricksNotebookActivity.DeserializeDatabricksNotebookActivity(e |
| 0 | 73 | | case "DatabricksSparkJar": return DatabricksSparkJarActivity.DeserializeDatabricksSparkJarActivity(e |
| 0 | 74 | | case "DatabricksSparkPython": return DatabricksSparkPythonActivity.DeserializeDatabricksSparkPythonA |
| 0 | 75 | | case "Delete": return DeleteActivity.DeserializeDeleteActivity(element); |
| 0 | 76 | | case "ExecuteDataFlow": return ExecuteDataFlowActivity.DeserializeExecuteDataFlowActivity(element); |
| 0 | 77 | | case "ExecutePipeline": return ExecutePipelineActivity.DeserializeExecutePipelineActivity(element); |
| 0 | 78 | | case "ExecuteSSISPackage": return ExecuteSsisPackageActivity.DeserializeExecuteSsisPackageActivity(e |
| 0 | 79 | | case "Execution": return ExecutionActivity.DeserializeExecutionActivity(element); |
| 0 | 80 | | case "Filter": return FilterActivity.DeserializeFilterActivity(element); |
| 0 | 81 | | case "ForEach": return ForEachActivity.DeserializeForEachActivity(element); |
| 0 | 82 | | case "GetMetadata": return GetMetadataActivity.DeserializeGetMetadataActivity(element); |
| 0 | 83 | | case "HDInsightHive": return HDInsightHiveActivity.DeserializeHDInsightHiveActivity(element); |
| 0 | 84 | | case "HDInsightMapReduce": return HDInsightMapReduceActivity.DeserializeHDInsightMapReduceActivity(e |
| 0 | 85 | | case "HDInsightPig": return HDInsightPigActivity.DeserializeHDInsightPigActivity(element); |
| 0 | 86 | | case "HDInsightSpark": return HDInsightSparkActivity.DeserializeHDInsightSparkActivity(element); |
| 0 | 87 | | case "HDInsightStreaming": return HDInsightStreamingActivity.DeserializeHDInsightStreamingActivity(e |
| 0 | 88 | | case "IfCondition": return IfConditionActivity.DeserializeIfConditionActivity(element); |
| 0 | 89 | | case "Lookup": return LookupActivity.DeserializeLookupActivity(element); |
| 0 | 90 | | case "SetVariable": return SetVariableActivity.DeserializeSetVariableActivity(element); |
| 0 | 91 | | case "SqlServerStoredProcedure": return SqlServerStoredProcedureActivity.DeserializeSqlServerStoredP |
| 0 | 92 | | case "Switch": return SwitchActivity.DeserializeSwitchActivity(element); |
| 0 | 93 | | case "Until": return UntilActivity.DeserializeUntilActivity(element); |
| 0 | 94 | | case "Validation": return ValidationActivity.DeserializeValidationActivity(element); |
| 0 | 95 | | case "Wait": return WaitActivity.DeserializeWaitActivity(element); |
| 0 | 96 | | case "WebActivity": return WebActivity.DeserializeWebActivity(element); |
| 0 | 97 | | case "WebHook": return WebHookActivity.DeserializeWebHookActivity(element); |
| | 98 | | } |
| | 99 | | } |
| 8 | 100 | | string name = default; |
| 8 | 101 | | string type = default; |
| 8 | 102 | | Optional<string> description = default; |
| 8 | 103 | | Optional<IList<ActivityDependency>> dependsOn = default; |
| 8 | 104 | | Optional<IList<UserProperty>> userProperties = default; |
| 8 | 105 | | IDictionary<string, object> additionalProperties = default; |
| 8 | 106 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 112 | 107 | | foreach (var property in element.EnumerateObject()) |
| | 108 | | { |
| 48 | 109 | | if (property.NameEquals("name")) |
| | 110 | | { |
| 8 | 111 | | name = property.Value.GetString(); |
| 8 | 112 | | continue; |
| | 113 | | } |
| 40 | 114 | | if (property.NameEquals("type")) |
| | 115 | | { |
| 8 | 116 | | type = property.Value.GetString(); |
| 8 | 117 | | continue; |
| | 118 | | } |
| 32 | 119 | | if (property.NameEquals("description")) |
| | 120 | | { |
| 0 | 121 | | description = property.Value.GetString(); |
| 0 | 122 | | continue; |
| | 123 | | } |
| 32 | 124 | | if (property.NameEquals("dependsOn")) |
| | 125 | | { |
| 8 | 126 | | List<ActivityDependency> array = new List<ActivityDependency>(); |
| 0 | 127 | | foreach (var item in property.Value.EnumerateArray()) |
| | 128 | | { |
| 0 | 129 | | array.Add(ActivityDependency.DeserializeActivityDependency(item)); |
| | 130 | | } |
| 8 | 131 | | dependsOn = array; |
| 8 | 132 | | continue; |
| | 133 | | } |
| 24 | 134 | | if (property.NameEquals("userProperties")) |
| | 135 | | { |
| 8 | 136 | | List<UserProperty> array = new List<UserProperty>(); |
| 0 | 137 | | foreach (var item in property.Value.EnumerateArray()) |
| | 138 | | { |
| 0 | 139 | | array.Add(UserProperty.DeserializeUserProperty(item)); |
| | 140 | | } |
| 8 | 141 | | userProperties = array; |
| 8 | 142 | | continue; |
| | 143 | | } |
| 16 | 144 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 16 | 145 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 146 | | } |
| 8 | 147 | | additionalProperties = additionalPropertiesDictionary; |
| 8 | 148 | | return new Activity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userPropertie |
| | 149 | | } |
| | 150 | | } |
| | 151 | | } |