< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.SetVariableActivity
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SetVariableActivity.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SetVariableActivity.Serialization.cs
Covered lines:0
Uncovered lines:88
Coverable lines:88
Total lines:191
Line coverage:0% (0 of 88)
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_VariableName()-0%100%
get_Value()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSetVariableActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SetVariableActivity.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> Set value for a Variable. </summary>
 14    public partial class SetVariableActivity : Activity
 15    {
 16        /// <summary> Initializes a new instance of SetVariableActivity. </summary>
 17        /// <param name="name"> Activity name. </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 019        public SetVariableActivity(string name) : base(name)
 20        {
 021            if (name == null)
 22            {
 023                throw new ArgumentNullException(nameof(name));
 24            }
 25
 026            Type = "SetVariable";
 027        }
 28
 29        /// <summary> Initializes a new instance of SetVariableActivity. </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>
 36        /// <param name="variableName"> Name of the variable whose value needs to be set. </param>
 37        /// <param name="value"> Value to be set. Could be a static value or Expression. </param>
 038        internal SetVariableActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, 
 39        {
 040            VariableName = variableName;
 041            Value = value;
 042            Type = type ?? "SetVariable";
 043        }
 44
 45        /// <summary> Name of the variable whose value needs to be set. </summary>
 046        public string VariableName { get; set; }
 47        /// <summary> Value to be set. Could be a static value or Expression. </summary>
 048        public object Value { get; set; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SetVariableActivity.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 SetVariableActivity : 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(VariableName))
 51            {
 052                writer.WritePropertyName("variableName");
 053                writer.WriteStringValue(VariableName);
 54            }
 055            if (Optional.IsDefined(Value))
 56            {
 057                writer.WritePropertyName("value");
 058                writer.WriteObjectValue(Value);
 59            }
 060            writer.WriteEndObject();
 061            foreach (var item in AdditionalProperties)
 62            {
 063                writer.WritePropertyName(item.Key);
 064                writer.WriteObjectValue(item.Value);
 65            }
 066            writer.WriteEndObject();
 067        }
 68
 69        internal static SetVariableActivity DeserializeSetVariableActivity(JsonElement element)
 70        {
 071            string name = default;
 072            string type = default;
 073            Optional<string> description = default;
 074            Optional<IList<ActivityDependency>> dependsOn = default;
 075            Optional<IList<UserProperty>> userProperties = default;
 076            Optional<string> variableName = default;
 077            Optional<object> value = default;
 078            IDictionary<string, object> additionalProperties = default;
 079            Dictionary<string, object> additionalPropertiesDictionary = default;
 080            foreach (var property in element.EnumerateObject())
 81            {
 082                if (property.NameEquals("name"))
 83                {
 084                    name = property.Value.GetString();
 085                    continue;
 86                }
 087                if (property.NameEquals("type"))
 88                {
 089                    type = property.Value.GetString();
 090                    continue;
 91                }
 092                if (property.NameEquals("description"))
 93                {
 094                    description = property.Value.GetString();
 095                    continue;
 96                }
 097                if (property.NameEquals("dependsOn"))
 98                {
 099                    List<ActivityDependency> array = new List<ActivityDependency>();
 0100                    foreach (var item in property.Value.EnumerateArray())
 101                    {
 0102                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 103                    }
 0104                    dependsOn = array;
 0105                    continue;
 106                }
 0107                if (property.NameEquals("userProperties"))
 108                {
 0109                    List<UserProperty> array = new List<UserProperty>();
 0110                    foreach (var item in property.Value.EnumerateArray())
 111                    {
 0112                        array.Add(UserProperty.DeserializeUserProperty(item));
 113                    }
 0114                    userProperties = array;
 0115                    continue;
 116                }
 0117                if (property.NameEquals("typeProperties"))
 118                {
 0119                    foreach (var property0 in property.Value.EnumerateObject())
 120                    {
 0121                        if (property0.NameEquals("variableName"))
 122                        {
 0123                            variableName = property0.Value.GetString();
 0124                            continue;
 125                        }
 0126                        if (property0.NameEquals("value"))
 127                        {
 0128                            value = property0.Value.GetObject();
 129                            continue;
 130                        }
 131                    }
 132                    continue;
 133                }
 0134                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0135                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 136            }
 0137            additionalProperties = additionalPropertiesDictionary;
 0138            return new SetVariableActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(us
 139        }
 140    }
 141}