< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Timeout()-0%100%
get_Sleep()-0%100%
get_MinimumSize()-0%100%
get_ChildItems()-0%100%
get_Dataset()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeValidationActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ValidationActivity.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;
 10
 11namespace Azure.Analytics.Synapse.Artifacts.Models
 12{
 13    /// <summary> This activity verifies that an external resource exists. </summary>
 14    public partial class ValidationActivity : Activity
 15    {
 16        /// <summary> Initializes a new instance of ValidationActivity. </summary>
 17        /// <param name="name"> Activity name. </param>
 18        /// <param name="dataset"> Validation activity dataset reference. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="dataset"/> is null. </ex
 020        public ValidationActivity(string name, DatasetReference dataset) : base(name)
 21        {
 022            if (name == null)
 23            {
 024                throw new ArgumentNullException(nameof(name));
 25            }
 026            if (dataset == null)
 27            {
 028                throw new ArgumentNullException(nameof(dataset));
 29            }
 30
 031            Dataset = dataset;
 032            Type = "Validation";
 033        }
 34
 35        /// <summary> Initializes a new instance of ValidationActivity. </summary>
 36        /// <param name="name"> Activity name. </param>
 37        /// <param name="type"> Type of activity. </param>
 38        /// <param name="description"> Activity description. </param>
 39        /// <param name="dependsOn"> Activity depends on condition. </param>
 40        /// <param name="userProperties"> Activity user properties. </param>
 41        /// <param name="additionalProperties"> . </param>
 42        /// <param name="timeout"> Specifies the timeout for the activity to run. If there is no value specified, it tak
 43        /// <param name="sleep"> A delay in seconds between validation attempts. If no value is specified, 10 seconds wi
 44        /// <param name="minimumSize"> Can be used if dataset points to a file. The file must be greater than or equal i
 45        /// <param name="childItems"> Can be used if dataset points to a folder. If set to true, the folder must have at
 46        /// <param name="dataset"> Validation activity dataset reference. </param>
 047        internal ValidationActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, I
 48        {
 049            Timeout = timeout;
 050            Sleep = sleep;
 051            MinimumSize = minimumSize;
 052            ChildItems = childItems;
 053            Dataset = dataset;
 054            Type = type ?? "Validation";
 055        }
 56
 57        /// <summary> Specifies the timeout for the activity to run. If there is no value specified, it takes the value 
 058        public object Timeout { get; set; }
 59        /// <summary> A delay in seconds between validation attempts. If no value is specified, 10 seconds will be used 
 060        public object Sleep { get; set; }
 61        /// <summary> Can be used if dataset points to a file. The file must be greater than or equal in size to the val
 062        public object MinimumSize { get; set; }
 63        /// <summary> Can be used if dataset points to a folder. If set to true, the folder must have at least one file.
 064        public object ChildItems { get; set; }
 65        /// <summary> Validation activity dataset reference. </summary>
 066        public DatasetReference Dataset { get; set; }
 67    }
 68}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ValidationActivity.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 ValidationActivity : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("name");
 020            writer.WriteStringValue(Name);
 021            writer.WritePropertyName("type");
 022            writer.WriteStringValue(Type);
 023            if (Optional.IsDefined(Description))
 24            {
 025                writer.WritePropertyName("description");
 026                writer.WriteStringValue(Description);
 27            }
 028            if (Optional.IsCollectionDefined(DependsOn))
 29            {
 030                writer.WritePropertyName("dependsOn");
 031                writer.WriteStartArray();
 032                foreach (var item in DependsOn)
 33                {
 034                    writer.WriteObjectValue(item);
 35                }
 036                writer.WriteEndArray();
 37            }
 038            if (Optional.IsCollectionDefined(UserProperties))
 39            {
 040                writer.WritePropertyName("userProperties");
 041                writer.WriteStartArray();
 042                foreach (var item in UserProperties)
 43                {
 044                    writer.WriteObjectValue(item);
 45                }
 046                writer.WriteEndArray();
 47            }
 048            writer.WritePropertyName("typeProperties");
 049            writer.WriteStartObject();
 050            if (Optional.IsDefined(Timeout))
 51            {
 052                writer.WritePropertyName("timeout");
 053                writer.WriteObjectValue(Timeout);
 54            }
 055            if (Optional.IsDefined(Sleep))
 56            {
 057                writer.WritePropertyName("sleep");
 058                writer.WriteObjectValue(Sleep);
 59            }
 060            if (Optional.IsDefined(MinimumSize))
 61            {
 062                writer.WritePropertyName("minimumSize");
 063                writer.WriteObjectValue(MinimumSize);
 64            }
 065            if (Optional.IsDefined(ChildItems))
 66            {
 067                writer.WritePropertyName("childItems");
 068                writer.WriteObjectValue(ChildItems);
 69            }
 070            writer.WritePropertyName("dataset");
 071            writer.WriteObjectValue(Dataset);
 072            writer.WriteEndObject();
 073            foreach (var item in AdditionalProperties)
 74            {
 075                writer.WritePropertyName(item.Key);
 076                writer.WriteObjectValue(item.Value);
 77            }
 078            writer.WriteEndObject();
 079        }
 80
 81        internal static ValidationActivity DeserializeValidationActivity(JsonElement element)
 82        {
 083            string name = default;
 084            string type = default;
 085            Optional<string> description = default;
 086            Optional<IList<ActivityDependency>> dependsOn = default;
 087            Optional<IList<UserProperty>> userProperties = default;
 088            Optional<object> timeout = default;
 089            Optional<object> sleep = default;
 090            Optional<object> minimumSize = default;
 091            Optional<object> childItems = default;
 092            DatasetReference dataset = default;
 093            IDictionary<string, object> additionalProperties = default;
 094            Dictionary<string, object> additionalPropertiesDictionary = default;
 095            foreach (var property in element.EnumerateObject())
 96            {
 097                if (property.NameEquals("name"))
 98                {
 099                    name = property.Value.GetString();
 0100                    continue;
 101                }
 0102                if (property.NameEquals("type"))
 103                {
 0104                    type = property.Value.GetString();
 0105                    continue;
 106                }
 0107                if (property.NameEquals("description"))
 108                {
 0109                    description = property.Value.GetString();
 0110                    continue;
 111                }
 0112                if (property.NameEquals("dependsOn"))
 113                {
 0114                    List<ActivityDependency> array = new List<ActivityDependency>();
 0115                    foreach (var item in property.Value.EnumerateArray())
 116                    {
 0117                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 118                    }
 0119                    dependsOn = array;
 0120                    continue;
 121                }
 0122                if (property.NameEquals("userProperties"))
 123                {
 0124                    List<UserProperty> array = new List<UserProperty>();
 0125                    foreach (var item in property.Value.EnumerateArray())
 126                    {
 0127                        array.Add(UserProperty.DeserializeUserProperty(item));
 128                    }
 0129                    userProperties = array;
 0130                    continue;
 131                }
 0132                if (property.NameEquals("typeProperties"))
 133                {
 0134                    foreach (var property0 in property.Value.EnumerateObject())
 135                    {
 0136                        if (property0.NameEquals("timeout"))
 137                        {
 0138                            timeout = property0.Value.GetObject();
 0139                            continue;
 140                        }
 0141                        if (property0.NameEquals("sleep"))
 142                        {
 0143                            sleep = property0.Value.GetObject();
 0144                            continue;
 145                        }
 0146                        if (property0.NameEquals("minimumSize"))
 147                        {
 0148                            minimumSize = property0.Value.GetObject();
 0149                            continue;
 150                        }
 0151                        if (property0.NameEquals("childItems"))
 152                        {
 0153                            childItems = property0.Value.GetObject();
 0154                            continue;
 155                        }
 0156                        if (property0.NameEquals("dataset"))
 157                        {
 0158                            dataset = DatasetReference.DeserializeDatasetReference(property0.Value);
 159                            continue;
 160                        }
 161                    }
 162                    continue;
 163                }
 0164                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0165                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 166            }
 0167            additionalProperties = additionalPropertiesDictionary;
 0168            return new ValidationActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(use
 169        }
 170    }
 171}