< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_RootPath()-0%100%
get_EntryFilePath()-0%100%
get_Arguments()-0%100%
get_GetDebugInfo()-0%100%
get_SparkJobLinkedService()-0%100%
get_ClassName()-0%100%
get_ProxyUser()-0%100%
get_SparkConfig()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeHDInsightSparkActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\HDInsightSparkActivity.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> HDInsight Spark activity. </summary>
 15    public partial class HDInsightSparkActivity : ExecutionActivity
 16    {
 17        /// <summary> Initializes a new instance of HDInsightSparkActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <param name="rootPath"> The root path in &apos;sparkJobLinkedService&apos; for all the job’s files. Type: st
 20        /// <param name="entryFilePath"> The relative path to the root folder of the code/package to be executed. Type: 
 21        /// <exception cref="ArgumentNullException"> <paramref name="name"/>, <paramref name="rootPath"/>, or <paramref 
 022        public HDInsightSparkActivity(string name, object rootPath, object entryFilePath) : base(name)
 23        {
 024            if (name == null)
 25            {
 026                throw new ArgumentNullException(nameof(name));
 27            }
 028            if (rootPath == null)
 29            {
 030                throw new ArgumentNullException(nameof(rootPath));
 31            }
 032            if (entryFilePath == null)
 33            {
 034                throw new ArgumentNullException(nameof(entryFilePath));
 35            }
 36
 037            RootPath = rootPath;
 038            EntryFilePath = entryFilePath;
 039            Arguments = new ChangeTrackingList<object>();
 040            SparkConfig = new ChangeTrackingDictionary<string, object>();
 041            Type = "HDInsightSpark";
 042        }
 43
 44        /// <summary> Initializes a new instance of HDInsightSparkActivity. </summary>
 45        /// <param name="name"> Activity name. </param>
 46        /// <param name="type"> Type of activity. </param>
 47        /// <param name="description"> Activity description. </param>
 48        /// <param name="dependsOn"> Activity depends on condition. </param>
 49        /// <param name="userProperties"> Activity user properties. </param>
 50        /// <param name="additionalProperties"> . </param>
 51        /// <param name="linkedServiceName"> Linked service reference. </param>
 52        /// <param name="policy"> Activity policy. </param>
 53        /// <param name="rootPath"> The root path in &apos;sparkJobLinkedService&apos; for all the job’s files. Type: st
 54        /// <param name="entryFilePath"> The relative path to the root folder of the code/package to be executed. Type: 
 55        /// <param name="arguments"> The user-specified arguments to HDInsightSparkActivity. </param>
 56        /// <param name="getDebugInfo"> Debug info option. </param>
 57        /// <param name="sparkJobLinkedService"> The storage linked service for uploading the entry file and dependencie
 58        /// <param name="className"> The application&apos;s Java/Spark main class. </param>
 59        /// <param name="proxyUser"> The user to impersonate that will execute the job. Type: string (or Expression with
 60        /// <param name="sparkConfig"> Spark configuration property. </param>
 061        internal HDInsightSparkActivity(string name, string type, string description, IList<ActivityDependency> dependsO
 62        {
 063            RootPath = rootPath;
 064            EntryFilePath = entryFilePath;
 065            Arguments = arguments;
 066            GetDebugInfo = getDebugInfo;
 067            SparkJobLinkedService = sparkJobLinkedService;
 068            ClassName = className;
 069            ProxyUser = proxyUser;
 070            SparkConfig = sparkConfig;
 071            Type = type ?? "HDInsightSpark";
 072        }
 73
 74        /// <summary> The root path in &apos;sparkJobLinkedService&apos; for all the job’s files. Type: string (or Expre
 075        public object RootPath { get; set; }
 76        /// <summary> The relative path to the root folder of the code/package to be executed. Type: string (or Expressi
 077        public object EntryFilePath { get; set; }
 78        /// <summary> The user-specified arguments to HDInsightSparkActivity. </summary>
 079        public IList<object> Arguments { get; }
 80        /// <summary> Debug info option. </summary>
 081        public HDInsightActivityDebugInfoOption? GetDebugInfo { get; set; }
 82        /// <summary> The storage linked service for uploading the entry file and dependencies, and for receiving logs. 
 083        public LinkedServiceReference SparkJobLinkedService { get; set; }
 84        /// <summary> The application&apos;s Java/Spark main class. </summary>
 085        public string ClassName { get; set; }
 86        /// <summary> The user to impersonate that will execute the job. Type: string (or Expression with resultType str
 087        public object ProxyUser { get; set; }
 88        /// <summary> Spark configuration property. </summary>
 089        public IDictionary<string, object> SparkConfig { get; }
 90    }
 91}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\HDInsightSparkActivity.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 HDInsightSparkActivity : 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("rootPath");
 061            writer.WriteObjectValue(RootPath);
 062            writer.WritePropertyName("entryFilePath");
 063            writer.WriteObjectValue(EntryFilePath);
 064            if (Optional.IsCollectionDefined(Arguments))
 65            {
 066                writer.WritePropertyName("arguments");
 067                writer.WriteStartArray();
 068                foreach (var item in Arguments)
 69                {
 070                    writer.WriteObjectValue(item);
 71                }
 072                writer.WriteEndArray();
 73            }
 074            if (Optional.IsDefined(GetDebugInfo))
 75            {
 076                writer.WritePropertyName("getDebugInfo");
 077                writer.WriteStringValue(GetDebugInfo.Value.ToString());
 78            }
 079            if (Optional.IsDefined(SparkJobLinkedService))
 80            {
 081                writer.WritePropertyName("sparkJobLinkedService");
 082                writer.WriteObjectValue(SparkJobLinkedService);
 83            }
 084            if (Optional.IsDefined(ClassName))
 85            {
 086                writer.WritePropertyName("className");
 087                writer.WriteStringValue(ClassName);
 88            }
 089            if (Optional.IsDefined(ProxyUser))
 90            {
 091                writer.WritePropertyName("proxyUser");
 092                writer.WriteObjectValue(ProxyUser);
 93            }
 094            if (Optional.IsCollectionDefined(SparkConfig))
 95            {
 096                writer.WritePropertyName("sparkConfig");
 097                writer.WriteStartObject();
 098                foreach (var item in SparkConfig)
 99                {
 0100                    writer.WritePropertyName(item.Key);
 0101                    writer.WriteObjectValue(item.Value);
 102                }
 0103                writer.WriteEndObject();
 104            }
 0105            writer.WriteEndObject();
 0106            foreach (var item in AdditionalProperties)
 107            {
 0108                writer.WritePropertyName(item.Key);
 0109                writer.WriteObjectValue(item.Value);
 110            }
 0111            writer.WriteEndObject();
 0112        }
 113
 114        internal static HDInsightSparkActivity DeserializeHDInsightSparkActivity(JsonElement element)
 115        {
 0116            Optional<LinkedServiceReference> linkedServiceName = default;
 0117            Optional<ActivityPolicy> policy = default;
 0118            string name = default;
 0119            string type = default;
 0120            Optional<string> description = default;
 0121            Optional<IList<ActivityDependency>> dependsOn = default;
 0122            Optional<IList<UserProperty>> userProperties = default;
 0123            object rootPath = default;
 0124            object entryFilePath = default;
 0125            Optional<IList<object>> arguments = default;
 0126            Optional<HDInsightActivityDebugInfoOption> getDebugInfo = default;
 0127            Optional<LinkedServiceReference> sparkJobLinkedService = default;
 0128            Optional<string> className = default;
 0129            Optional<object> proxyUser = default;
 0130            Optional<IDictionary<string, object>> sparkConfig = default;
 0131            IDictionary<string, object> additionalProperties = default;
 0132            Dictionary<string, object> additionalPropertiesDictionary = default;
 0133            foreach (var property in element.EnumerateObject())
 134            {
 0135                if (property.NameEquals("linkedServiceName"))
 136                {
 0137                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 0138                    continue;
 139                }
 0140                if (property.NameEquals("policy"))
 141                {
 0142                    policy = ActivityPolicy.DeserializeActivityPolicy(property.Value);
 0143                    continue;
 144                }
 0145                if (property.NameEquals("name"))
 146                {
 0147                    name = property.Value.GetString();
 0148                    continue;
 149                }
 0150                if (property.NameEquals("type"))
 151                {
 0152                    type = property.Value.GetString();
 0153                    continue;
 154                }
 0155                if (property.NameEquals("description"))
 156                {
 0157                    description = property.Value.GetString();
 0158                    continue;
 159                }
 0160                if (property.NameEquals("dependsOn"))
 161                {
 0162                    List<ActivityDependency> array = new List<ActivityDependency>();
 0163                    foreach (var item in property.Value.EnumerateArray())
 164                    {
 0165                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 166                    }
 0167                    dependsOn = array;
 0168                    continue;
 169                }
 0170                if (property.NameEquals("userProperties"))
 171                {
 0172                    List<UserProperty> array = new List<UserProperty>();
 0173                    foreach (var item in property.Value.EnumerateArray())
 174                    {
 0175                        array.Add(UserProperty.DeserializeUserProperty(item));
 176                    }
 0177                    userProperties = array;
 0178                    continue;
 179                }
 0180                if (property.NameEquals("typeProperties"))
 181                {
 0182                    foreach (var property0 in property.Value.EnumerateObject())
 183                    {
 0184                        if (property0.NameEquals("rootPath"))
 185                        {
 0186                            rootPath = property0.Value.GetObject();
 0187                            continue;
 188                        }
 0189                        if (property0.NameEquals("entryFilePath"))
 190                        {
 0191                            entryFilePath = property0.Value.GetObject();
 0192                            continue;
 193                        }
 0194                        if (property0.NameEquals("arguments"))
 195                        {
 0196                            List<object> array = new List<object>();
 0197                            foreach (var item in property0.Value.EnumerateArray())
 198                            {
 0199                                array.Add(item.GetObject());
 200                            }
 0201                            arguments = array;
 0202                            continue;
 203                        }
 0204                        if (property0.NameEquals("getDebugInfo"))
 205                        {
 0206                            getDebugInfo = new HDInsightActivityDebugInfoOption(property0.Value.GetString());
 0207                            continue;
 208                        }
 0209                        if (property0.NameEquals("sparkJobLinkedService"))
 210                        {
 0211                            sparkJobLinkedService = LinkedServiceReference.DeserializeLinkedServiceReference(property0.V
 0212                            continue;
 213                        }
 0214                        if (property0.NameEquals("className"))
 215                        {
 0216                            className = property0.Value.GetString();
 0217                            continue;
 218                        }
 0219                        if (property0.NameEquals("proxyUser"))
 220                        {
 0221                            proxyUser = property0.Value.GetObject();
 0222                            continue;
 223                        }
 0224                        if (property0.NameEquals("sparkConfig"))
 225                        {
 0226                            Dictionary<string, object> dictionary = new Dictionary<string, object>();
 0227                            foreach (var property1 in property0.Value.EnumerateObject())
 228                            {
 0229                                dictionary.Add(property1.Name, property1.Value.GetObject());
 230                            }
 0231                            sparkConfig = dictionary;
 232                            continue;
 233                        }
 234                    }
 235                    continue;
 236                }
 0237                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0238                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 239            }
 0240            additionalProperties = additionalPropertiesDictionary;
 0241            return new HDInsightSparkActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList
 242        }
 243    }
 244}