< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeControlActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ControlActivity.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> Base class for all control activities like IfCondition, ForEach , Until. </summary>
 14    public partial class ControlActivity : Activity
 15    {
 16        /// <summary> Initializes a new instance of ControlActivity. </summary>
 17        /// <param name="name"> Activity name. </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 019        public ControlActivity(string name) : base(name)
 20        {
 021            if (name == null)
 22            {
 023                throw new ArgumentNullException(nameof(name));
 24            }
 25
 026            Type = "Container";
 027        }
 28
 29        /// <summary> Initializes a new instance of ControlActivity. </summary>
 30        /// <param name="name"> Activity name. </param>
 31        /// <param name="type"> Type of activity. </param>
 32        /// <param name="description"> Activity description. </param>
 33        /// <param name="dependsOn"> Activity depends on condition. </param>
 34        /// <param name="userProperties"> Activity user properties. </param>
 35        /// <param name="additionalProperties"> . </param>
 036        internal ControlActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, ILis
 37        {
 038            Type = type ?? "Container";
 039        }
 40    }
 41}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ControlActivity.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 ControlActivity : 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 ControlActivity DeserializeControlActivity(JsonElement element)
 57        {
 058            string name = default;
 059            string type = default;
 060            Optional<string> description = default;
 061            Optional<IList<ActivityDependency>> dependsOn = default;
 062            Optional<IList<UserProperty>> userProperties = default;
 063            IDictionary<string, object> additionalProperties = default;
 064            Dictionary<string, object> additionalPropertiesDictionary = default;
 065            foreach (var property in element.EnumerateObject())
 66            {
 067                if (property.NameEquals("name"))
 68                {
 069                    name = property.Value.GetString();
 070                    continue;
 71                }
 072                if (property.NameEquals("type"))
 73                {
 074                    type = property.Value.GetString();
 075                    continue;
 76                }
 077                if (property.NameEquals("description"))
 78                {
 079                    description = property.Value.GetString();
 080                    continue;
 81                }
 082                if (property.NameEquals("dependsOn"))
 83                {
 084                    List<ActivityDependency> array = new List<ActivityDependency>();
 085                    foreach (var item in property.Value.EnumerateArray())
 86                    {
 087                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 88                    }
 089                    dependsOn = array;
 090                    continue;
 91                }
 092                if (property.NameEquals("userProperties"))
 93                {
 094                    List<UserProperty> array = new List<UserProperty>();
 095                    foreach (var item in property.Value.EnumerateArray())
 96                    {
 097                        array.Add(UserProperty.DeserializeUserProperty(item));
 98                    }
 099                    userProperties = array;
 0100                    continue;
 101                }
 0102                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0103                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 104            }
 0105            additionalProperties = additionalPropertiesDictionary;
 0106            return new ControlActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userPr
 107        }
 108    }
 109}