< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_StorageLinkedServices()-0%100%
get_Arguments()-0%100%
get_GetDebugInfo()-0%100%
get_ScriptPath()-0%100%
get_ScriptLinkedService()-0%100%
get_Defines()-0%100%
get_Variables()-0%100%
get_QueryTimeout()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeHDInsightHiveActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\HDInsightHiveActivity.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 Hive activity type. </summary>
 15    public partial class HDInsightHiveActivity : ExecutionActivity
 16    {
 17        /// <summary> Initializes a new instance of HDInsightHiveActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 020        public HDInsightHiveActivity(string name) : base(name)
 21        {
 022            if (name == null)
 23            {
 024                throw new ArgumentNullException(nameof(name));
 25            }
 26
 027            StorageLinkedServices = new ChangeTrackingList<LinkedServiceReference>();
 028            Arguments = new ChangeTrackingList<object>();
 029            Defines = new ChangeTrackingDictionary<string, object>();
 030            Variables = new ChangeTrackingList<object>();
 031            Type = "HDInsightHive";
 032        }
 33
 34        /// <summary> Initializes a new instance of HDInsightHiveActivity. </summary>
 35        /// <param name="name"> Activity name. </param>
 36        /// <param name="type"> Type of activity. </param>
 37        /// <param name="description"> Activity description. </param>
 38        /// <param name="dependsOn"> Activity depends on condition. </param>
 39        /// <param name="userProperties"> Activity user properties. </param>
 40        /// <param name="additionalProperties"> . </param>
 41        /// <param name="linkedServiceName"> Linked service reference. </param>
 42        /// <param name="policy"> Activity policy. </param>
 43        /// <param name="storageLinkedServices"> Storage linked service references. </param>
 44        /// <param name="arguments"> User specified arguments to HDInsightActivity. </param>
 45        /// <param name="getDebugInfo"> Debug info option. </param>
 46        /// <param name="scriptPath"> Script path. Type: string (or Expression with resultType string). </param>
 47        /// <param name="scriptLinkedService"> Script linked service reference. </param>
 48        /// <param name="defines"> Allows user to specify defines for Hive job request. </param>
 49        /// <param name="variables"> User specified arguments under hivevar namespace. </param>
 50        /// <param name="queryTimeout"> Query timeout value (in minutes).  Effective when the HDInsight cluster is with 
 051        internal HDInsightHiveActivity(string name, string type, string description, IList<ActivityDependency> dependsOn
 52        {
 053            StorageLinkedServices = storageLinkedServices;
 054            Arguments = arguments;
 055            GetDebugInfo = getDebugInfo;
 056            ScriptPath = scriptPath;
 057            ScriptLinkedService = scriptLinkedService;
 058            Defines = defines;
 059            Variables = variables;
 060            QueryTimeout = queryTimeout;
 061            Type = type ?? "HDInsightHive";
 062        }
 63
 64        /// <summary> Storage linked service references. </summary>
 065        public IList<LinkedServiceReference> StorageLinkedServices { get; }
 66        /// <summary> User specified arguments to HDInsightActivity. </summary>
 067        public IList<object> Arguments { get; }
 68        /// <summary> Debug info option. </summary>
 069        public HDInsightActivityDebugInfoOption? GetDebugInfo { get; set; }
 70        /// <summary> Script path. Type: string (or Expression with resultType string). </summary>
 071        public object ScriptPath { get; set; }
 72        /// <summary> Script linked service reference. </summary>
 073        public LinkedServiceReference ScriptLinkedService { get; set; }
 74        /// <summary> Allows user to specify defines for Hive job request. </summary>
 075        public IDictionary<string, object> Defines { get; }
 76        /// <summary> User specified arguments under hivevar namespace. </summary>
 077        public IList<object> Variables { get; }
 78        /// <summary> Query timeout value (in minutes).  Effective when the HDInsight cluster is with ESP (Enterprise Se
 079        public int? QueryTimeout { get; set; }
 80    }
 81}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\HDInsightHiveActivity.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 HDInsightHiveActivity : 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            if (Optional.IsCollectionDefined(StorageLinkedServices))
 61            {
 062                writer.WritePropertyName("storageLinkedServices");
 063                writer.WriteStartArray();
 064                foreach (var item in StorageLinkedServices)
 65                {
 066                    writer.WriteObjectValue(item);
 67                }
 068                writer.WriteEndArray();
 69            }
 070            if (Optional.IsCollectionDefined(Arguments))
 71            {
 072                writer.WritePropertyName("arguments");
 073                writer.WriteStartArray();
 074                foreach (var item in Arguments)
 75                {
 076                    writer.WriteObjectValue(item);
 77                }
 078                writer.WriteEndArray();
 79            }
 080            if (Optional.IsDefined(GetDebugInfo))
 81            {
 082                writer.WritePropertyName("getDebugInfo");
 083                writer.WriteStringValue(GetDebugInfo.Value.ToString());
 84            }
 085            if (Optional.IsDefined(ScriptPath))
 86            {
 087                writer.WritePropertyName("scriptPath");
 088                writer.WriteObjectValue(ScriptPath);
 89            }
 090            if (Optional.IsDefined(ScriptLinkedService))
 91            {
 092                writer.WritePropertyName("scriptLinkedService");
 093                writer.WriteObjectValue(ScriptLinkedService);
 94            }
 095            if (Optional.IsCollectionDefined(Defines))
 96            {
 097                writer.WritePropertyName("defines");
 098                writer.WriteStartObject();
 099                foreach (var item in Defines)
 100                {
 0101                    writer.WritePropertyName(item.Key);
 0102                    writer.WriteObjectValue(item.Value);
 103                }
 0104                writer.WriteEndObject();
 105            }
 0106            if (Optional.IsCollectionDefined(Variables))
 107            {
 0108                writer.WritePropertyName("variables");
 0109                writer.WriteStartArray();
 0110                foreach (var item in Variables)
 111                {
 0112                    writer.WriteObjectValue(item);
 113                }
 0114                writer.WriteEndArray();
 115            }
 0116            if (Optional.IsDefined(QueryTimeout))
 117            {
 0118                writer.WritePropertyName("queryTimeout");
 0119                writer.WriteNumberValue(QueryTimeout.Value);
 120            }
 0121            writer.WriteEndObject();
 0122            foreach (var item in AdditionalProperties)
 123            {
 0124                writer.WritePropertyName(item.Key);
 0125                writer.WriteObjectValue(item.Value);
 126            }
 0127            writer.WriteEndObject();
 0128        }
 129
 130        internal static HDInsightHiveActivity DeserializeHDInsightHiveActivity(JsonElement element)
 131        {
 0132            Optional<LinkedServiceReference> linkedServiceName = default;
 0133            Optional<ActivityPolicy> policy = default;
 0134            string name = default;
 0135            string type = default;
 0136            Optional<string> description = default;
 0137            Optional<IList<ActivityDependency>> dependsOn = default;
 0138            Optional<IList<UserProperty>> userProperties = default;
 0139            Optional<IList<LinkedServiceReference>> storageLinkedServices = default;
 0140            Optional<IList<object>> arguments = default;
 0141            Optional<HDInsightActivityDebugInfoOption> getDebugInfo = default;
 0142            Optional<object> scriptPath = default;
 0143            Optional<LinkedServiceReference> scriptLinkedService = default;
 0144            Optional<IDictionary<string, object>> defines = default;
 0145            Optional<IList<object>> variables = default;
 0146            Optional<int> queryTimeout = default;
 0147            IDictionary<string, object> additionalProperties = default;
 0148            Dictionary<string, object> additionalPropertiesDictionary = default;
 0149            foreach (var property in element.EnumerateObject())
 150            {
 0151                if (property.NameEquals("linkedServiceName"))
 152                {
 0153                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 0154                    continue;
 155                }
 0156                if (property.NameEquals("policy"))
 157                {
 0158                    policy = ActivityPolicy.DeserializeActivityPolicy(property.Value);
 0159                    continue;
 160                }
 0161                if (property.NameEquals("name"))
 162                {
 0163                    name = property.Value.GetString();
 0164                    continue;
 165                }
 0166                if (property.NameEquals("type"))
 167                {
 0168                    type = property.Value.GetString();
 0169                    continue;
 170                }
 0171                if (property.NameEquals("description"))
 172                {
 0173                    description = property.Value.GetString();
 0174                    continue;
 175                }
 0176                if (property.NameEquals("dependsOn"))
 177                {
 0178                    List<ActivityDependency> array = new List<ActivityDependency>();
 0179                    foreach (var item in property.Value.EnumerateArray())
 180                    {
 0181                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 182                    }
 0183                    dependsOn = array;
 0184                    continue;
 185                }
 0186                if (property.NameEquals("userProperties"))
 187                {
 0188                    List<UserProperty> array = new List<UserProperty>();
 0189                    foreach (var item in property.Value.EnumerateArray())
 190                    {
 0191                        array.Add(UserProperty.DeserializeUserProperty(item));
 192                    }
 0193                    userProperties = array;
 0194                    continue;
 195                }
 0196                if (property.NameEquals("typeProperties"))
 197                {
 0198                    foreach (var property0 in property.Value.EnumerateObject())
 199                    {
 0200                        if (property0.NameEquals("storageLinkedServices"))
 201                        {
 0202                            List<LinkedServiceReference> array = new List<LinkedServiceReference>();
 0203                            foreach (var item in property0.Value.EnumerateArray())
 204                            {
 0205                                array.Add(LinkedServiceReference.DeserializeLinkedServiceReference(item));
 206                            }
 0207                            storageLinkedServices = array;
 0208                            continue;
 209                        }
 0210                        if (property0.NameEquals("arguments"))
 211                        {
 0212                            List<object> array = new List<object>();
 0213                            foreach (var item in property0.Value.EnumerateArray())
 214                            {
 0215                                array.Add(item.GetObject());
 216                            }
 0217                            arguments = array;
 0218                            continue;
 219                        }
 0220                        if (property0.NameEquals("getDebugInfo"))
 221                        {
 0222                            getDebugInfo = new HDInsightActivityDebugInfoOption(property0.Value.GetString());
 0223                            continue;
 224                        }
 0225                        if (property0.NameEquals("scriptPath"))
 226                        {
 0227                            scriptPath = property0.Value.GetObject();
 0228                            continue;
 229                        }
 0230                        if (property0.NameEquals("scriptLinkedService"))
 231                        {
 0232                            scriptLinkedService = LinkedServiceReference.DeserializeLinkedServiceReference(property0.Val
 0233                            continue;
 234                        }
 0235                        if (property0.NameEquals("defines"))
 236                        {
 0237                            Dictionary<string, object> dictionary = new Dictionary<string, object>();
 0238                            foreach (var property1 in property0.Value.EnumerateObject())
 239                            {
 0240                                dictionary.Add(property1.Name, property1.Value.GetObject());
 241                            }
 0242                            defines = dictionary;
 0243                            continue;
 244                        }
 0245                        if (property0.NameEquals("variables"))
 246                        {
 0247                            List<object> array = new List<object>();
 0248                            foreach (var item in property0.Value.EnumerateArray())
 249                            {
 0250                                array.Add(item.GetObject());
 251                            }
 0252                            variables = array;
 0253                            continue;
 254                        }
 0255                        if (property0.NameEquals("queryTimeout"))
 256                        {
 0257                            queryTimeout = property0.Value.GetInt32();
 258                            continue;
 259                        }
 260                    }
 261                    continue;
 262                }
 0263                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0264                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 265            }
 0266            additionalProperties = additionalPropertiesDictionary;
 0267            return new HDInsightHiveActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(
 268        }
 269    }
 270}