< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.IfConditionActivity
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\IfConditionActivity.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\IfConditionActivity.Serialization.cs
Covered lines:0
Uncovered lines:113
Coverable lines:113
Total lines:232
Line coverage:0% (0 of 113)
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_Expression()-0%100%
get_IfTrueActivities()-0%100%
get_IfFalseActivities()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeIfConditionActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\IfConditionActivity.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 Azure.Core;
 11
 12namespace Azure.Analytics.Synapse.Artifacts.Models
 13{
 14    /// <summary> This activity evaluates a boolean expression and executes either the activities under the ifTrueActivi
 15    public partial class IfConditionActivity : Activity
 16    {
 17        /// <summary> Initializes a new instance of IfConditionActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <param name="expression"> An expression that would evaluate to Boolean. This is used to determine the block 
 20        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="expression"/> is null. <
 021        public IfConditionActivity(string name, Expression expression) : base(name)
 22        {
 023            if (name == null)
 24            {
 025                throw new ArgumentNullException(nameof(name));
 26            }
 027            if (expression == null)
 28            {
 029                throw new ArgumentNullException(nameof(expression));
 30            }
 31
 032            Expression = expression;
 033            IfTrueActivities = new ChangeTrackingList<Activity>();
 034            IfFalseActivities = new ChangeTrackingList<Activity>();
 035            Type = "IfCondition";
 036        }
 37
 38        /// <summary> Initializes a new instance of IfConditionActivity. </summary>
 39        /// <param name="name"> Activity name. </param>
 40        /// <param name="type"> Type of activity. </param>
 41        /// <param name="description"> Activity description. </param>
 42        /// <param name="dependsOn"> Activity depends on condition. </param>
 43        /// <param name="userProperties"> Activity user properties. </param>
 44        /// <param name="additionalProperties"> . </param>
 45        /// <param name="expression"> An expression that would evaluate to Boolean. This is used to determine the block 
 46        /// <param name="ifTrueActivities"> List of activities to execute if expression is evaluated to true. This is an
 47        /// <param name="ifFalseActivities"> List of activities to execute if expression is evaluated to false. This is 
 048        internal IfConditionActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, 
 49        {
 050            Expression = expression;
 051            IfTrueActivities = ifTrueActivities;
 052            IfFalseActivities = ifFalseActivities;
 053            Type = type ?? "IfCondition";
 054        }
 55
 56        /// <summary> An expression that would evaluate to Boolean. This is used to determine the block of activities (i
 057        public Expression Expression { get; set; }
 58        /// <summary> List of activities to execute if expression is evaluated to true. This is an optional property and
 059        public IList<Activity> IfTrueActivities { get; }
 60        /// <summary> List of activities to execute if expression is evaluated to false. This is an optional property an
 061        public IList<Activity> IfFalseActivities { get; }
 62    }
 63}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\IfConditionActivity.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 IfConditionActivity : 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.IsCollectionDefined(IfTrueActivities))
 53            {
 054                writer.WritePropertyName("ifTrueActivities");
 055                writer.WriteStartArray();
 056                foreach (var item in IfTrueActivities)
 57                {
 058                    writer.WriteObjectValue(item);
 59                }
 060                writer.WriteEndArray();
 61            }
 062            if (Optional.IsCollectionDefined(IfFalseActivities))
 63            {
 064                writer.WritePropertyName("ifFalseActivities");
 065                writer.WriteStartArray();
 066                foreach (var item in IfFalseActivities)
 67                {
 068                    writer.WriteObjectValue(item);
 69                }
 070                writer.WriteEndArray();
 71            }
 072            writer.WriteEndObject();
 073            foreach (var item in AdditionalProperties)
 74            {
 075                writer.WritePropertyName(item.Key);
 076                writer.WriteObjectValue(item.Value);
 77            }
 078            writer.WriteEndObject();
 079        }
 80
 81        internal static IfConditionActivity DeserializeIfConditionActivity(JsonElement element)
 82        {
 083            string name = default;
 084            string type = default;
 085            Optional<string> description = default;
 086            Optional<IList<ActivityDependency>> dependsOn = default;
 087            Optional<IList<UserProperty>> userProperties = default;
 088            Expression expression = default;
 089            Optional<IList<Activity>> ifTrueActivities = default;
 090            Optional<IList<Activity>> ifFalseActivities = default;
 091            IDictionary<string, object> additionalProperties = default;
 092            Dictionary<string, object> additionalPropertiesDictionary = default;
 093            foreach (var property in element.EnumerateObject())
 94            {
 095                if (property.NameEquals("name"))
 96                {
 097                    name = property.Value.GetString();
 098                    continue;
 99                }
 0100                if (property.NameEquals("type"))
 101                {
 0102                    type = property.Value.GetString();
 0103                    continue;
 104                }
 0105                if (property.NameEquals("description"))
 106                {
 0107                    description = property.Value.GetString();
 0108                    continue;
 109                }
 0110                if (property.NameEquals("dependsOn"))
 111                {
 0112                    List<ActivityDependency> array = new List<ActivityDependency>();
 0113                    foreach (var item in property.Value.EnumerateArray())
 114                    {
 0115                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 116                    }
 0117                    dependsOn = array;
 0118                    continue;
 119                }
 0120                if (property.NameEquals("userProperties"))
 121                {
 0122                    List<UserProperty> array = new List<UserProperty>();
 0123                    foreach (var item in property.Value.EnumerateArray())
 124                    {
 0125                        array.Add(UserProperty.DeserializeUserProperty(item));
 126                    }
 0127                    userProperties = array;
 0128                    continue;
 129                }
 0130                if (property.NameEquals("typeProperties"))
 131                {
 0132                    foreach (var property0 in property.Value.EnumerateObject())
 133                    {
 0134                        if (property0.NameEquals("expression"))
 135                        {
 0136                            expression = Expression.DeserializeExpression(property0.Value);
 0137                            continue;
 138                        }
 0139                        if (property0.NameEquals("ifTrueActivities"))
 140                        {
 0141                            List<Activity> array = new List<Activity>();
 0142                            foreach (var item in property0.Value.EnumerateArray())
 143                            {
 0144                                array.Add(DeserializeActivity(item));
 145                            }
 0146                            ifTrueActivities = array;
 0147                            continue;
 148                        }
 0149                        if (property0.NameEquals("ifFalseActivities"))
 150                        {
 0151                            List<Activity> array = new List<Activity>();
 0152                            foreach (var item in property0.Value.EnumerateArray())
 153                            {
 0154                                array.Add(DeserializeActivity(item));
 155                            }
 0156                            ifFalseActivities = array;
 157                            continue;
 158                        }
 159                    }
 160                    continue;
 161                }
 0162                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0163                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 164            }
 0165            additionalProperties = additionalPropertiesDictionary;
 0166            return new IfConditionActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(us
 167        }
 168    }
 169}