< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Inputs()-0%100%
get_Outputs()-0%100%
get_Source()-0%100%
get_Sink()-0%100%
get_Translator()-0%100%
get_EnableStaging()-0%100%
get_StagingSettings()-0%100%
get_ParallelCopies()-0%100%
get_DataIntegrationUnits()-0%100%
get_EnableSkipIncompatibleRow()-0%100%
get_RedirectIncompatibleRowSettings()-0%100%
get_PreserveRules()-0%100%
get_Preserve()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeCopyActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\CopyActivity.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> Copy activity. </summary>
 15    public partial class CopyActivity : ExecutionActivity
 16    {
 17        /// <summary> Initializes a new instance of CopyActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <param name="source"> Copy activity source. </param>
 20        /// <param name="sink"> Copy activity sink. </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="name"/>, <paramref name="source"/>, or <paramref na
 022        public CopyActivity(string name, CopySource source, CopySink sink) : base(name)
 23        {
 024            if (name == null)
 25            {
 026                throw new ArgumentNullException(nameof(name));
 27            }
 028            if (source == null)
 29            {
 030                throw new ArgumentNullException(nameof(source));
 31            }
 032            if (sink == null)
 33            {
 034                throw new ArgumentNullException(nameof(sink));
 35            }
 36
 037            Inputs = new ChangeTrackingList<DatasetReference>();
 038            Outputs = new ChangeTrackingList<DatasetReference>();
 039            Source = source;
 040            Sink = sink;
 041            PreserveRules = new ChangeTrackingList<object>();
 042            Preserve = new ChangeTrackingList<object>();
 043            Type = "Copy";
 044        }
 45
 46        /// <summary> Initializes a new instance of CopyActivity. </summary>
 47        /// <param name="name"> Activity name. </param>
 48        /// <param name="type"> Type of activity. </param>
 49        /// <param name="description"> Activity description. </param>
 50        /// <param name="dependsOn"> Activity depends on condition. </param>
 51        /// <param name="userProperties"> Activity user properties. </param>
 52        /// <param name="additionalProperties"> . </param>
 53        /// <param name="linkedServiceName"> Linked service reference. </param>
 54        /// <param name="policy"> Activity policy. </param>
 55        /// <param name="inputs"> List of inputs for the activity. </param>
 56        /// <param name="outputs"> List of outputs for the activity. </param>
 57        /// <param name="source"> Copy activity source. </param>
 58        /// <param name="sink"> Copy activity sink. </param>
 59        /// <param name="translator"> Copy activity translator. If not specified, tabular translator is used. </param>
 60        /// <param name="enableStaging"> Specifies whether to copy data via an interim staging. Default value is false. 
 61        /// <param name="stagingSettings"> Specifies interim staging settings when EnableStaging is true. </param>
 62        /// <param name="parallelCopies"> Maximum number of concurrent sessions opened on the source or sink to avoid ov
 63        /// <param name="dataIntegrationUnits"> Maximum number of data integration units that can be used to perform thi
 64        /// <param name="enableSkipIncompatibleRow"> Whether to skip incompatible row. Default value is false. Type: boo
 65        /// <param name="redirectIncompatibleRowSettings"> Redirect incompatible row settings when EnableSkipIncompatibl
 66        /// <param name="preserveRules"> Preserve Rules. </param>
 67        /// <param name="preserve"> Preserve rules. </param>
 068        internal CopyActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, IList<U
 69        {
 070            Inputs = inputs;
 071            Outputs = outputs;
 072            Source = source;
 073            Sink = sink;
 074            Translator = translator;
 075            EnableStaging = enableStaging;
 076            StagingSettings = stagingSettings;
 077            ParallelCopies = parallelCopies;
 078            DataIntegrationUnits = dataIntegrationUnits;
 079            EnableSkipIncompatibleRow = enableSkipIncompatibleRow;
 080            RedirectIncompatibleRowSettings = redirectIncompatibleRowSettings;
 081            PreserveRules = preserveRules;
 082            Preserve = preserve;
 083            Type = type ?? "Copy";
 084        }
 85
 86        /// <summary> List of inputs for the activity. </summary>
 087        public IList<DatasetReference> Inputs { get; }
 88        /// <summary> List of outputs for the activity. </summary>
 089        public IList<DatasetReference> Outputs { get; }
 90        /// <summary> Copy activity source. </summary>
 091        public CopySource Source { get; set; }
 92        /// <summary> Copy activity sink. </summary>
 093        public CopySink Sink { get; set; }
 94        /// <summary> Copy activity translator. If not specified, tabular translator is used. </summary>
 095        public object Translator { get; set; }
 96        /// <summary> Specifies whether to copy data via an interim staging. Default value is false. Type: boolean (or E
 097        public object EnableStaging { get; set; }
 98        /// <summary> Specifies interim staging settings when EnableStaging is true. </summary>
 099        public StagingSettings StagingSettings { get; set; }
 100        /// <summary> Maximum number of concurrent sessions opened on the source or sink to avoid overloading the data s
 0101        public object ParallelCopies { get; set; }
 102        /// <summary> Maximum number of data integration units that can be used to perform this data movement. Type: int
 0103        public object DataIntegrationUnits { get; set; }
 104        /// <summary> Whether to skip incompatible row. Default value is false. Type: boolean (or Expression with result
 0105        public object EnableSkipIncompatibleRow { get; set; }
 106        /// <summary> Redirect incompatible row settings when EnableSkipIncompatibleRow is true. </summary>
 0107        public RedirectIncompatibleRowSettings RedirectIncompatibleRowSettings { get; set; }
 108        /// <summary> Preserve Rules. </summary>
 0109        public IList<object> PreserveRules { get; }
 110        /// <summary> Preserve rules. </summary>
 0111        public IList<object> Preserve { get; }
 112    }
 113}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\CopyActivity.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 CopyActivity : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsCollectionDefined(Inputs))
 20            {
 021                writer.WritePropertyName("inputs");
 022                writer.WriteStartArray();
 023                foreach (var item in Inputs)
 24                {
 025                    writer.WriteObjectValue(item);
 26                }
 027                writer.WriteEndArray();
 28            }
 029            if (Optional.IsCollectionDefined(Outputs))
 30            {
 031                writer.WritePropertyName("outputs");
 032                writer.WriteStartArray();
 033                foreach (var item in Outputs)
 34                {
 035                    writer.WriteObjectValue(item);
 36                }
 037                writer.WriteEndArray();
 38            }
 039            if (Optional.IsDefined(LinkedServiceName))
 40            {
 041                writer.WritePropertyName("linkedServiceName");
 042                writer.WriteObjectValue(LinkedServiceName);
 43            }
 044            if (Optional.IsDefined(Policy))
 45            {
 046                writer.WritePropertyName("policy");
 047                writer.WriteObjectValue(Policy);
 48            }
 049            writer.WritePropertyName("name");
 050            writer.WriteStringValue(Name);
 051            writer.WritePropertyName("type");
 052            writer.WriteStringValue(Type);
 053            if (Optional.IsDefined(Description))
 54            {
 055                writer.WritePropertyName("description");
 056                writer.WriteStringValue(Description);
 57            }
 058            if (Optional.IsCollectionDefined(DependsOn))
 59            {
 060                writer.WritePropertyName("dependsOn");
 061                writer.WriteStartArray();
 062                foreach (var item in DependsOn)
 63                {
 064                    writer.WriteObjectValue(item);
 65                }
 066                writer.WriteEndArray();
 67            }
 068            if (Optional.IsCollectionDefined(UserProperties))
 69            {
 070                writer.WritePropertyName("userProperties");
 071                writer.WriteStartArray();
 072                foreach (var item in UserProperties)
 73                {
 074                    writer.WriteObjectValue(item);
 75                }
 076                writer.WriteEndArray();
 77            }
 078            writer.WritePropertyName("typeProperties");
 079            writer.WriteStartObject();
 080            writer.WritePropertyName("source");
 081            writer.WriteObjectValue(Source);
 082            writer.WritePropertyName("sink");
 083            writer.WriteObjectValue(Sink);
 084            if (Optional.IsDefined(Translator))
 85            {
 086                writer.WritePropertyName("translator");
 087                writer.WriteObjectValue(Translator);
 88            }
 089            if (Optional.IsDefined(EnableStaging))
 90            {
 091                writer.WritePropertyName("enableStaging");
 092                writer.WriteObjectValue(EnableStaging);
 93            }
 094            if (Optional.IsDefined(StagingSettings))
 95            {
 096                writer.WritePropertyName("stagingSettings");
 097                writer.WriteObjectValue(StagingSettings);
 98            }
 099            if (Optional.IsDefined(ParallelCopies))
 100            {
 0101                writer.WritePropertyName("parallelCopies");
 0102                writer.WriteObjectValue(ParallelCopies);
 103            }
 0104            if (Optional.IsDefined(DataIntegrationUnits))
 105            {
 0106                writer.WritePropertyName("dataIntegrationUnits");
 0107                writer.WriteObjectValue(DataIntegrationUnits);
 108            }
 0109            if (Optional.IsDefined(EnableSkipIncompatibleRow))
 110            {
 0111                writer.WritePropertyName("enableSkipIncompatibleRow");
 0112                writer.WriteObjectValue(EnableSkipIncompatibleRow);
 113            }
 0114            if (Optional.IsDefined(RedirectIncompatibleRowSettings))
 115            {
 0116                writer.WritePropertyName("redirectIncompatibleRowSettings");
 0117                writer.WriteObjectValue(RedirectIncompatibleRowSettings);
 118            }
 0119            if (Optional.IsCollectionDefined(PreserveRules))
 120            {
 0121                writer.WritePropertyName("preserveRules");
 0122                writer.WriteStartArray();
 0123                foreach (var item in PreserveRules)
 124                {
 0125                    writer.WriteObjectValue(item);
 126                }
 0127                writer.WriteEndArray();
 128            }
 0129            if (Optional.IsCollectionDefined(Preserve))
 130            {
 0131                writer.WritePropertyName("preserve");
 0132                writer.WriteStartArray();
 0133                foreach (var item in Preserve)
 134                {
 0135                    writer.WriteObjectValue(item);
 136                }
 0137                writer.WriteEndArray();
 138            }
 0139            writer.WriteEndObject();
 0140            foreach (var item in AdditionalProperties)
 141            {
 0142                writer.WritePropertyName(item.Key);
 0143                writer.WriteObjectValue(item.Value);
 144            }
 0145            writer.WriteEndObject();
 0146        }
 147
 148        internal static CopyActivity DeserializeCopyActivity(JsonElement element)
 149        {
 0150            Optional<IList<DatasetReference>> inputs = default;
 0151            Optional<IList<DatasetReference>> outputs = default;
 0152            Optional<LinkedServiceReference> linkedServiceName = default;
 0153            Optional<ActivityPolicy> policy = default;
 0154            string name = default;
 0155            string type = default;
 0156            Optional<string> description = default;
 0157            Optional<IList<ActivityDependency>> dependsOn = default;
 0158            Optional<IList<UserProperty>> userProperties = default;
 0159            CopySource source = default;
 0160            CopySink sink = default;
 0161            Optional<object> translator = default;
 0162            Optional<object> enableStaging = default;
 0163            Optional<StagingSettings> stagingSettings = default;
 0164            Optional<object> parallelCopies = default;
 0165            Optional<object> dataIntegrationUnits = default;
 0166            Optional<object> enableSkipIncompatibleRow = default;
 0167            Optional<RedirectIncompatibleRowSettings> redirectIncompatibleRowSettings = default;
 0168            Optional<IList<object>> preserveRules = default;
 0169            Optional<IList<object>> preserve = default;
 0170            IDictionary<string, object> additionalProperties = default;
 0171            Dictionary<string, object> additionalPropertiesDictionary = default;
 0172            foreach (var property in element.EnumerateObject())
 173            {
 0174                if (property.NameEquals("inputs"))
 175                {
 0176                    List<DatasetReference> array = new List<DatasetReference>();
 0177                    foreach (var item in property.Value.EnumerateArray())
 178                    {
 0179                        array.Add(DatasetReference.DeserializeDatasetReference(item));
 180                    }
 0181                    inputs = array;
 0182                    continue;
 183                }
 0184                if (property.NameEquals("outputs"))
 185                {
 0186                    List<DatasetReference> array = new List<DatasetReference>();
 0187                    foreach (var item in property.Value.EnumerateArray())
 188                    {
 0189                        array.Add(DatasetReference.DeserializeDatasetReference(item));
 190                    }
 0191                    outputs = array;
 0192                    continue;
 193                }
 0194                if (property.NameEquals("linkedServiceName"))
 195                {
 0196                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 0197                    continue;
 198                }
 0199                if (property.NameEquals("policy"))
 200                {
 0201                    policy = ActivityPolicy.DeserializeActivityPolicy(property.Value);
 0202                    continue;
 203                }
 0204                if (property.NameEquals("name"))
 205                {
 0206                    name = property.Value.GetString();
 0207                    continue;
 208                }
 0209                if (property.NameEquals("type"))
 210                {
 0211                    type = property.Value.GetString();
 0212                    continue;
 213                }
 0214                if (property.NameEquals("description"))
 215                {
 0216                    description = property.Value.GetString();
 0217                    continue;
 218                }
 0219                if (property.NameEquals("dependsOn"))
 220                {
 0221                    List<ActivityDependency> array = new List<ActivityDependency>();
 0222                    foreach (var item in property.Value.EnumerateArray())
 223                    {
 0224                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 225                    }
 0226                    dependsOn = array;
 0227                    continue;
 228                }
 0229                if (property.NameEquals("userProperties"))
 230                {
 0231                    List<UserProperty> array = new List<UserProperty>();
 0232                    foreach (var item in property.Value.EnumerateArray())
 233                    {
 0234                        array.Add(UserProperty.DeserializeUserProperty(item));
 235                    }
 0236                    userProperties = array;
 0237                    continue;
 238                }
 0239                if (property.NameEquals("typeProperties"))
 240                {
 0241                    foreach (var property0 in property.Value.EnumerateObject())
 242                    {
 0243                        if (property0.NameEquals("source"))
 244                        {
 0245                            source = CopySource.DeserializeCopySource(property0.Value);
 0246                            continue;
 247                        }
 0248                        if (property0.NameEquals("sink"))
 249                        {
 0250                            sink = CopySink.DeserializeCopySink(property0.Value);
 0251                            continue;
 252                        }
 0253                        if (property0.NameEquals("translator"))
 254                        {
 0255                            translator = property0.Value.GetObject();
 0256                            continue;
 257                        }
 0258                        if (property0.NameEquals("enableStaging"))
 259                        {
 0260                            enableStaging = property0.Value.GetObject();
 0261                            continue;
 262                        }
 0263                        if (property0.NameEquals("stagingSettings"))
 264                        {
 0265                            stagingSettings = StagingSettings.DeserializeStagingSettings(property0.Value);
 0266                            continue;
 267                        }
 0268                        if (property0.NameEquals("parallelCopies"))
 269                        {
 0270                            parallelCopies = property0.Value.GetObject();
 0271                            continue;
 272                        }
 0273                        if (property0.NameEquals("dataIntegrationUnits"))
 274                        {
 0275                            dataIntegrationUnits = property0.Value.GetObject();
 0276                            continue;
 277                        }
 0278                        if (property0.NameEquals("enableSkipIncompatibleRow"))
 279                        {
 0280                            enableSkipIncompatibleRow = property0.Value.GetObject();
 0281                            continue;
 282                        }
 0283                        if (property0.NameEquals("redirectIncompatibleRowSettings"))
 284                        {
 0285                            redirectIncompatibleRowSettings = RedirectIncompatibleRowSettings.DeserializeRedirectIncompa
 0286                            continue;
 287                        }
 0288                        if (property0.NameEquals("preserveRules"))
 289                        {
 0290                            List<object> array = new List<object>();
 0291                            foreach (var item in property0.Value.EnumerateArray())
 292                            {
 0293                                array.Add(item.GetObject());
 294                            }
 0295                            preserveRules = array;
 0296                            continue;
 297                        }
 0298                        if (property0.NameEquals("preserve"))
 299                        {
 0300                            List<object> array = new List<object>();
 0301                            foreach (var item in property0.Value.EnumerateArray())
 302                            {
 0303                                array.Add(item.GetObject());
 304                            }
 0305                            preserve = array;
 306                            continue;
 307                        }
 308                    }
 309                    continue;
 310                }
 0311                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0312                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 313            }
 0314            additionalProperties = additionalPropertiesDictionary;
 0315            return new CopyActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userPrope
 316        }
 317    }
 318}