< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Expression()-0%100%
get_Timeout()-0%100%
get_Activities()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeUntilActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\UntilActivity.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 executes inner activities until the specified boolean expression results to true or time
 15    public partial class UntilActivity : Activity
 16    {
 17        /// <summary> Initializes a new instance of UntilActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <param name="expression"> An expression that would evaluate to Boolean. The loop will continue until this ex
 20        /// <param name="activities"> List of activities to execute. </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="name"/>, <paramref name="expression"/>, or <paramre
 022        public UntilActivity(string name, Expression expression, IEnumerable<Activity> activities) : base(name)
 23        {
 024            if (name == null)
 25            {
 026                throw new ArgumentNullException(nameof(name));
 27            }
 028            if (expression == null)
 29            {
 030                throw new ArgumentNullException(nameof(expression));
 31            }
 032            if (activities == null)
 33            {
 034                throw new ArgumentNullException(nameof(activities));
 35            }
 36
 037            Expression = expression;
 038            Activities = activities.ToList();
 039            Type = "Until";
 040        }
 41
 42        /// <summary> Initializes a new instance of UntilActivity. </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="expression"> An expression that would evaluate to Boolean. The loop will continue until this ex
 50        /// <param name="timeout"> Specifies the timeout for the activity to run. If there is no value specified, it tak
 51        /// <param name="activities"> List of activities to execute. </param>
 052        internal UntilActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, IList<
 53        {
 054            Expression = expression;
 055            Timeout = timeout;
 056            Activities = activities;
 057            Type = type ?? "Until";
 058        }
 59
 60        /// <summary> An expression that would evaluate to Boolean. The loop will continue until this expression evaluat
 061        public Expression Expression { get; set; }
 62        /// <summary> Specifies the timeout for the activity to run. If there is no value specified, it takes the value 
 063        public object Timeout { get; set; }
 64        /// <summary> List of activities to execute. </summary>
 065        public IList<Activity> Activities { get; }
 66    }
 67}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\UntilActivity.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 UntilActivity : 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            writer.WritePropertyName("expression");
 051            writer.WriteObjectValue(Expression);
 052            if (Optional.IsDefined(Timeout))
 53            {
 054                writer.WritePropertyName("timeout");
 055                writer.WriteObjectValue(Timeout);
 56            }
 057            writer.WritePropertyName("activities");
 058            writer.WriteStartArray();
 059            foreach (var item in Activities)
 60            {
 061                writer.WriteObjectValue(item);
 62            }
 063            writer.WriteEndArray();
 064            writer.WriteEndObject();
 065            foreach (var item in AdditionalProperties)
 66            {
 067                writer.WritePropertyName(item.Key);
 068                writer.WriteObjectValue(item.Value);
 69            }
 070            writer.WriteEndObject();
 071        }
 72
 73        internal static UntilActivity DeserializeUntilActivity(JsonElement element)
 74        {
 075            string name = default;
 076            string type = default;
 077            Optional<string> description = default;
 078            Optional<IList<ActivityDependency>> dependsOn = default;
 079            Optional<IList<UserProperty>> userProperties = default;
 080            Expression expression = default;
 081            Optional<object> timeout = default;
 082            IList<Activity> activities = default;
 083            IDictionary<string, object> additionalProperties = default;
 084            Dictionary<string, object> additionalPropertiesDictionary = default;
 085            foreach (var property in element.EnumerateObject())
 86            {
 087                if (property.NameEquals("name"))
 88                {
 089                    name = property.Value.GetString();
 090                    continue;
 91                }
 092                if (property.NameEquals("type"))
 93                {
 094                    type = property.Value.GetString();
 095                    continue;
 96                }
 097                if (property.NameEquals("description"))
 98                {
 099                    description = property.Value.GetString();
 0100                    continue;
 101                }
 0102                if (property.NameEquals("dependsOn"))
 103                {
 0104                    List<ActivityDependency> array = new List<ActivityDependency>();
 0105                    foreach (var item in property.Value.EnumerateArray())
 106                    {
 0107                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 108                    }
 0109                    dependsOn = array;
 0110                    continue;
 111                }
 0112                if (property.NameEquals("userProperties"))
 113                {
 0114                    List<UserProperty> array = new List<UserProperty>();
 0115                    foreach (var item in property.Value.EnumerateArray())
 116                    {
 0117                        array.Add(UserProperty.DeserializeUserProperty(item));
 118                    }
 0119                    userProperties = array;
 0120                    continue;
 121                }
 0122                if (property.NameEquals("typeProperties"))
 123                {
 0124                    foreach (var property0 in property.Value.EnumerateObject())
 125                    {
 0126                        if (property0.NameEquals("expression"))
 127                        {
 0128                            expression = Expression.DeserializeExpression(property0.Value);
 0129                            continue;
 130                        }
 0131                        if (property0.NameEquals("timeout"))
 132                        {
 0133                            timeout = property0.Value.GetObject();
 0134                            continue;
 135                        }
 0136                        if (property0.NameEquals("activities"))
 137                        {
 0138                            List<Activity> array = new List<Activity>();
 0139                            foreach (var item in property0.Value.EnumerateArray())
 140                            {
 0141                                array.Add(DeserializeActivity(item));
 142                            }
 0143                            activities = array;
 144                            continue;
 145                        }
 146                    }
 147                    continue;
 148                }
 0149                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0150                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 151            }
 0152            additionalProperties = additionalPropertiesDictionary;
 0153            return new UntilActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userProp
 154        }
 155    }
 156}