< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.ExecutionActivity
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ExecutionActivity.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ExecutionActivity.Serialization.cs
Covered lines:0
Uncovered lines:109
Coverable lines:109
Total lines:210
Line coverage:0% (0 of 109)
Covered branches:0
Total branches:150
Branch coverage:0% (0 of 150)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_LinkedServiceName()-0%100%
get_Policy()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeExecutionActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ExecutionActivity.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Collections.Generic;
 10
 11namespace Azure.Analytics.Synapse.Artifacts.Models
 12{
 13    /// <summary> Base class for all execution activities. </summary>
 14    public partial class ExecutionActivity : Activity
 15    {
 16        /// <summary> Initializes a new instance of ExecutionActivity. </summary>
 17        /// <param name="name"> Activity name. </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 019        public ExecutionActivity(string name) : base(name)
 20        {
 021            if (name == null)
 22            {
 023                throw new ArgumentNullException(nameof(name));
 24            }
 25
 026            Type = "Execution";
 027        }
 28
 29        /// <summary> Initializes a new instance of ExecutionActivity. </summary>
 30        /// <param name="name"> Activity name. </param>
 31        /// <param name="type"> Type of activity. </param>
 32        /// <param name="description"> Activity description. </param>
 33        /// <param name="dependsOn"> Activity depends on condition. </param>
 34        /// <param name="userProperties"> Activity user properties. </param>
 35        /// <param name="additionalProperties"> . </param>
 36        /// <param name="linkedServiceName"> Linked service reference. </param>
 37        /// <param name="policy"> Activity policy. </param>
 038        internal ExecutionActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, IL
 39        {
 040            LinkedServiceName = linkedServiceName;
 041            Policy = policy;
 042            Type = type ?? "Execution";
 043        }
 44
 45        /// <summary> Linked service reference. </summary>
 046        public LinkedServiceReference LinkedServiceName { get; set; }
 47        /// <summary> Activity policy. </summary>
 048        public ActivityPolicy Policy { get; set; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ExecutionActivity.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Analytics.Synapse.Artifacts.Models
 13{
 14    public partial class ExecutionActivity : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsDefined(LinkedServiceName))
 20            {
 021                writer.WritePropertyName("linkedServiceName");
 022                writer.WriteObjectValue(LinkedServiceName);
 23            }
 024            if (Optional.IsDefined(Policy))
 25            {
 026                writer.WritePropertyName("policy");
 027                writer.WriteObjectValue(Policy);
 28            }
 029            writer.WritePropertyName("name");
 030            writer.WriteStringValue(Name);
 031            writer.WritePropertyName("type");
 032            writer.WriteStringValue(Type);
 033            if (Optional.IsDefined(Description))
 34            {
 035                writer.WritePropertyName("description");
 036                writer.WriteStringValue(Description);
 37            }
 038            if (Optional.IsCollectionDefined(DependsOn))
 39            {
 040                writer.WritePropertyName("dependsOn");
 041                writer.WriteStartArray();
 042                foreach (var item in DependsOn)
 43                {
 044                    writer.WriteObjectValue(item);
 45                }
 046                writer.WriteEndArray();
 47            }
 048            if (Optional.IsCollectionDefined(UserProperties))
 49            {
 050                writer.WritePropertyName("userProperties");
 051                writer.WriteStartArray();
 052                foreach (var item in UserProperties)
 53                {
 054                    writer.WriteObjectValue(item);
 55                }
 056                writer.WriteEndArray();
 57            }
 058            foreach (var item in AdditionalProperties)
 59            {
 060                writer.WritePropertyName(item.Key);
 061                writer.WriteObjectValue(item.Value);
 62            }
 063            writer.WriteEndObject();
 064        }
 65
 66        internal static ExecutionActivity DeserializeExecutionActivity(JsonElement element)
 67        {
 068            if (element.TryGetProperty("type", out JsonElement discriminator))
 69            {
 070                switch (discriminator.GetString())
 71                {
 072                    case "AzureDataExplorerCommand": return AzureDataExplorerCommandActivity.DeserializeAzureDataExplore
 073                    case "AzureFunctionActivity": return AzureFunctionActivity.DeserializeAzureFunctionActivity(element)
 074                    case "AzureMLBatchExecution": return AzureMLBatchExecutionActivity.DeserializeAzureMLBatchExecutionA
 075                    case "AzureMLExecutePipeline": return AzureMLExecutePipelineActivity.DeserializeAzureMLExecutePipeli
 076                    case "AzureMLUpdateResource": return AzureMLUpdateResourceActivity.DeserializeAzureMLUpdateResourceA
 077                    case "Copy": return CopyActivity.DeserializeCopyActivity(element);
 078                    case "Custom": return CustomActivity.DeserializeCustomActivity(element);
 079                    case "DataLakeAnalyticsU-SQL": return DataLakeAnalyticsUsqlActivity.DeserializeDataLakeAnalyticsUsql
 080                    case "DatabricksNotebook": return DatabricksNotebookActivity.DeserializeDatabricksNotebookActivity(e
 081                    case "DatabricksSparkJar": return DatabricksSparkJarActivity.DeserializeDatabricksSparkJarActivity(e
 082                    case "DatabricksSparkPython": return DatabricksSparkPythonActivity.DeserializeDatabricksSparkPythonA
 083                    case "Delete": return DeleteActivity.DeserializeDeleteActivity(element);
 084                    case "ExecuteDataFlow": return ExecuteDataFlowActivity.DeserializeExecuteDataFlowActivity(element);
 085                    case "ExecuteSSISPackage": return ExecuteSsisPackageActivity.DeserializeExecuteSsisPackageActivity(e
 086                    case "GetMetadata": return GetMetadataActivity.DeserializeGetMetadataActivity(element);
 087                    case "HDInsightHive": return HDInsightHiveActivity.DeserializeHDInsightHiveActivity(element);
 088                    case "HDInsightMapReduce": return HDInsightMapReduceActivity.DeserializeHDInsightMapReduceActivity(e
 089                    case "HDInsightPig": return HDInsightPigActivity.DeserializeHDInsightPigActivity(element);
 090                    case "HDInsightSpark": return HDInsightSparkActivity.DeserializeHDInsightSparkActivity(element);
 091                    case "HDInsightStreaming": return HDInsightStreamingActivity.DeserializeHDInsightStreamingActivity(e
 092                    case "Lookup": return LookupActivity.DeserializeLookupActivity(element);
 093                    case "SqlServerStoredProcedure": return SqlServerStoredProcedureActivity.DeserializeSqlServerStoredP
 094                    case "WebActivity": return WebActivity.DeserializeWebActivity(element);
 95                }
 96            }
 097            Optional<LinkedServiceReference> linkedServiceName = default;
 098            Optional<ActivityPolicy> policy = default;
 099            string name = default;
 0100            string type = default;
 0101            Optional<string> description = default;
 0102            Optional<IList<ActivityDependency>> dependsOn = default;
 0103            Optional<IList<UserProperty>> userProperties = default;
 0104            IDictionary<string, object> additionalProperties = default;
 0105            Dictionary<string, object> additionalPropertiesDictionary = default;
 0106            foreach (var property in element.EnumerateObject())
 107            {
 0108                if (property.NameEquals("linkedServiceName"))
 109                {
 0110                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 0111                    continue;
 112                }
 0113                if (property.NameEquals("policy"))
 114                {
 0115                    policy = ActivityPolicy.DeserializeActivityPolicy(property.Value);
 0116                    continue;
 117                }
 0118                if (property.NameEquals("name"))
 119                {
 0120                    name = property.Value.GetString();
 0121                    continue;
 122                }
 0123                if (property.NameEquals("type"))
 124                {
 0125                    type = property.Value.GetString();
 0126                    continue;
 127                }
 0128                if (property.NameEquals("description"))
 129                {
 0130                    description = property.Value.GetString();
 0131                    continue;
 132                }
 0133                if (property.NameEquals("dependsOn"))
 134                {
 0135                    List<ActivityDependency> array = new List<ActivityDependency>();
 0136                    foreach (var item in property.Value.EnumerateArray())
 137                    {
 0138                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 139                    }
 0140                    dependsOn = array;
 0141                    continue;
 142                }
 0143                if (property.NameEquals("userProperties"))
 144                {
 0145                    List<UserProperty> array = new List<UserProperty>();
 0146                    foreach (var item in property.Value.EnumerateArray())
 147                    {
 0148                        array.Add(UserProperty.DeserializeUserProperty(item));
 149                    }
 0150                    userProperties = array;
 0151                    continue;
 152                }
 0153                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0154                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 155            }
 0156            additionalProperties = additionalPropertiesDictionary;
 0157            return new ExecutionActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(user
 158        }
 159    }
 160}