< Summary

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

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%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeHDInsightPigActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\HDInsightPigActivity.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 Pig activity type. </summary>
 15    public partial class HDInsightPigActivity : ExecutionActivity
 16    {
 17        /// <summary> Initializes a new instance of HDInsightPigActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 020        public HDInsightPigActivity(string name) : base(name)
 21        {
 022            if (name == null)
 23            {
 024                throw new ArgumentNullException(nameof(name));
 25            }
 26
 027            StorageLinkedServices = new ChangeTrackingList<LinkedServiceReference>();
 028            Defines = new ChangeTrackingDictionary<string, object>();
 029            Type = "HDInsightPig";
 030        }
 31
 32        /// <summary> Initializes a new instance of HDInsightPigActivity. </summary>
 33        /// <param name="name"> Activity name. </param>
 34        /// <param name="type"> Type of activity. </param>
 35        /// <param name="description"> Activity description. </param>
 36        /// <param name="dependsOn"> Activity depends on condition. </param>
 37        /// <param name="userProperties"> Activity user properties. </param>
 38        /// <param name="additionalProperties"> . </param>
 39        /// <param name="linkedServiceName"> Linked service reference. </param>
 40        /// <param name="policy"> Activity policy. </param>
 41        /// <param name="storageLinkedServices"> Storage linked service references. </param>
 42        /// <param name="arguments"> User specified arguments to HDInsightActivity. Type: array (or Expression with resu
 43        /// <param name="getDebugInfo"> Debug info option. </param>
 44        /// <param name="scriptPath"> Script path. Type: string (or Expression with resultType string). </param>
 45        /// <param name="scriptLinkedService"> Script linked service reference. </param>
 46        /// <param name="defines"> Allows user to specify defines for Pig job request. </param>
 047        internal HDInsightPigActivity(string name, string type, string description, IList<ActivityDependency> dependsOn,
 48        {
 049            StorageLinkedServices = storageLinkedServices;
 050            Arguments = arguments;
 051            GetDebugInfo = getDebugInfo;
 052            ScriptPath = scriptPath;
 053            ScriptLinkedService = scriptLinkedService;
 054            Defines = defines;
 055            Type = type ?? "HDInsightPig";
 056        }
 57
 58        /// <summary> Storage linked service references. </summary>
 059        public IList<LinkedServiceReference> StorageLinkedServices { get; }
 60        /// <summary> User specified arguments to HDInsightActivity. Type: array (or Expression with resultType array). 
 061        public object Arguments { get; set; }
 62        /// <summary> Debug info option. </summary>
 063        public HDInsightActivityDebugInfoOption? GetDebugInfo { get; set; }
 64        /// <summary> Script path. Type: string (or Expression with resultType string). </summary>
 065        public object ScriptPath { get; set; }
 66        /// <summary> Script linked service reference. </summary>
 067        public LinkedServiceReference ScriptLinkedService { get; set; }
 68        /// <summary> Allows user to specify defines for Pig job request. </summary>
 069        public IDictionary<string, object> Defines { get; }
 70    }
 71}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\HDInsightPigActivity.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 HDInsightPigActivity : 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.IsDefined(Arguments))
 71            {
 072                writer.WritePropertyName("arguments");
 073                writer.WriteObjectValue(Arguments);
 74            }
 075            if (Optional.IsDefined(GetDebugInfo))
 76            {
 077                writer.WritePropertyName("getDebugInfo");
 078                writer.WriteStringValue(GetDebugInfo.Value.ToString());
 79            }
 080            if (Optional.IsDefined(ScriptPath))
 81            {
 082                writer.WritePropertyName("scriptPath");
 083                writer.WriteObjectValue(ScriptPath);
 84            }
 085            if (Optional.IsDefined(ScriptLinkedService))
 86            {
 087                writer.WritePropertyName("scriptLinkedService");
 088                writer.WriteObjectValue(ScriptLinkedService);
 89            }
 090            if (Optional.IsCollectionDefined(Defines))
 91            {
 092                writer.WritePropertyName("defines");
 093                writer.WriteStartObject();
 094                foreach (var item in Defines)
 95                {
 096                    writer.WritePropertyName(item.Key);
 097                    writer.WriteObjectValue(item.Value);
 98                }
 099                writer.WriteEndObject();
 100            }
 0101            writer.WriteEndObject();
 0102            foreach (var item in AdditionalProperties)
 103            {
 0104                writer.WritePropertyName(item.Key);
 0105                writer.WriteObjectValue(item.Value);
 106            }
 0107            writer.WriteEndObject();
 0108        }
 109
 110        internal static HDInsightPigActivity DeserializeHDInsightPigActivity(JsonElement element)
 111        {
 0112            Optional<LinkedServiceReference> linkedServiceName = default;
 0113            Optional<ActivityPolicy> policy = default;
 0114            string name = default;
 0115            string type = default;
 0116            Optional<string> description = default;
 0117            Optional<IList<ActivityDependency>> dependsOn = default;
 0118            Optional<IList<UserProperty>> userProperties = default;
 0119            Optional<IList<LinkedServiceReference>> storageLinkedServices = default;
 0120            Optional<object> arguments = default;
 0121            Optional<HDInsightActivityDebugInfoOption> getDebugInfo = default;
 0122            Optional<object> scriptPath = default;
 0123            Optional<LinkedServiceReference> scriptLinkedService = default;
 0124            Optional<IDictionary<string, object>> defines = default;
 0125            IDictionary<string, object> additionalProperties = default;
 0126            Dictionary<string, object> additionalPropertiesDictionary = default;
 0127            foreach (var property in element.EnumerateObject())
 128            {
 0129                if (property.NameEquals("linkedServiceName"))
 130                {
 0131                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 0132                    continue;
 133                }
 0134                if (property.NameEquals("policy"))
 135                {
 0136                    policy = ActivityPolicy.DeserializeActivityPolicy(property.Value);
 0137                    continue;
 138                }
 0139                if (property.NameEquals("name"))
 140                {
 0141                    name = property.Value.GetString();
 0142                    continue;
 143                }
 0144                if (property.NameEquals("type"))
 145                {
 0146                    type = property.Value.GetString();
 0147                    continue;
 148                }
 0149                if (property.NameEquals("description"))
 150                {
 0151                    description = property.Value.GetString();
 0152                    continue;
 153                }
 0154                if (property.NameEquals("dependsOn"))
 155                {
 0156                    List<ActivityDependency> array = new List<ActivityDependency>();
 0157                    foreach (var item in property.Value.EnumerateArray())
 158                    {
 0159                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 160                    }
 0161                    dependsOn = array;
 0162                    continue;
 163                }
 0164                if (property.NameEquals("userProperties"))
 165                {
 0166                    List<UserProperty> array = new List<UserProperty>();
 0167                    foreach (var item in property.Value.EnumerateArray())
 168                    {
 0169                        array.Add(UserProperty.DeserializeUserProperty(item));
 170                    }
 0171                    userProperties = array;
 0172                    continue;
 173                }
 0174                if (property.NameEquals("typeProperties"))
 175                {
 0176                    foreach (var property0 in property.Value.EnumerateObject())
 177                    {
 0178                        if (property0.NameEquals("storageLinkedServices"))
 179                        {
 0180                            List<LinkedServiceReference> array = new List<LinkedServiceReference>();
 0181                            foreach (var item in property0.Value.EnumerateArray())
 182                            {
 0183                                array.Add(LinkedServiceReference.DeserializeLinkedServiceReference(item));
 184                            }
 0185                            storageLinkedServices = array;
 0186                            continue;
 187                        }
 0188                        if (property0.NameEquals("arguments"))
 189                        {
 0190                            arguments = property0.Value.GetObject();
 0191                            continue;
 192                        }
 0193                        if (property0.NameEquals("getDebugInfo"))
 194                        {
 0195                            getDebugInfo = new HDInsightActivityDebugInfoOption(property0.Value.GetString());
 0196                            continue;
 197                        }
 0198                        if (property0.NameEquals("scriptPath"))
 199                        {
 0200                            scriptPath = property0.Value.GetObject();
 0201                            continue;
 202                        }
 0203                        if (property0.NameEquals("scriptLinkedService"))
 204                        {
 0205                            scriptLinkedService = LinkedServiceReference.DeserializeLinkedServiceReference(property0.Val
 0206                            continue;
 207                        }
 0208                        if (property0.NameEquals("defines"))
 209                        {
 0210                            Dictionary<string, object> dictionary = new Dictionary<string, object>();
 0211                            foreach (var property1 in property0.Value.EnumerateObject())
 212                            {
 0213                                dictionary.Add(property1.Name, property1.Value.GetObject());
 214                            }
 0215                            defines = dictionary;
 216                            continue;
 217                        }
 218                    }
 219                    continue;
 220                }
 0221                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0222                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 223            }
 0224            additionalProperties = additionalPropertiesDictionary;
 0225            return new HDInsightPigActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(u
 226        }
 227    }
 228}