< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Command()-0%100%
get_ResourceLinkedService()-0%100%
get_FolderPath()-0%100%
get_ReferenceObjects()-0%100%
get_ExtendedProperties()-0%100%
get_RetentionTimeInDays()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeCustomActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\CustomActivity.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> Custom activity type. </summary>
 15    public partial class CustomActivity : ExecutionActivity
 16    {
 17        /// <summary> Initializes a new instance of CustomActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <param name="command"> Command for custom activity Type: string (or Expression with resultType string). </pa
 20        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="command"/> is null. </ex
 021        public CustomActivity(string name, object command) : base(name)
 22        {
 023            if (name == null)
 24            {
 025                throw new ArgumentNullException(nameof(name));
 26            }
 027            if (command == null)
 28            {
 029                throw new ArgumentNullException(nameof(command));
 30            }
 31
 032            Command = command;
 033            ExtendedProperties = new ChangeTrackingDictionary<string, object>();
 034            Type = "Custom";
 035        }
 36
 37        /// <summary> Initializes a new instance of CustomActivity. </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="command"> Command for custom activity Type: string (or Expression with resultType string). </pa
 47        /// <param name="resourceLinkedService"> Resource linked service reference. </param>
 48        /// <param name="folderPath"> Folder path for resource files Type: string (or Expression with resultType string)
 49        /// <param name="referenceObjects"> Reference objects. </param>
 50        /// <param name="extendedProperties"> User defined property bag. There is no restriction on the keys or values t
 51        /// <param name="retentionTimeInDays"> The retention time for the files submitted for custom activity. Type: dou
 052        internal CustomActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, IList
 53        {
 054            Command = command;
 055            ResourceLinkedService = resourceLinkedService;
 056            FolderPath = folderPath;
 057            ReferenceObjects = referenceObjects;
 058            ExtendedProperties = extendedProperties;
 059            RetentionTimeInDays = retentionTimeInDays;
 060            Type = type ?? "Custom";
 061        }
 62
 63        /// <summary> Command for custom activity Type: string (or Expression with resultType string). </summary>
 064        public object Command { get; set; }
 65        /// <summary> Resource linked service reference. </summary>
 066        public LinkedServiceReference ResourceLinkedService { get; set; }
 67        /// <summary> Folder path for resource files Type: string (or Expression with resultType string). </summary>
 068        public object FolderPath { get; set; }
 69        /// <summary> Reference objects. </summary>
 070        public CustomActivityReferenceObject ReferenceObjects { get; set; }
 71        /// <summary> User defined property bag. There is no restriction on the keys or values that can be used. The use
 072        public IDictionary<string, object> ExtendedProperties { get; }
 73        /// <summary> The retention time for the files submitted for custom activity. Type: double (or Expression with r
 074        public object RetentionTimeInDays { get; set; }
 75    }
 76}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\CustomActivity.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 CustomActivity : 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("command");
 061            writer.WriteObjectValue(Command);
 062            if (Optional.IsDefined(ResourceLinkedService))
 63            {
 064                writer.WritePropertyName("resourceLinkedService");
 065                writer.WriteObjectValue(ResourceLinkedService);
 66            }
 067            if (Optional.IsDefined(FolderPath))
 68            {
 069                writer.WritePropertyName("folderPath");
 070                writer.WriteObjectValue(FolderPath);
 71            }
 072            if (Optional.IsDefined(ReferenceObjects))
 73            {
 074                writer.WritePropertyName("referenceObjects");
 075                writer.WriteObjectValue(ReferenceObjects);
 76            }
 077            if (Optional.IsCollectionDefined(ExtendedProperties))
 78            {
 079                writer.WritePropertyName("extendedProperties");
 080                writer.WriteStartObject();
 081                foreach (var item in ExtendedProperties)
 82                {
 083                    writer.WritePropertyName(item.Key);
 084                    writer.WriteObjectValue(item.Value);
 85                }
 086                writer.WriteEndObject();
 87            }
 088            if (Optional.IsDefined(RetentionTimeInDays))
 89            {
 090                writer.WritePropertyName("retentionTimeInDays");
 091                writer.WriteObjectValue(RetentionTimeInDays);
 92            }
 093            writer.WriteEndObject();
 094            foreach (var item in AdditionalProperties)
 95            {
 096                writer.WritePropertyName(item.Key);
 097                writer.WriteObjectValue(item.Value);
 98            }
 099            writer.WriteEndObject();
 0100        }
 101
 102        internal static CustomActivity DeserializeCustomActivity(JsonElement element)
 103        {
 0104            Optional<LinkedServiceReference> linkedServiceName = default;
 0105            Optional<ActivityPolicy> policy = default;
 0106            string name = default;
 0107            string type = default;
 0108            Optional<string> description = default;
 0109            Optional<IList<ActivityDependency>> dependsOn = default;
 0110            Optional<IList<UserProperty>> userProperties = default;
 0111            object command = default;
 0112            Optional<LinkedServiceReference> resourceLinkedService = default;
 0113            Optional<object> folderPath = default;
 0114            Optional<CustomActivityReferenceObject> referenceObjects = default;
 0115            Optional<IDictionary<string, object>> extendedProperties = default;
 0116            Optional<object> retentionTimeInDays = default;
 0117            IDictionary<string, object> additionalProperties = default;
 0118            Dictionary<string, object> additionalPropertiesDictionary = default;
 0119            foreach (var property in element.EnumerateObject())
 120            {
 0121                if (property.NameEquals("linkedServiceName"))
 122                {
 0123                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 0124                    continue;
 125                }
 0126                if (property.NameEquals("policy"))
 127                {
 0128                    policy = ActivityPolicy.DeserializeActivityPolicy(property.Value);
 0129                    continue;
 130                }
 0131                if (property.NameEquals("name"))
 132                {
 0133                    name = property.Value.GetString();
 0134                    continue;
 135                }
 0136                if (property.NameEquals("type"))
 137                {
 0138                    type = property.Value.GetString();
 0139                    continue;
 140                }
 0141                if (property.NameEquals("description"))
 142                {
 0143                    description = property.Value.GetString();
 0144                    continue;
 145                }
 0146                if (property.NameEquals("dependsOn"))
 147                {
 0148                    List<ActivityDependency> array = new List<ActivityDependency>();
 0149                    foreach (var item in property.Value.EnumerateArray())
 150                    {
 0151                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 152                    }
 0153                    dependsOn = array;
 0154                    continue;
 155                }
 0156                if (property.NameEquals("userProperties"))
 157                {
 0158                    List<UserProperty> array = new List<UserProperty>();
 0159                    foreach (var item in property.Value.EnumerateArray())
 160                    {
 0161                        array.Add(UserProperty.DeserializeUserProperty(item));
 162                    }
 0163                    userProperties = array;
 0164                    continue;
 165                }
 0166                if (property.NameEquals("typeProperties"))
 167                {
 0168                    foreach (var property0 in property.Value.EnumerateObject())
 169                    {
 0170                        if (property0.NameEquals("command"))
 171                        {
 0172                            command = property0.Value.GetObject();
 0173                            continue;
 174                        }
 0175                        if (property0.NameEquals("resourceLinkedService"))
 176                        {
 0177                            resourceLinkedService = LinkedServiceReference.DeserializeLinkedServiceReference(property0.V
 0178                            continue;
 179                        }
 0180                        if (property0.NameEquals("folderPath"))
 181                        {
 0182                            folderPath = property0.Value.GetObject();
 0183                            continue;
 184                        }
 0185                        if (property0.NameEquals("referenceObjects"))
 186                        {
 0187                            referenceObjects = CustomActivityReferenceObject.DeserializeCustomActivityReferenceObject(pr
 0188                            continue;
 189                        }
 0190                        if (property0.NameEquals("extendedProperties"))
 191                        {
 0192                            Dictionary<string, object> dictionary = new Dictionary<string, object>();
 0193                            foreach (var property1 in property0.Value.EnumerateObject())
 194                            {
 0195                                dictionary.Add(property1.Name, property1.Value.GetObject());
 196                            }
 0197                            extendedProperties = dictionary;
 0198                            continue;
 199                        }
 0200                        if (property0.NameEquals("retentionTimeInDays"))
 201                        {
 0202                            retentionTimeInDays = property0.Value.GetObject();
 203                            continue;
 204                        }
 205                    }
 206                    continue;
 207                }
 0208                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0209                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 210            }
 0211            additionalProperties = additionalPropertiesDictionary;
 0212            return new CustomActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userPro
 213        }
 214    }
 215}