< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.DatabricksNotebookActivity
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\DatabricksNotebookActivity.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\DatabricksNotebookActivity.Serialization.cs
Covered lines:0
Uncovered lines:135
Coverable lines:135
Total lines:268
Line coverage:0% (0 of 135)
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_NotebookPath()-0%100%
get_BaseParameters()-0%100%
get_Libraries()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeDatabricksNotebookActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\DatabricksNotebookActivity.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> DatabricksNotebook activity. </summary>
 15    public partial class DatabricksNotebookActivity : ExecutionActivity
 16    {
 17        /// <summary> Initializes a new instance of DatabricksNotebookActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <param name="notebookPath"> The absolute path of the notebook to be run in the Databricks Workspace. This pa
 20        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="notebookPath"/> is null.
 021        public DatabricksNotebookActivity(string name, object notebookPath) : base(name)
 22        {
 023            if (name == null)
 24            {
 025                throw new ArgumentNullException(nameof(name));
 26            }
 027            if (notebookPath == null)
 28            {
 029                throw new ArgumentNullException(nameof(notebookPath));
 30            }
 31
 032            NotebookPath = notebookPath;
 033            BaseParameters = new ChangeTrackingDictionary<string, object>();
 034            Libraries = new ChangeTrackingList<IDictionary<string, object>>();
 035            Type = "DatabricksNotebook";
 036        }
 37
 38        /// <summary> Initializes a new instance of DatabricksNotebookActivity. </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="notebookPath"> The absolute path of the notebook to be run in the Databricks Workspace. This pa
 48        /// <param name="baseParameters"> Base parameters to be used for each run of this job.If the notebook takes a pa
 49        /// <param name="libraries"> A list of libraries to be installed on the cluster that will execute the job. </par
 050        internal DatabricksNotebookActivity(string name, string type, string description, IList<ActivityDependency> depe
 51        {
 052            NotebookPath = notebookPath;
 053            BaseParameters = baseParameters;
 054            Libraries = libraries;
 055            Type = type ?? "DatabricksNotebook";
 056        }
 57
 58        /// <summary> The absolute path of the notebook to be run in the Databricks Workspace. This path must begin with
 059        public object NotebookPath { get; set; }
 60        /// <summary> Base parameters to be used for each run of this job.If the notebook takes a parameter that is not 
 061        public IDictionary<string, object> BaseParameters { 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\DatabricksNotebookActivity.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 DatabricksNotebookActivity : 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("notebookPath");
 061            writer.WriteObjectValue(NotebookPath);
 062            if (Optional.IsCollectionDefined(BaseParameters))
 63            {
 064                writer.WritePropertyName("baseParameters");
 065                writer.WriteStartObject();
 066                foreach (var item in BaseParameters)
 67                {
 068                    writer.WritePropertyName(item.Key);
 069                    writer.WriteObjectValue(item.Value);
 70                }
 071                writer.WriteEndObject();
 72            }
 073            if (Optional.IsCollectionDefined(Libraries))
 74            {
 075                writer.WritePropertyName("libraries");
 076                writer.WriteStartArray();
 077                foreach (var item in Libraries)
 78                {
 079                    writer.WriteStartObject();
 080                    foreach (var item0 in item)
 81                    {
 082                        writer.WritePropertyName(item0.Key);
 083                        writer.WriteObjectValue(item0.Value);
 84                    }
 085                    writer.WriteEndObject();
 86                }
 087                writer.WriteEndArray();
 88            }
 089            writer.WriteEndObject();
 090            foreach (var item in AdditionalProperties)
 91            {
 092                writer.WritePropertyName(item.Key);
 093                writer.WriteObjectValue(item.Value);
 94            }
 095            writer.WriteEndObject();
 096        }
 97
 98        internal static DatabricksNotebookActivity DeserializeDatabricksNotebookActivity(JsonElement element)
 99        {
 0100            Optional<LinkedServiceReference> linkedServiceName = default;
 0101            Optional<ActivityPolicy> policy = default;
 0102            string name = default;
 0103            string type = default;
 0104            Optional<string> description = default;
 0105            Optional<IList<ActivityDependency>> dependsOn = default;
 0106            Optional<IList<UserProperty>> userProperties = default;
 0107            object notebookPath = default;
 0108            Optional<IDictionary<string, object>> baseParameters = default;
 0109            Optional<IList<IDictionary<string, object>>> libraries = default;
 0110            IDictionary<string, object> additionalProperties = default;
 0111            Dictionary<string, object> additionalPropertiesDictionary = default;
 0112            foreach (var property in element.EnumerateObject())
 113            {
 0114                if (property.NameEquals("linkedServiceName"))
 115                {
 0116                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 0117                    continue;
 118                }
 0119                if (property.NameEquals("policy"))
 120                {
 0121                    policy = ActivityPolicy.DeserializeActivityPolicy(property.Value);
 0122                    continue;
 123                }
 0124                if (property.NameEquals("name"))
 125                {
 0126                    name = property.Value.GetString();
 0127                    continue;
 128                }
 0129                if (property.NameEquals("type"))
 130                {
 0131                    type = property.Value.GetString();
 0132                    continue;
 133                }
 0134                if (property.NameEquals("description"))
 135                {
 0136                    description = property.Value.GetString();
 0137                    continue;
 138                }
 0139                if (property.NameEquals("dependsOn"))
 140                {
 0141                    List<ActivityDependency> array = new List<ActivityDependency>();
 0142                    foreach (var item in property.Value.EnumerateArray())
 143                    {
 0144                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 145                    }
 0146                    dependsOn = array;
 0147                    continue;
 148                }
 0149                if (property.NameEquals("userProperties"))
 150                {
 0151                    List<UserProperty> array = new List<UserProperty>();
 0152                    foreach (var item in property.Value.EnumerateArray())
 153                    {
 0154                        array.Add(UserProperty.DeserializeUserProperty(item));
 155                    }
 0156                    userProperties = array;
 0157                    continue;
 158                }
 0159                if (property.NameEquals("typeProperties"))
 160                {
 0161                    foreach (var property0 in property.Value.EnumerateObject())
 162                    {
 0163                        if (property0.NameEquals("notebookPath"))
 164                        {
 0165                            notebookPath = property0.Value.GetObject();
 0166                            continue;
 167                        }
 0168                        if (property0.NameEquals("baseParameters"))
 169                        {
 0170                            Dictionary<string, object> dictionary = new Dictionary<string, object>();
 0171                            foreach (var property1 in property0.Value.EnumerateObject())
 172                            {
 0173                                dictionary.Add(property1.Name, property1.Value.GetObject());
 174                            }
 0175                            baseParameters = dictionary;
 0176                            continue;
 177                        }
 0178                        if (property0.NameEquals("libraries"))
 179                        {
 0180                            List<IDictionary<string, object>> array = new List<IDictionary<string, object>>();
 0181                            foreach (var item in property0.Value.EnumerateArray())
 182                            {
 0183                                Dictionary<string, object> dictionary = new Dictionary<string, object>();
 0184                                foreach (var property1 in item.EnumerateObject())
 185                                {
 0186                                    dictionary.Add(property1.Name, property1.Value.GetObject());
 187                                }
 0188                                array.Add(dictionary);
 189                            }
 0190                            libraries = array;
 191                            continue;
 192                        }
 193                    }
 194                    continue;
 195                }
 0196                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0197                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 198            }
 0199            additionalProperties = additionalPropertiesDictionary;
 0200            return new DatabricksNotebookActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.To
 201        }
 202    }
 203}