< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.SqlServerStoredProcedureActivity
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlServerStoredProcedureActivity.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlServerStoredProcedureActivity.Serialization.cs
Covered lines:0
Uncovered lines:112
Coverable lines:112
Total lines:231
Line coverage:0% (0 of 112)
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_StoredProcedureName()-0%100%
get_StoredProcedureParameters()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSqlServerStoredProcedureActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlServerStoredProcedureActivity.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> SQL stored procedure activity type. </summary>
 15    public partial class SqlServerStoredProcedureActivity : ExecutionActivity
 16    {
 17        /// <summary> Initializes a new instance of SqlServerStoredProcedureActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <param name="storedProcedureName"> Stored procedure name. Type: string (or Expression with resultType string
 20        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="storedProcedureName"/> i
 021        public SqlServerStoredProcedureActivity(string name, object storedProcedureName) : base(name)
 22        {
 023            if (name == null)
 24            {
 025                throw new ArgumentNullException(nameof(name));
 26            }
 027            if (storedProcedureName == null)
 28            {
 029                throw new ArgumentNullException(nameof(storedProcedureName));
 30            }
 31
 032            StoredProcedureName = storedProcedureName;
 033            StoredProcedureParameters = new ChangeTrackingDictionary<string, StoredProcedureParameter>();
 034            Type = "SqlServerStoredProcedure";
 035        }
 36
 37        /// <summary> Initializes a new instance of SqlServerStoredProcedureActivity. </summary>
 38        /// <param name="name"> Activity name. </param>
 39        /// <param name="type"> Type of activity. </param>
 40        /// <param name="description"> Activity description. </param>
 41        /// <param name="dependsOn"> Activity depends on condition. </param>
 42        /// <param name="userProperties"> Activity user properties. </param>
 43        /// <param name="additionalProperties"> . </param>
 44        /// <param name="linkedServiceName"> Linked service reference. </param>
 45        /// <param name="policy"> Activity policy. </param>
 46        /// <param name="storedProcedureName"> Stored procedure name. Type: string (or Expression with resultType string
 47        /// <param name="storedProcedureParameters"> Value and type setting for stored procedure parameters. Example: &q
 048        internal SqlServerStoredProcedureActivity(string name, string type, string description, IList<ActivityDependency
 49        {
 050            StoredProcedureName = storedProcedureName;
 051            StoredProcedureParameters = storedProcedureParameters;
 052            Type = type ?? "SqlServerStoredProcedure";
 053        }
 54
 55        /// <summary> Stored procedure name. Type: string (or Expression with resultType string). </summary>
 056        public object StoredProcedureName { get; set; }
 57        /// <summary> Value and type setting for stored procedure parameters. Example: &quot;{Parameter1: {value: &quot;
 058        public IDictionary<string, StoredProcedureParameter> StoredProcedureParameters { get; }
 59    }
 60}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlServerStoredProcedureActivity.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 SqlServerStoredProcedureActivity : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsDefined(LinkedServiceName))
 20            {
 021                writer.WritePropertyName("linkedServiceName");
 022                writer.WriteObjectValue(LinkedServiceName);
 23            }
 024            if (Optional.IsDefined(Policy))
 25            {
 026                writer.WritePropertyName("policy");
 027                writer.WriteObjectValue(Policy);
 28            }
 029            writer.WritePropertyName("name");
 030            writer.WriteStringValue(Name);
 031            writer.WritePropertyName("type");
 032            writer.WriteStringValue(Type);
 033            if (Optional.IsDefined(Description))
 34            {
 035                writer.WritePropertyName("description");
 036                writer.WriteStringValue(Description);
 37            }
 038            if (Optional.IsCollectionDefined(DependsOn))
 39            {
 040                writer.WritePropertyName("dependsOn");
 041                writer.WriteStartArray();
 042                foreach (var item in DependsOn)
 43                {
 044                    writer.WriteObjectValue(item);
 45                }
 046                writer.WriteEndArray();
 47            }
 048            if (Optional.IsCollectionDefined(UserProperties))
 49            {
 050                writer.WritePropertyName("userProperties");
 051                writer.WriteStartArray();
 052                foreach (var item in UserProperties)
 53                {
 054                    writer.WriteObjectValue(item);
 55                }
 056                writer.WriteEndArray();
 57            }
 058            writer.WritePropertyName("typeProperties");
 059            writer.WriteStartObject();
 060            writer.WritePropertyName("storedProcedureName");
 061            writer.WriteObjectValue(StoredProcedureName);
 062            if (Optional.IsCollectionDefined(StoredProcedureParameters))
 63            {
 064                writer.WritePropertyName("storedProcedureParameters");
 065                writer.WriteStartObject();
 066                foreach (var item in StoredProcedureParameters)
 67                {
 068                    writer.WritePropertyName(item.Key);
 069                    writer.WriteObjectValue(item.Value);
 70                }
 071                writer.WriteEndObject();
 72            }
 073            writer.WriteEndObject();
 074            foreach (var item in AdditionalProperties)
 75            {
 076                writer.WritePropertyName(item.Key);
 077                writer.WriteObjectValue(item.Value);
 78            }
 079            writer.WriteEndObject();
 080        }
 81
 82        internal static SqlServerStoredProcedureActivity DeserializeSqlServerStoredProcedureActivity(JsonElement element
 83        {
 084            Optional<LinkedServiceReference> linkedServiceName = default;
 085            Optional<ActivityPolicy> policy = default;
 086            string name = default;
 087            string type = default;
 088            Optional<string> description = default;
 089            Optional<IList<ActivityDependency>> dependsOn = default;
 090            Optional<IList<UserProperty>> userProperties = default;
 091            object storedProcedureName = default;
 092            Optional<IDictionary<string, StoredProcedureParameter>> storedProcedureParameters = default;
 093            IDictionary<string, object> additionalProperties = default;
 094            Dictionary<string, object> additionalPropertiesDictionary = default;
 095            foreach (var property in element.EnumerateObject())
 96            {
 097                if (property.NameEquals("linkedServiceName"))
 98                {
 099                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 0100                    continue;
 101                }
 0102                if (property.NameEquals("policy"))
 103                {
 0104                    policy = ActivityPolicy.DeserializeActivityPolicy(property.Value);
 0105                    continue;
 106                }
 0107                if (property.NameEquals("name"))
 108                {
 0109                    name = property.Value.GetString();
 0110                    continue;
 111                }
 0112                if (property.NameEquals("type"))
 113                {
 0114                    type = property.Value.GetString();
 0115                    continue;
 116                }
 0117                if (property.NameEquals("description"))
 118                {
 0119                    description = property.Value.GetString();
 0120                    continue;
 121                }
 0122                if (property.NameEquals("dependsOn"))
 123                {
 0124                    List<ActivityDependency> array = new List<ActivityDependency>();
 0125                    foreach (var item in property.Value.EnumerateArray())
 126                    {
 0127                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 128                    }
 0129                    dependsOn = array;
 0130                    continue;
 131                }
 0132                if (property.NameEquals("userProperties"))
 133                {
 0134                    List<UserProperty> array = new List<UserProperty>();
 0135                    foreach (var item in property.Value.EnumerateArray())
 136                    {
 0137                        array.Add(UserProperty.DeserializeUserProperty(item));
 138                    }
 0139                    userProperties = array;
 0140                    continue;
 141                }
 0142                if (property.NameEquals("typeProperties"))
 143                {
 0144                    foreach (var property0 in property.Value.EnumerateObject())
 145                    {
 0146                        if (property0.NameEquals("storedProcedureName"))
 147                        {
 0148                            storedProcedureName = property0.Value.GetObject();
 0149                            continue;
 150                        }
 0151                        if (property0.NameEquals("storedProcedureParameters"))
 152                        {
 0153                            Dictionary<string, StoredProcedureParameter> dictionary = new Dictionary<string, StoredProce
 0154                            foreach (var property1 in property0.Value.EnumerateObject())
 155                            {
 0156                                dictionary.Add(property1.Name, StoredProcedureParameter.DeserializeStoredProcedureParame
 157                            }
 0158                            storedProcedureParameters = dictionary;
 159                            continue;
 160                        }
 161                    }
 162                    continue;
 163                }
 0164                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0165                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 166            }
 0167            additionalProperties = additionalPropertiesDictionary;
 0168            return new SqlServerStoredProcedureActivity(name, type, description.Value, Optional.ToList(dependsOn), Optio
 169        }
 170    }
 171}