< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Items()-0%100%
get_Condition()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeFilterActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\FilterActivity.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> Filter and return results from input array based on the conditions. </summary>
 14    public partial class FilterActivity : Activity
 15    {
 16        /// <summary> Initializes a new instance of FilterActivity. </summary>
 17        /// <param name="name"> Activity name. </param>
 18        /// <param name="items"> Input array on which filter should be applied. </param>
 19        /// <param name="condition"> Condition to be used for filtering the input. </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="name"/>, <paramref name="items"/>, or <paramref nam
 021        public FilterActivity(string name, Expression items, Expression condition) : base(name)
 22        {
 023            if (name == null)
 24            {
 025                throw new ArgumentNullException(nameof(name));
 26            }
 027            if (items == null)
 28            {
 029                throw new ArgumentNullException(nameof(items));
 30            }
 031            if (condition == null)
 32            {
 033                throw new ArgumentNullException(nameof(condition));
 34            }
 35
 036            Items = items;
 037            Condition = condition;
 038            Type = "Filter";
 039        }
 40
 41        /// <summary> Initializes a new instance of FilterActivity. </summary>
 42        /// <param name="name"> Activity name. </param>
 43        /// <param name="type"> Type of activity. </param>
 44        /// <param name="description"> Activity description. </param>
 45        /// <param name="dependsOn"> Activity depends on condition. </param>
 46        /// <param name="userProperties"> Activity user properties. </param>
 47        /// <param name="additionalProperties"> . </param>
 48        /// <param name="items"> Input array on which filter should be applied. </param>
 49        /// <param name="condition"> Condition to be used for filtering the input. </param>
 050        internal FilterActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, IList
 51        {
 052            Items = items;
 053            Condition = condition;
 054            Type = type ?? "Filter";
 055        }
 56
 57        /// <summary> Input array on which filter should be applied. </summary>
 058        public Expression Items { get; set; }
 59        /// <summary> Condition to be used for filtering the input. </summary>
 060        public Expression Condition { get; set; }
 61    }
 62}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\FilterActivity.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 FilterActivity : 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("items");
 051            writer.WriteObjectValue(Items);
 052            writer.WritePropertyName("condition");
 053            writer.WriteObjectValue(Condition);
 054            writer.WriteEndObject();
 055            foreach (var item in AdditionalProperties)
 56            {
 057                writer.WritePropertyName(item.Key);
 058                writer.WriteObjectValue(item.Value);
 59            }
 060            writer.WriteEndObject();
 061        }
 62
 63        internal static FilterActivity DeserializeFilterActivity(JsonElement element)
 64        {
 065            string name = default;
 066            string type = default;
 067            Optional<string> description = default;
 068            Optional<IList<ActivityDependency>> dependsOn = default;
 069            Optional<IList<UserProperty>> userProperties = default;
 070            Expression items = default;
 071            Expression condition = default;
 072            IDictionary<string, object> additionalProperties = default;
 073            Dictionary<string, object> additionalPropertiesDictionary = default;
 074            foreach (var property in element.EnumerateObject())
 75            {
 076                if (property.NameEquals("name"))
 77                {
 078                    name = property.Value.GetString();
 079                    continue;
 80                }
 081                if (property.NameEquals("type"))
 82                {
 083                    type = property.Value.GetString();
 084                    continue;
 85                }
 086                if (property.NameEquals("description"))
 87                {
 088                    description = property.Value.GetString();
 089                    continue;
 90                }
 091                if (property.NameEquals("dependsOn"))
 92                {
 093                    List<ActivityDependency> array = new List<ActivityDependency>();
 094                    foreach (var item in property.Value.EnumerateArray())
 95                    {
 096                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 97                    }
 098                    dependsOn = array;
 099                    continue;
 100                }
 0101                if (property.NameEquals("userProperties"))
 102                {
 0103                    List<UserProperty> array = new List<UserProperty>();
 0104                    foreach (var item in property.Value.EnumerateArray())
 105                    {
 0106                        array.Add(UserProperty.DeserializeUserProperty(item));
 107                    }
 0108                    userProperties = array;
 0109                    continue;
 110                }
 0111                if (property.NameEquals("typeProperties"))
 112                {
 0113                    foreach (var property0 in property.Value.EnumerateObject())
 114                    {
 0115                        if (property0.NameEquals("items"))
 116                        {
 0117                            items = Expression.DeserializeExpression(property0.Value);
 0118                            continue;
 119                        }
 0120                        if (property0.NameEquals("condition"))
 121                        {
 0122                            condition = Expression.DeserializeExpression(property0.Value);
 123                            continue;
 124                        }
 125                    }
 126                    continue;
 127                }
 0128                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0129                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 130            }
 0131            additionalProperties = additionalPropertiesDictionary;
 0132            return new FilterActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userPro
 133        }
 134    }
 135}