< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_IsSequential()-0%100%
get_BatchCount()-0%100%
get_Items()-0%100%
get_Activities()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeForEachActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ForEachActivity.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;
 10using System.Linq;
 11
 12namespace Azure.Analytics.Synapse.Artifacts.Models
 13{
 14    /// <summary> This activity is used for iterating over a collection and execute given activities. </summary>
 15    public partial class ForEachActivity : Activity
 16    {
 17        /// <summary> Initializes a new instance of ForEachActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <param name="items"> Collection to iterate. </param>
 20        /// <param name="activities"> List of activities to execute . </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="name"/>, <paramref name="items"/>, or <paramref nam
 022        public ForEachActivity(string name, Expression items, IEnumerable<Activity> activities) : base(name)
 23        {
 024            if (name == null)
 25            {
 026                throw new ArgumentNullException(nameof(name));
 27            }
 028            if (items == null)
 29            {
 030                throw new ArgumentNullException(nameof(items));
 31            }
 032            if (activities == null)
 33            {
 034                throw new ArgumentNullException(nameof(activities));
 35            }
 36
 037            Items = items;
 038            Activities = activities.ToList();
 039            Type = "ForEach";
 040        }
 41
 42        /// <summary> Initializes a new instance of ForEachActivity. </summary>
 43        /// <param name="name"> Activity name. </param>
 44        /// <param name="type"> Type of activity. </param>
 45        /// <param name="description"> Activity description. </param>
 46        /// <param name="dependsOn"> Activity depends on condition. </param>
 47        /// <param name="userProperties"> Activity user properties. </param>
 48        /// <param name="additionalProperties"> . </param>
 49        /// <param name="isSequential"> Should the loop be executed in sequence or in parallel (max 50). </param>
 50        /// <param name="batchCount"> Batch count to be used for controlling the number of parallel execution (when isSe
 51        /// <param name="items"> Collection to iterate. </param>
 52        /// <param name="activities"> List of activities to execute . </param>
 053        internal ForEachActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, ILis
 54        {
 055            IsSequential = isSequential;
 056            BatchCount = batchCount;
 057            Items = items;
 058            Activities = activities;
 059            Type = type ?? "ForEach";
 060        }
 61
 62        /// <summary> Should the loop be executed in sequence or in parallel (max 50). </summary>
 063        public bool? IsSequential { get; set; }
 64        /// <summary> Batch count to be used for controlling the number of parallel execution (when isSequential is set 
 065        public int? BatchCount { get; set; }
 66        /// <summary> Collection to iterate. </summary>
 067        public Expression Items { get; set; }
 68        /// <summary> List of activities to execute . </summary>
 069        public IList<Activity> Activities { get; }
 70    }
 71}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ForEachActivity.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 ForEachActivity : 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            writer.WritePropertyName("typeProperties");
 049            writer.WriteStartObject();
 050            if (Optional.IsDefined(IsSequential))
 51            {
 052                writer.WritePropertyName("isSequential");
 053                writer.WriteBooleanValue(IsSequential.Value);
 54            }
 055            if (Optional.IsDefined(BatchCount))
 56            {
 057                writer.WritePropertyName("batchCount");
 058                writer.WriteNumberValue(BatchCount.Value);
 59            }
 060            writer.WritePropertyName("items");
 061            writer.WriteObjectValue(Items);
 062            writer.WritePropertyName("activities");
 063            writer.WriteStartArray();
 064            foreach (var item in Activities)
 65            {
 066                writer.WriteObjectValue(item);
 67            }
 068            writer.WriteEndArray();
 069            writer.WriteEndObject();
 070            foreach (var item in AdditionalProperties)
 71            {
 072                writer.WritePropertyName(item.Key);
 073                writer.WriteObjectValue(item.Value);
 74            }
 075            writer.WriteEndObject();
 076        }
 77
 78        internal static ForEachActivity DeserializeForEachActivity(JsonElement element)
 79        {
 080            string name = default;
 081            string type = default;
 082            Optional<string> description = default;
 083            Optional<IList<ActivityDependency>> dependsOn = default;
 084            Optional<IList<UserProperty>> userProperties = default;
 085            Optional<bool> isSequential = default;
 086            Optional<int> batchCount = default;
 087            Expression items = default;
 088            IList<Activity> activities = default;
 089            IDictionary<string, object> additionalProperties = default;
 090            Dictionary<string, object> additionalPropertiesDictionary = default;
 091            foreach (var property in element.EnumerateObject())
 92            {
 093                if (property.NameEquals("name"))
 94                {
 095                    name = property.Value.GetString();
 096                    continue;
 97                }
 098                if (property.NameEquals("type"))
 99                {
 0100                    type = property.Value.GetString();
 0101                    continue;
 102                }
 0103                if (property.NameEquals("description"))
 104                {
 0105                    description = property.Value.GetString();
 0106                    continue;
 107                }
 0108                if (property.NameEquals("dependsOn"))
 109                {
 0110                    List<ActivityDependency> array = new List<ActivityDependency>();
 0111                    foreach (var item in property.Value.EnumerateArray())
 112                    {
 0113                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 114                    }
 0115                    dependsOn = array;
 0116                    continue;
 117                }
 0118                if (property.NameEquals("userProperties"))
 119                {
 0120                    List<UserProperty> array = new List<UserProperty>();
 0121                    foreach (var item in property.Value.EnumerateArray())
 122                    {
 0123                        array.Add(UserProperty.DeserializeUserProperty(item));
 124                    }
 0125                    userProperties = array;
 0126                    continue;
 127                }
 0128                if (property.NameEquals("typeProperties"))
 129                {
 0130                    foreach (var property0 in property.Value.EnumerateObject())
 131                    {
 0132                        if (property0.NameEquals("isSequential"))
 133                        {
 0134                            isSequential = property0.Value.GetBoolean();
 0135                            continue;
 136                        }
 0137                        if (property0.NameEquals("batchCount"))
 138                        {
 0139                            batchCount = property0.Value.GetInt32();
 0140                            continue;
 141                        }
 0142                        if (property0.NameEquals("items"))
 143                        {
 0144                            items = Expression.DeserializeExpression(property0.Value);
 0145                            continue;
 146                        }
 0147                        if (property0.NameEquals("activities"))
 148                        {
 0149                            List<Activity> array = new List<Activity>();
 0150                            foreach (var item in property0.Value.EnumerateArray())
 151                            {
 0152                                array.Add(DeserializeActivity(item));
 153                            }
 0154                            activities = array;
 155                            continue;
 156                        }
 157                    }
 158                    continue;
 159                }
 0160                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0161                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 162            }
 0163            additionalProperties = additionalPropertiesDictionary;
 0164            return new ForEachActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userPr
 165        }
 166    }
 167}