| | 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 ExecutionActivity : 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 | | foreach (var item in AdditionalProperties) |
| | 59 | | { |
| 0 | 60 | | writer.WritePropertyName(item.Key); |
| 0 | 61 | | writer.WriteObjectValue(item.Value); |
| | 62 | | } |
| 0 | 63 | | writer.WriteEndObject(); |
| 0 | 64 | | } |
| | 65 | |
|
| | 66 | | internal static ExecutionActivity DeserializeExecutionActivity(JsonElement element) |
| | 67 | | { |
| 0 | 68 | | if (element.TryGetProperty("type", out JsonElement discriminator)) |
| | 69 | | { |
| 0 | 70 | | switch (discriminator.GetString()) |
| | 71 | | { |
| 0 | 72 | | case "AzureDataExplorerCommand": return AzureDataExplorerCommandActivity.DeserializeAzureDataExplore |
| 0 | 73 | | case "AzureFunctionActivity": return AzureFunctionActivity.DeserializeAzureFunctionActivity(element) |
| 0 | 74 | | case "AzureMLBatchExecution": return AzureMLBatchExecutionActivity.DeserializeAzureMLBatchExecutionA |
| 0 | 75 | | case "AzureMLExecutePipeline": return AzureMLExecutePipelineActivity.DeserializeAzureMLExecutePipeli |
| 0 | 76 | | case "AzureMLUpdateResource": return AzureMLUpdateResourceActivity.DeserializeAzureMLUpdateResourceA |
| 0 | 77 | | case "Copy": return CopyActivity.DeserializeCopyActivity(element); |
| 0 | 78 | | case "Custom": return CustomActivity.DeserializeCustomActivity(element); |
| 0 | 79 | | case "DataLakeAnalyticsU-SQL": return DataLakeAnalyticsUsqlActivity.DeserializeDataLakeAnalyticsUsql |
| 0 | 80 | | case "DatabricksNotebook": return DatabricksNotebookActivity.DeserializeDatabricksNotebookActivity(e |
| 0 | 81 | | case "DatabricksSparkJar": return DatabricksSparkJarActivity.DeserializeDatabricksSparkJarActivity(e |
| 0 | 82 | | case "DatabricksSparkPython": return DatabricksSparkPythonActivity.DeserializeDatabricksSparkPythonA |
| 0 | 83 | | case "Delete": return DeleteActivity.DeserializeDeleteActivity(element); |
| 0 | 84 | | case "ExecuteDataFlow": return ExecuteDataFlowActivity.DeserializeExecuteDataFlowActivity(element); |
| 0 | 85 | | case "ExecuteSSISPackage": return ExecuteSsisPackageActivity.DeserializeExecuteSsisPackageActivity(e |
| 0 | 86 | | case "GetMetadata": return GetMetadataActivity.DeserializeGetMetadataActivity(element); |
| 0 | 87 | | case "HDInsightHive": return HDInsightHiveActivity.DeserializeHDInsightHiveActivity(element); |
| 0 | 88 | | case "HDInsightMapReduce": return HDInsightMapReduceActivity.DeserializeHDInsightMapReduceActivity(e |
| 0 | 89 | | case "HDInsightPig": return HDInsightPigActivity.DeserializeHDInsightPigActivity(element); |
| 0 | 90 | | case "HDInsightSpark": return HDInsightSparkActivity.DeserializeHDInsightSparkActivity(element); |
| 0 | 91 | | case "HDInsightStreaming": return HDInsightStreamingActivity.DeserializeHDInsightStreamingActivity(e |
| 0 | 92 | | case "Lookup": return LookupActivity.DeserializeLookupActivity(element); |
| 0 | 93 | | case "SqlServerStoredProcedure": return SqlServerStoredProcedureActivity.DeserializeSqlServerStoredP |
| 0 | 94 | | case "WebActivity": return WebActivity.DeserializeWebActivity(element); |
| | 95 | | } |
| | 96 | | } |
| 0 | 97 | | Optional<LinkedServiceReference> linkedServiceName = default; |
| 0 | 98 | | Optional<ActivityPolicy> policy = default; |
| 0 | 99 | | string name = default; |
| 0 | 100 | | string type = default; |
| 0 | 101 | | Optional<string> description = default; |
| 0 | 102 | | Optional<IList<ActivityDependency>> dependsOn = default; |
| 0 | 103 | | Optional<IList<UserProperty>> userProperties = default; |
| 0 | 104 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 105 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 106 | | foreach (var property in element.EnumerateObject()) |
| | 107 | | { |
| 0 | 108 | | if (property.NameEquals("linkedServiceName")) |
| | 109 | | { |
| 0 | 110 | | linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value); |
| 0 | 111 | | continue; |
| | 112 | | } |
| 0 | 113 | | if (property.NameEquals("policy")) |
| | 114 | | { |
| 0 | 115 | | policy = ActivityPolicy.DeserializeActivityPolicy(property.Value); |
| 0 | 116 | | continue; |
| | 117 | | } |
| 0 | 118 | | if (property.NameEquals("name")) |
| | 119 | | { |
| 0 | 120 | | name = property.Value.GetString(); |
| 0 | 121 | | continue; |
| | 122 | | } |
| 0 | 123 | | if (property.NameEquals("type")) |
| | 124 | | { |
| 0 | 125 | | type = property.Value.GetString(); |
| 0 | 126 | | continue; |
| | 127 | | } |
| 0 | 128 | | if (property.NameEquals("description")) |
| | 129 | | { |
| 0 | 130 | | description = property.Value.GetString(); |
| 0 | 131 | | continue; |
| | 132 | | } |
| 0 | 133 | | if (property.NameEquals("dependsOn")) |
| | 134 | | { |
| 0 | 135 | | List<ActivityDependency> array = new List<ActivityDependency>(); |
| 0 | 136 | | foreach (var item in property.Value.EnumerateArray()) |
| | 137 | | { |
| 0 | 138 | | array.Add(ActivityDependency.DeserializeActivityDependency(item)); |
| | 139 | | } |
| 0 | 140 | | dependsOn = array; |
| 0 | 141 | | continue; |
| | 142 | | } |
| 0 | 143 | | if (property.NameEquals("userProperties")) |
| | 144 | | { |
| 0 | 145 | | List<UserProperty> array = new List<UserProperty>(); |
| 0 | 146 | | foreach (var item in property.Value.EnumerateArray()) |
| | 147 | | { |
| 0 | 148 | | array.Add(UserProperty.DeserializeUserProperty(item)); |
| | 149 | | } |
| 0 | 150 | | userProperties = array; |
| 0 | 151 | | continue; |
| | 152 | | } |
| 0 | 153 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 154 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 155 | | } |
| 0 | 156 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 157 | | return new ExecutionActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(user |
| | 158 | | } |
| | 159 | | } |
| | 160 | | } |