< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.Activity
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\Activity.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\Activity.Serialization.cs
Covered lines:37
Uncovered lines:99
Coverable lines:136
Total lines:251
Line coverage:27.2% (37 of 136)
Covered branches:75
Total branches:210
Branch coverage:35.7% (75 of 210)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-100%50%
get_Name()-0%100%
get_Type()-0%100%
get_Description()-0%100%
get_DependsOn()-0%100%
get_UserProperties()-0%100%
get_AdditionalProperties()-0%100%
GetEnumerator()-0%100%
System.Collections.IEnumerable.GetEnumerator()-0%100%
TryGetValue(...)-0%100%
ContainsKey(...)-0%100%
get_Keys()-0%100%
get_Values()-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.get_Count()-0%100%
Add(...)-0%100%
Remove(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.get_IsReadOnly()-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Add(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Remove(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Contains(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.CopyTo(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Clear()-0%100%
get_Item(...)-0%100%
set_Item(...)-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeActivity(...)-40.85%38.14%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\Activity.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;
 10using System.Collections.Generic;
 11using Azure.Core;
 12
 13namespace Azure.Analytics.Synapse.Artifacts.Models
 14{
 15    /// <summary> A pipeline activity. </summary>
 16    public partial class Activity : IDictionary<string, object>
 17    {
 18        /// <summary> Initializes a new instance of Activity. </summary>
 19        /// <param name="name"> Activity name. </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 021        public Activity(string name)
 22        {
 023            if (name == null)
 24            {
 025                throw new ArgumentNullException(nameof(name));
 26            }
 27
 028            Name = name;
 029            DependsOn = new ChangeTrackingList<ActivityDependency>();
 030            UserProperties = new ChangeTrackingList<UserProperty>();
 031            AdditionalProperties = new ChangeTrackingDictionary<string, object>();
 032            Type = "Activity";
 033        }
 34
 35        /// <summary> Initializes a new instance of Activity. </summary>
 36        /// <param name="name"> Activity name. </param>
 37        /// <param name="type"> Type of activity. </param>
 38        /// <param name="description"> Activity description. </param>
 39        /// <param name="dependsOn"> Activity depends on condition. </param>
 40        /// <param name="userProperties"> Activity user properties. </param>
 41        /// <param name="additionalProperties"> . </param>
 842        internal Activity(string name, string type, string description, IList<ActivityDependency> dependsOn, IList<UserP
 43        {
 844            Name = name;
 845            Type = type ?? "Activity";
 846            Description = description;
 847            DependsOn = dependsOn;
 848            UserProperties = userProperties;
 849            AdditionalProperties = additionalProperties;
 850        }
 51
 52        /// <summary> Activity name. </summary>
 053        public string Name { get; set; }
 54        /// <summary> Type of activity. </summary>
 055        internal string Type { get; set; }
 56        /// <summary> Activity description. </summary>
 057        public string Description { get; set; }
 58        /// <summary> Activity depends on condition. </summary>
 059        public IList<ActivityDependency> DependsOn { get; }
 60        /// <summary> Activity user properties. </summary>
 061        public IList<UserProperty> UserProperties { get; }
 062        internal IDictionary<string, object> AdditionalProperties { get; }
 63        /// <inheritdoc />
 064        public IEnumerator<KeyValuePair<string, object>> GetEnumerator() => AdditionalProperties.GetEnumerator();
 65        /// <inheritdoc />
 066        IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator();
 67        /// <inheritdoc />
 068        public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value);
 69        /// <inheritdoc />
 070        public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key);
 71        /// <inheritdoc />
 072        public ICollection<string> Keys => AdditionalProperties.Keys;
 73        /// <inheritdoc />
 074        public ICollection<object> Values => AdditionalProperties.Values;
 75        /// <inheritdoc />
 076        int ICollection<KeyValuePair<string, object>>.Count => AdditionalProperties.Count;
 77        /// <inheritdoc />
 078        public void Add(string key, object value) => AdditionalProperties.Add(key, value);
 79        /// <inheritdoc />
 080        public bool Remove(string key) => AdditionalProperties.Remove(key);
 81        /// <inheritdoc />
 082        bool ICollection<KeyValuePair<string, object>>.IsReadOnly => AdditionalProperties.IsReadOnly;
 83        /// <inheritdoc />
 084        void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> value) => AdditionalProperties.A
 85        /// <inheritdoc />
 086        bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> value) => AdditionalPropertie
 87        /// <inheritdoc />
 088        bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> value) => AdditionalPropert
 89        /// <inheritdoc />
 090        void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] destination, int offset) =>
 91        /// <inheritdoc />
 092        void ICollection<KeyValuePair<string, object>>.Clear() => AdditionalProperties.Clear();
 93        /// <inheritdoc />
 94        public object this[string key]
 95        {
 096            get => AdditionalProperties[key];
 097            set => AdditionalProperties[key] = value;
 98        }
 99    }
 100}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\Activity.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 Activity : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("name");
 020            writer.WriteStringValue(Name);
 021            writer.WritePropertyName("type");
 022            writer.WriteStringValue(Type);
 023            if (Optional.IsDefined(Description))
 24            {
 025                writer.WritePropertyName("description");
 026                writer.WriteStringValue(Description);
 27            }
 028            if (Optional.IsCollectionDefined(DependsOn))
 29            {
 030                writer.WritePropertyName("dependsOn");
 031                writer.WriteStartArray();
 032                foreach (var item in DependsOn)
 33                {
 034                    writer.WriteObjectValue(item);
 35                }
 036                writer.WriteEndArray();
 37            }
 038            if (Optional.IsCollectionDefined(UserProperties))
 39            {
 040                writer.WritePropertyName("userProperties");
 041                writer.WriteStartArray();
 042                foreach (var item in UserProperties)
 43                {
 044                    writer.WriteObjectValue(item);
 45                }
 046                writer.WriteEndArray();
 47            }
 048            foreach (var item in AdditionalProperties)
 49            {
 050                writer.WritePropertyName(item.Key);
 051                writer.WriteObjectValue(item.Value);
 52            }
 053            writer.WriteEndObject();
 054        }
 55
 56        internal static Activity DeserializeActivity(JsonElement element)
 57        {
 858            if (element.TryGetProperty("type", out JsonElement discriminator))
 59            {
 860                switch (discriminator.GetString())
 61                {
 062                    case "AppendVariable": return AppendVariableActivity.DeserializeAppendVariableActivity(element);
 063                    case "AzureDataExplorerCommand": return AzureDataExplorerCommandActivity.DeserializeAzureDataExplore
 064                    case "AzureFunctionActivity": return AzureFunctionActivity.DeserializeAzureFunctionActivity(element)
 065                    case "AzureMLBatchExecution": return AzureMLBatchExecutionActivity.DeserializeAzureMLBatchExecutionA
 066                    case "AzureMLExecutePipeline": return AzureMLExecutePipelineActivity.DeserializeAzureMLExecutePipeli
 067                    case "AzureMLUpdateResource": return AzureMLUpdateResourceActivity.DeserializeAzureMLUpdateResourceA
 068                    case "Container": return ControlActivity.DeserializeControlActivity(element);
 069                    case "Copy": return CopyActivity.DeserializeCopyActivity(element);
 070                    case "Custom": return CustomActivity.DeserializeCustomActivity(element);
 071                    case "DataLakeAnalyticsU-SQL": return DataLakeAnalyticsUsqlActivity.DeserializeDataLakeAnalyticsUsql
 072                    case "DatabricksNotebook": return DatabricksNotebookActivity.DeserializeDatabricksNotebookActivity(e
 073                    case "DatabricksSparkJar": return DatabricksSparkJarActivity.DeserializeDatabricksSparkJarActivity(e
 074                    case "DatabricksSparkPython": return DatabricksSparkPythonActivity.DeserializeDatabricksSparkPythonA
 075                    case "Delete": return DeleteActivity.DeserializeDeleteActivity(element);
 076                    case "ExecuteDataFlow": return ExecuteDataFlowActivity.DeserializeExecuteDataFlowActivity(element);
 077                    case "ExecutePipeline": return ExecutePipelineActivity.DeserializeExecutePipelineActivity(element);
 078                    case "ExecuteSSISPackage": return ExecuteSsisPackageActivity.DeserializeExecuteSsisPackageActivity(e
 079                    case "Execution": return ExecutionActivity.DeserializeExecutionActivity(element);
 080                    case "Filter": return FilterActivity.DeserializeFilterActivity(element);
 081                    case "ForEach": return ForEachActivity.DeserializeForEachActivity(element);
 082                    case "GetMetadata": return GetMetadataActivity.DeserializeGetMetadataActivity(element);
 083                    case "HDInsightHive": return HDInsightHiveActivity.DeserializeHDInsightHiveActivity(element);
 084                    case "HDInsightMapReduce": return HDInsightMapReduceActivity.DeserializeHDInsightMapReduceActivity(e
 085                    case "HDInsightPig": return HDInsightPigActivity.DeserializeHDInsightPigActivity(element);
 086                    case "HDInsightSpark": return HDInsightSparkActivity.DeserializeHDInsightSparkActivity(element);
 087                    case "HDInsightStreaming": return HDInsightStreamingActivity.DeserializeHDInsightStreamingActivity(e
 088                    case "IfCondition": return IfConditionActivity.DeserializeIfConditionActivity(element);
 089                    case "Lookup": return LookupActivity.DeserializeLookupActivity(element);
 090                    case "SetVariable": return SetVariableActivity.DeserializeSetVariableActivity(element);
 091                    case "SqlServerStoredProcedure": return SqlServerStoredProcedureActivity.DeserializeSqlServerStoredP
 092                    case "Switch": return SwitchActivity.DeserializeSwitchActivity(element);
 093                    case "Until": return UntilActivity.DeserializeUntilActivity(element);
 094                    case "Validation": return ValidationActivity.DeserializeValidationActivity(element);
 095                    case "Wait": return WaitActivity.DeserializeWaitActivity(element);
 096                    case "WebActivity": return WebActivity.DeserializeWebActivity(element);
 097                    case "WebHook": return WebHookActivity.DeserializeWebHookActivity(element);
 98                }
 99            }
 8100            string name = default;
 8101            string type = default;
 8102            Optional<string> description = default;
 8103            Optional<IList<ActivityDependency>> dependsOn = default;
 8104            Optional<IList<UserProperty>> userProperties = default;
 8105            IDictionary<string, object> additionalProperties = default;
 8106            Dictionary<string, object> additionalPropertiesDictionary = default;
 112107            foreach (var property in element.EnumerateObject())
 108            {
 48109                if (property.NameEquals("name"))
 110                {
 8111                    name = property.Value.GetString();
 8112                    continue;
 113                }
 40114                if (property.NameEquals("type"))
 115                {
 8116                    type = property.Value.GetString();
 8117                    continue;
 118                }
 32119                if (property.NameEquals("description"))
 120                {
 0121                    description = property.Value.GetString();
 0122                    continue;
 123                }
 32124                if (property.NameEquals("dependsOn"))
 125                {
 8126                    List<ActivityDependency> array = new List<ActivityDependency>();
 0127                    foreach (var item in property.Value.EnumerateArray())
 128                    {
 0129                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 130                    }
 8131                    dependsOn = array;
 8132                    continue;
 133                }
 24134                if (property.NameEquals("userProperties"))
 135                {
 8136                    List<UserProperty> array = new List<UserProperty>();
 0137                    foreach (var item in property.Value.EnumerateArray())
 138                    {
 0139                        array.Add(UserProperty.DeserializeUserProperty(item));
 140                    }
 8141                    userProperties = array;
 8142                    continue;
 143                }
 16144                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 16145                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 146            }
 8147            additionalProperties = additionalPropertiesDictionary;
 8148            return new Activity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userPropertie
 149        }
 150    }
 151}