< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_MainClassName()-0%100%
get_Parameters()-0%100%
get_Libraries()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeDatabricksSparkJarActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\DatabricksSparkJarActivity.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> DatabricksSparkJar activity. </summary>
 15    public partial class DatabricksSparkJarActivity : ExecutionActivity
 16    {
 17        /// <summary> Initializes a new instance of DatabricksSparkJarActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <param name="mainClassName"> The full name of the class containing the main method to be executed. This clas
 20        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="mainClassName"/> is null
 021        public DatabricksSparkJarActivity(string name, object mainClassName) : base(name)
 22        {
 023            if (name == null)
 24            {
 025                throw new ArgumentNullException(nameof(name));
 26            }
 027            if (mainClassName == null)
 28            {
 029                throw new ArgumentNullException(nameof(mainClassName));
 30            }
 31
 032            MainClassName = mainClassName;
 033            Parameters = new ChangeTrackingList<object>();
 034            Libraries = new ChangeTrackingList<IDictionary<string, object>>();
 035            Type = "DatabricksSparkJar";
 036        }
 37
 38        /// <summary> Initializes a new instance of DatabricksSparkJarActivity. </summary>
 39        /// <param name="name"> Activity name. </param>
 40        /// <param name="type"> Type of activity. </param>
 41        /// <param name="description"> Activity description. </param>
 42        /// <param name="dependsOn"> Activity depends on condition. </param>
 43        /// <param name="userProperties"> Activity user properties. </param>
 44        /// <param name="additionalProperties"> . </param>
 45        /// <param name="linkedServiceName"> Linked service reference. </param>
 46        /// <param name="policy"> Activity policy. </param>
 47        /// <param name="mainClassName"> The full name of the class containing the main method to be executed. This clas
 48        /// <param name="parameters"> Parameters that will be passed to the main method. </param>
 49        /// <param name="libraries"> A list of libraries to be installed on the cluster that will execute the job. </par
 050        internal DatabricksSparkJarActivity(string name, string type, string description, IList<ActivityDependency> depe
 51        {
 052            MainClassName = mainClassName;
 053            Parameters = parameters;
 054            Libraries = libraries;
 055            Type = type ?? "DatabricksSparkJar";
 056        }
 57
 58        /// <summary> The full name of the class containing the main method to be executed. This class must be contained
 059        public object MainClassName { get; set; }
 60        /// <summary> Parameters that will be passed to the main method. </summary>
 061        public IList<object> Parameters { get; }
 62        /// <summary> A list of libraries to be installed on the cluster that will execute the job. </summary>
 063        public IList<IDictionary<string, object>> Libraries { get; }
 64    }
 65}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\DatabricksSparkJarActivity.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 DatabricksSparkJarActivity : 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("mainClassName");
 061            writer.WriteObjectValue(MainClassName);
 062            if (Optional.IsCollectionDefined(Parameters))
 63            {
 064                writer.WritePropertyName("parameters");
 065                writer.WriteStartArray();
 066                foreach (var item in Parameters)
 67                {
 068                    writer.WriteObjectValue(item);
 69                }
 070                writer.WriteEndArray();
 71            }
 072            if (Optional.IsCollectionDefined(Libraries))
 73            {
 074                writer.WritePropertyName("libraries");
 075                writer.WriteStartArray();
 076                foreach (var item in Libraries)
 77                {
 078                    writer.WriteStartObject();
 079                    foreach (var item0 in item)
 80                    {
 081                        writer.WritePropertyName(item0.Key);
 082                        writer.WriteObjectValue(item0.Value);
 83                    }
 084                    writer.WriteEndObject();
 85                }
 086                writer.WriteEndArray();
 87            }
 088            writer.WriteEndObject();
 089            foreach (var item in AdditionalProperties)
 90            {
 091                writer.WritePropertyName(item.Key);
 092                writer.WriteObjectValue(item.Value);
 93            }
 094            writer.WriteEndObject();
 095        }
 96
 97        internal static DatabricksSparkJarActivity DeserializeDatabricksSparkJarActivity(JsonElement element)
 98        {
 099            Optional<LinkedServiceReference> linkedServiceName = default;
 0100            Optional<ActivityPolicy> policy = default;
 0101            string name = default;
 0102            string type = default;
 0103            Optional<string> description = default;
 0104            Optional<IList<ActivityDependency>> dependsOn = default;
 0105            Optional<IList<UserProperty>> userProperties = default;
 0106            object mainClassName = default;
 0107            Optional<IList<object>> parameters = default;
 0108            Optional<IList<IDictionary<string, object>>> libraries = default;
 0109            IDictionary<string, object> additionalProperties = default;
 0110            Dictionary<string, object> additionalPropertiesDictionary = default;
 0111            foreach (var property in element.EnumerateObject())
 112            {
 0113                if (property.NameEquals("linkedServiceName"))
 114                {
 0115                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 0116                    continue;
 117                }
 0118                if (property.NameEquals("policy"))
 119                {
 0120                    policy = ActivityPolicy.DeserializeActivityPolicy(property.Value);
 0121                    continue;
 122                }
 0123                if (property.NameEquals("name"))
 124                {
 0125                    name = property.Value.GetString();
 0126                    continue;
 127                }
 0128                if (property.NameEquals("type"))
 129                {
 0130                    type = property.Value.GetString();
 0131                    continue;
 132                }
 0133                if (property.NameEquals("description"))
 134                {
 0135                    description = property.Value.GetString();
 0136                    continue;
 137                }
 0138                if (property.NameEquals("dependsOn"))
 139                {
 0140                    List<ActivityDependency> array = new List<ActivityDependency>();
 0141                    foreach (var item in property.Value.EnumerateArray())
 142                    {
 0143                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 144                    }
 0145                    dependsOn = array;
 0146                    continue;
 147                }
 0148                if (property.NameEquals("userProperties"))
 149                {
 0150                    List<UserProperty> array = new List<UserProperty>();
 0151                    foreach (var item in property.Value.EnumerateArray())
 152                    {
 0153                        array.Add(UserProperty.DeserializeUserProperty(item));
 154                    }
 0155                    userProperties = array;
 0156                    continue;
 157                }
 0158                if (property.NameEquals("typeProperties"))
 159                {
 0160                    foreach (var property0 in property.Value.EnumerateObject())
 161                    {
 0162                        if (property0.NameEquals("mainClassName"))
 163                        {
 0164                            mainClassName = property0.Value.GetObject();
 0165                            continue;
 166                        }
 0167                        if (property0.NameEquals("parameters"))
 168                        {
 0169                            List<object> array = new List<object>();
 0170                            foreach (var item in property0.Value.EnumerateArray())
 171                            {
 0172                                array.Add(item.GetObject());
 173                            }
 0174                            parameters = array;
 0175                            continue;
 176                        }
 0177                        if (property0.NameEquals("libraries"))
 178                        {
 0179                            List<IDictionary<string, object>> array = new List<IDictionary<string, object>>();
 0180                            foreach (var item in property0.Value.EnumerateArray())
 181                            {
 0182                                Dictionary<string, object> dictionary = new Dictionary<string, object>();
 0183                                foreach (var property1 in item.EnumerateObject())
 184                                {
 0185                                    dictionary.Add(property1.Name, property1.Value.GetObject());
 186                                }
 0187                                array.Add(dictionary);
 188                            }
 0189                            libraries = array;
 190                            continue;
 191                        }
 192                    }
 193                    continue;
 194                }
 0195                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0196                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 197            }
 0198            additionalProperties = additionalPropertiesDictionary;
 0199            return new DatabricksSparkJarActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.To
 200        }
 201    }
 202}