< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.GetMetadataActivity
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\GetMetadataActivity.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\GetMetadataActivity.Serialization.cs
Covered lines:0
Uncovered lines:111
Coverable lines:111
Total lines:230
Line coverage:0% (0 of 111)
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_Dataset()-0%100%
get_FieldList()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeGetMetadataActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\GetMetadataActivity.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> Activity to get metadata of dataset. </summary>
 15    public partial class GetMetadataActivity : ExecutionActivity
 16    {
 17        /// <summary> Initializes a new instance of GetMetadataActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <param name="dataset"> GetMetadata activity dataset reference. </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="dataset"/> is null. </ex
 021        public GetMetadataActivity(string name, DatasetReference dataset) : base(name)
 22        {
 023            if (name == null)
 24            {
 025                throw new ArgumentNullException(nameof(name));
 26            }
 027            if (dataset == null)
 28            {
 029                throw new ArgumentNullException(nameof(dataset));
 30            }
 31
 032            Dataset = dataset;
 033            FieldList = new ChangeTrackingList<object>();
 034            Type = "GetMetadata";
 035        }
 36
 37        /// <summary> Initializes a new instance of GetMetadataActivity. </summary>
 38        /// <param name="name"> Activity name. </param>
 39        /// <param name="type"> Type of activity. </param>
 40        /// <param name="description"> Activity description. </param>
 41        /// <param name="dependsOn"> Activity depends on condition. </param>
 42        /// <param name="userProperties"> Activity user properties. </param>
 43        /// <param name="additionalProperties"> . </param>
 44        /// <param name="linkedServiceName"> Linked service reference. </param>
 45        /// <param name="policy"> Activity policy. </param>
 46        /// <param name="dataset"> GetMetadata activity dataset reference. </param>
 47        /// <param name="fieldList"> Fields of metadata to get from dataset. </param>
 048        internal GetMetadataActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, 
 49        {
 050            Dataset = dataset;
 051            FieldList = fieldList;
 052            Type = type ?? "GetMetadata";
 053        }
 54
 55        /// <summary> GetMetadata activity dataset reference. </summary>
 056        public DatasetReference Dataset { get; set; }
 57        /// <summary> Fields of metadata to get from dataset. </summary>
 058        public IList<object> FieldList { get; }
 59    }
 60}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\GetMetadataActivity.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 GetMetadataActivity : 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("dataset");
 061            writer.WriteObjectValue(Dataset);
 062            if (Optional.IsCollectionDefined(FieldList))
 63            {
 064                writer.WritePropertyName("fieldList");
 065                writer.WriteStartArray();
 066                foreach (var item in FieldList)
 67                {
 068                    writer.WriteObjectValue(item);
 69                }
 070                writer.WriteEndArray();
 71            }
 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 GetMetadataActivity DeserializeGetMetadataActivity(JsonElement element)
 82        {
 083            Optional<LinkedServiceReference> linkedServiceName = default;
 084            Optional<ActivityPolicy> policy = default;
 085            string name = default;
 086            string type = default;
 087            Optional<string> description = default;
 088            Optional<IList<ActivityDependency>> dependsOn = default;
 089            Optional<IList<UserProperty>> userProperties = default;
 090            DatasetReference dataset = default;
 091            Optional<IList<object>> fieldList = default;
 092            IDictionary<string, object> additionalProperties = default;
 093            Dictionary<string, object> additionalPropertiesDictionary = default;
 094            foreach (var property in element.EnumerateObject())
 95            {
 096                if (property.NameEquals("linkedServiceName"))
 97                {
 098                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 099                    continue;
 100                }
 0101                if (property.NameEquals("policy"))
 102                {
 0103                    policy = ActivityPolicy.DeserializeActivityPolicy(property.Value);
 0104                    continue;
 105                }
 0106                if (property.NameEquals("name"))
 107                {
 0108                    name = property.Value.GetString();
 0109                    continue;
 110                }
 0111                if (property.NameEquals("type"))
 112                {
 0113                    type = property.Value.GetString();
 0114                    continue;
 115                }
 0116                if (property.NameEquals("description"))
 117                {
 0118                    description = property.Value.GetString();
 0119                    continue;
 120                }
 0121                if (property.NameEquals("dependsOn"))
 122                {
 0123                    List<ActivityDependency> array = new List<ActivityDependency>();
 0124                    foreach (var item in property.Value.EnumerateArray())
 125                    {
 0126                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 127                    }
 0128                    dependsOn = array;
 0129                    continue;
 130                }
 0131                if (property.NameEquals("userProperties"))
 132                {
 0133                    List<UserProperty> array = new List<UserProperty>();
 0134                    foreach (var item in property.Value.EnumerateArray())
 135                    {
 0136                        array.Add(UserProperty.DeserializeUserProperty(item));
 137                    }
 0138                    userProperties = array;
 0139                    continue;
 140                }
 0141                if (property.NameEquals("typeProperties"))
 142                {
 0143                    foreach (var property0 in property.Value.EnumerateObject())
 144                    {
 0145                        if (property0.NameEquals("dataset"))
 146                        {
 0147                            dataset = DatasetReference.DeserializeDatasetReference(property0.Value);
 0148                            continue;
 149                        }
 0150                        if (property0.NameEquals("fieldList"))
 151                        {
 0152                            List<object> array = new List<object>();
 0153                            foreach (var item in property0.Value.EnumerateArray())
 154                            {
 0155                                array.Add(item.GetObject());
 156                            }
 0157                            fieldList = array;
 158                            continue;
 159                        }
 160                    }
 161                    continue;
 162                }
 0163                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0164                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 165            }
 0166            additionalProperties = additionalPropertiesDictionary;
 0167            return new GetMetadataActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(us
 168        }
 169    }
 170}