< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Method()-0%100%
get_Url()-0%100%
get_Headers()-0%100%
get_Body()-0%100%
get_Authentication()-0%100%
get_Datasets()-0%100%
get_LinkedServices()-0%100%
get_ConnectVia()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeWebActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\WebActivity.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> Web activity. </summary>
 15    public partial class WebActivity : ExecutionActivity
 16    {
 17        /// <summary> Initializes a new instance of WebActivity. </summary>
 18        /// <param name="name"> Activity name. </param>
 19        /// <param name="method"> Rest API method for target endpoint. </param>
 20        /// <param name="url"> Web activity target endpoint and path. Type: string (or Expression with resultType string
 21        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="url"/> is null. </except
 022        public WebActivity(string name, WebActivityMethod method, object url) : base(name)
 23        {
 024            if (name == null)
 25            {
 026                throw new ArgumentNullException(nameof(name));
 27            }
 028            if (url == null)
 29            {
 030                throw new ArgumentNullException(nameof(url));
 31            }
 32
 033            Method = method;
 034            Url = url;
 035            Datasets = new ChangeTrackingList<DatasetReference>();
 036            LinkedServices = new ChangeTrackingList<LinkedServiceReference>();
 037            Type = "WebActivity";
 038        }
 39
 40        /// <summary> Initializes a new instance of WebActivity. </summary>
 41        /// <param name="name"> Activity name. </param>
 42        /// <param name="type"> Type of activity. </param>
 43        /// <param name="description"> Activity description. </param>
 44        /// <param name="dependsOn"> Activity depends on condition. </param>
 45        /// <param name="userProperties"> Activity user properties. </param>
 46        /// <param name="additionalProperties"> . </param>
 47        /// <param name="linkedServiceName"> Linked service reference. </param>
 48        /// <param name="policy"> Activity policy. </param>
 49        /// <param name="method"> Rest API method for target endpoint. </param>
 50        /// <param name="url"> Web activity target endpoint and path. Type: string (or Expression with resultType string
 51        /// <param name="headers"> Represents the headers that will be sent to the request. For example, to set the lang
 52        /// <param name="body"> Represents the payload that will be sent to the endpoint. Required for POST/PUT method, 
 53        /// <param name="authentication"> Authentication method used for calling the endpoint. </param>
 54        /// <param name="datasets"> List of datasets passed to web endpoint. </param>
 55        /// <param name="linkedServices"> List of linked services passed to web endpoint. </param>
 56        /// <param name="connectVia"> The integration runtime reference. </param>
 057        internal WebActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, IList<Us
 58        {
 059            Method = method;
 060            Url = url;
 061            Headers = headers;
 062            Body = body;
 063            Authentication = authentication;
 064            Datasets = datasets;
 065            LinkedServices = linkedServices;
 066            ConnectVia = connectVia;
 067            Type = type ?? "WebActivity";
 068        }
 69
 70        /// <summary> Rest API method for target endpoint. </summary>
 071        public WebActivityMethod Method { get; set; }
 72        /// <summary> Web activity target endpoint and path. Type: string (or Expression with resultType string). </summ
 073        public object Url { get; set; }
 74        /// <summary> Represents the headers that will be sent to the request. For example, to set the language and type
 075        public object Headers { get; set; }
 76        /// <summary> Represents the payload that will be sent to the endpoint. Required for POST/PUT method, not allowe
 077        public object Body { get; set; }
 78        /// <summary> Authentication method used for calling the endpoint. </summary>
 079        public WebActivityAuthentication Authentication { get; set; }
 80        /// <summary> List of datasets passed to web endpoint. </summary>
 081        public IList<DatasetReference> Datasets { get; }
 82        /// <summary> List of linked services passed to web endpoint. </summary>
 083        public IList<LinkedServiceReference> LinkedServices { get; }
 84        /// <summary> The integration runtime reference. </summary>
 085        public IntegrationRuntimeReference ConnectVia { get; set; }
 86    }
 87}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\WebActivity.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 WebActivity : 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("method");
 061            writer.WriteStringValue(Method.ToString());
 062            writer.WritePropertyName("url");
 063            writer.WriteObjectValue(Url);
 064            if (Optional.IsDefined(Headers))
 65            {
 066                writer.WritePropertyName("headers");
 067                writer.WriteObjectValue(Headers);
 68            }
 069            if (Optional.IsDefined(Body))
 70            {
 071                writer.WritePropertyName("body");
 072                writer.WriteObjectValue(Body);
 73            }
 074            if (Optional.IsDefined(Authentication))
 75            {
 076                writer.WritePropertyName("authentication");
 077                writer.WriteObjectValue(Authentication);
 78            }
 079            if (Optional.IsCollectionDefined(Datasets))
 80            {
 081                writer.WritePropertyName("datasets");
 082                writer.WriteStartArray();
 083                foreach (var item in Datasets)
 84                {
 085                    writer.WriteObjectValue(item);
 86                }
 087                writer.WriteEndArray();
 88            }
 089            if (Optional.IsCollectionDefined(LinkedServices))
 90            {
 091                writer.WritePropertyName("linkedServices");
 092                writer.WriteStartArray();
 093                foreach (var item in LinkedServices)
 94                {
 095                    writer.WriteObjectValue(item);
 96                }
 097                writer.WriteEndArray();
 98            }
 099            if (Optional.IsDefined(ConnectVia))
 100            {
 0101                writer.WritePropertyName("connectVia");
 0102                writer.WriteObjectValue(ConnectVia);
 103            }
 0104            writer.WriteEndObject();
 0105            foreach (var item in AdditionalProperties)
 106            {
 0107                writer.WritePropertyName(item.Key);
 0108                writer.WriteObjectValue(item.Value);
 109            }
 0110            writer.WriteEndObject();
 0111        }
 112
 113        internal static WebActivity DeserializeWebActivity(JsonElement element)
 114        {
 0115            Optional<LinkedServiceReference> linkedServiceName = default;
 0116            Optional<ActivityPolicy> policy = default;
 0117            string name = default;
 0118            string type = default;
 0119            Optional<string> description = default;
 0120            Optional<IList<ActivityDependency>> dependsOn = default;
 0121            Optional<IList<UserProperty>> userProperties = default;
 0122            WebActivityMethod method = default;
 0123            object url = default;
 0124            Optional<object> headers = default;
 0125            Optional<object> body = default;
 0126            Optional<WebActivityAuthentication> authentication = default;
 0127            Optional<IList<DatasetReference>> datasets = default;
 0128            Optional<IList<LinkedServiceReference>> linkedServices = default;
 0129            Optional<IntegrationRuntimeReference> connectVia = default;
 0130            IDictionary<string, object> additionalProperties = default;
 0131            Dictionary<string, object> additionalPropertiesDictionary = default;
 0132            foreach (var property in element.EnumerateObject())
 133            {
 0134                if (property.NameEquals("linkedServiceName"))
 135                {
 0136                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 0137                    continue;
 138                }
 0139                if (property.NameEquals("policy"))
 140                {
 0141                    policy = ActivityPolicy.DeserializeActivityPolicy(property.Value);
 0142                    continue;
 143                }
 0144                if (property.NameEquals("name"))
 145                {
 0146                    name = property.Value.GetString();
 0147                    continue;
 148                }
 0149                if (property.NameEquals("type"))
 150                {
 0151                    type = property.Value.GetString();
 0152                    continue;
 153                }
 0154                if (property.NameEquals("description"))
 155                {
 0156                    description = property.Value.GetString();
 0157                    continue;
 158                }
 0159                if (property.NameEquals("dependsOn"))
 160                {
 0161                    List<ActivityDependency> array = new List<ActivityDependency>();
 0162                    foreach (var item in property.Value.EnumerateArray())
 163                    {
 0164                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
 165                    }
 0166                    dependsOn = array;
 0167                    continue;
 168                }
 0169                if (property.NameEquals("userProperties"))
 170                {
 0171                    List<UserProperty> array = new List<UserProperty>();
 0172                    foreach (var item in property.Value.EnumerateArray())
 173                    {
 0174                        array.Add(UserProperty.DeserializeUserProperty(item));
 175                    }
 0176                    userProperties = array;
 0177                    continue;
 178                }
 0179                if (property.NameEquals("typeProperties"))
 180                {
 0181                    foreach (var property0 in property.Value.EnumerateObject())
 182                    {
 0183                        if (property0.NameEquals("method"))
 184                        {
 0185                            method = new WebActivityMethod(property0.Value.GetString());
 0186                            continue;
 187                        }
 0188                        if (property0.NameEquals("url"))
 189                        {
 0190                            url = property0.Value.GetObject();
 0191                            continue;
 192                        }
 0193                        if (property0.NameEquals("headers"))
 194                        {
 0195                            headers = property0.Value.GetObject();
 0196                            continue;
 197                        }
 0198                        if (property0.NameEquals("body"))
 199                        {
 0200                            body = property0.Value.GetObject();
 0201                            continue;
 202                        }
 0203                        if (property0.NameEquals("authentication"))
 204                        {
 0205                            authentication = WebActivityAuthentication.DeserializeWebActivityAuthentication(property0.Va
 0206                            continue;
 207                        }
 0208                        if (property0.NameEquals("datasets"))
 209                        {
 0210                            List<DatasetReference> array = new List<DatasetReference>();
 0211                            foreach (var item in property0.Value.EnumerateArray())
 212                            {
 0213                                array.Add(DatasetReference.DeserializeDatasetReference(item));
 214                            }
 0215                            datasets = array;
 0216                            continue;
 217                        }
 0218                        if (property0.NameEquals("linkedServices"))
 219                        {
 0220                            List<LinkedServiceReference> array = new List<LinkedServiceReference>();
 0221                            foreach (var item in property0.Value.EnumerateArray())
 222                            {
 0223                                array.Add(LinkedServiceReference.DeserializeLinkedServiceReference(item));
 224                            }
 0225                            linkedServices = array;
 0226                            continue;
 227                        }
 0228                        if (property0.NameEquals("connectVia"))
 229                        {
 0230                            connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property0.Va
 231                            continue;
 232                        }
 233                    }
 234                    continue;
 235                }
 0236                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0237                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 238            }
 0239            additionalProperties = additionalPropertiesDictionary;
 0240            return new WebActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userProper
 241        }
 242    }
 243}