< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Method()-0%100%
get_Url()-0%100%
get_Timeout()-0%100%
get_Headers()-0%100%
get_Body()-0%100%
get_Authentication()-0%100%
get_ReportStatusOnCallBack()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeWebHookActivity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\WebHookActivity.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> WebHook activity. </summary>
 14    public partial class WebHookActivity : Activity
 15    {
 16        /// <summary> Initializes a new instance of WebHookActivity. </summary>
 17        /// <param name="name"> Activity name. </param>
 18        /// <param name="method"> Rest API method for target endpoint. </param>
 19        /// <param name="url"> WebHook activity target endpoint and path. Type: string (or Expression with resultType st
 20        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="url"/> is null. </except
 021        public WebHookActivity(string name, WebHookActivityMethod method, object url) : base(name)
 22        {
 023            if (name == null)
 24            {
 025                throw new ArgumentNullException(nameof(name));
 26            }
 027            if (url == null)
 28            {
 029                throw new ArgumentNullException(nameof(url));
 30            }
 31
 032            Method = method;
 033            Url = url;
 034            Type = "WebHook";
 035        }
 36
 37        /// <summary> Initializes a new instance of WebHookActivity. </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="method"> Rest API method for target endpoint. </param>
 45        /// <param name="url"> WebHook activity target endpoint and path. Type: string (or Expression with resultType st
 46        /// <param name="timeout"> The timeout within which the webhook should be called back. If there is no value spec
 47        /// <param name="headers"> Represents the headers that will be sent to the request. For example, to set the lang
 48        /// <param name="body"> Represents the payload that will be sent to the endpoint. Required for POST/PUT method, 
 49        /// <param name="authentication"> Authentication method used for calling the endpoint. </param>
 50        /// <param name="reportStatusOnCallBack"> When set to true, statusCode, output and error in callback request bod
 051        internal WebHookActivity(string name, string type, string description, IList<ActivityDependency> dependsOn, ILis
 52        {
 053            Method = method;
 054            Url = url;
 055            Timeout = timeout;
 056            Headers = headers;
 057            Body = body;
 058            Authentication = authentication;
 059            ReportStatusOnCallBack = reportStatusOnCallBack;
 060            Type = type ?? "WebHook";
 061        }
 62
 63        /// <summary> Rest API method for target endpoint. </summary>
 064        public WebHookActivityMethod Method { get; set; }
 65        /// <summary> WebHook activity target endpoint and path. Type: string (or Expression with resultType string). </
 066        public object Url { get; set; }
 67        /// <summary> The timeout within which the webhook should be called back. If there is no value specified, it def
 068        public string Timeout { get; set; }
 69        /// <summary> Represents the headers that will be sent to the request. For example, to set the language and type
 070        public object Headers { get; set; }
 71        /// <summary> Represents the payload that will be sent to the endpoint. Required for POST/PUT method, not allowe
 072        public object Body { get; set; }
 73        /// <summary> Authentication method used for calling the endpoint. </summary>
 074        public WebActivityAuthentication Authentication { get; set; }
 75        /// <summary> When set to true, statusCode, output and error in callback request body will be consumed by activi
 076        public object ReportStatusOnCallBack { get; set; }
 77    }
 78}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\WebHookActivity.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 WebHookActivity : 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            writer.WritePropertyName("method");
 051            writer.WriteStringValue(Method.ToString());
 052            writer.WritePropertyName("url");
 053            writer.WriteObjectValue(Url);
 054            if (Optional.IsDefined(Timeout))
 55            {
 056                writer.WritePropertyName("timeout");
 057                writer.WriteStringValue(Timeout);
 58            }
 059            if (Optional.IsDefined(Headers))
 60            {
 061                writer.WritePropertyName("headers");
 062                writer.WriteObjectValue(Headers);
 63            }
 064            if (Optional.IsDefined(Body))
 65            {
 066                writer.WritePropertyName("body");
 067                writer.WriteObjectValue(Body);
 68            }
 069            if (Optional.IsDefined(Authentication))
 70            {
 071                writer.WritePropertyName("authentication");
 072                writer.WriteObjectValue(Authentication);
 73            }
 074            if (Optional.IsDefined(ReportStatusOnCallBack))
 75            {
 076                writer.WritePropertyName("reportStatusOnCallBack");
 077                writer.WriteObjectValue(ReportStatusOnCallBack);
 78            }
 079            writer.WriteEndObject();
 080            foreach (var item in AdditionalProperties)
 81            {
 082                writer.WritePropertyName(item.Key);
 083                writer.WriteObjectValue(item.Value);
 84            }
 085            writer.WriteEndObject();
 086        }
 87
 88        internal static WebHookActivity DeserializeWebHookActivity(JsonElement element)
 89        {
 090            string name = default;
 091            string type = default;
 092            Optional<string> description = default;
 093            Optional<IList<ActivityDependency>> dependsOn = default;
 094            Optional<IList<UserProperty>> userProperties = default;
 095            WebHookActivityMethod method = default;
 096            object url = default;
 097            Optional<string> timeout = default;
 098            Optional<object> headers = default;
 099            Optional<object> body = default;
 0100            Optional<WebActivityAuthentication> authentication = default;
 0101            Optional<object> reportStatusOnCallBack = default;
 0102            IDictionary<string, object> additionalProperties = default;
 0103            Dictionary<string, object> additionalPropertiesDictionary = default;
 0104            foreach (var property in element.EnumerateObject())
 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("method"))
 146                        {
 0147                            method = new WebHookActivityMethod(property0.Value.GetString());
 0148                            continue;
 149                        }
 0150                        if (property0.NameEquals("url"))
 151                        {
 0152                            url = property0.Value.GetObject();
 0153                            continue;
 154                        }
 0155                        if (property0.NameEquals("timeout"))
 156                        {
 0157                            timeout = property0.Value.GetString();
 0158                            continue;
 159                        }
 0160                        if (property0.NameEquals("headers"))
 161                        {
 0162                            headers = property0.Value.GetObject();
 0163                            continue;
 164                        }
 0165                        if (property0.NameEquals("body"))
 166                        {
 0167                            body = property0.Value.GetObject();
 0168                            continue;
 169                        }
 0170                        if (property0.NameEquals("authentication"))
 171                        {
 0172                            authentication = WebActivityAuthentication.DeserializeWebActivityAuthentication(property0.Va
 0173                            continue;
 174                        }
 0175                        if (property0.NameEquals("reportStatusOnCallBack"))
 176                        {
 0177                            reportStatusOnCallBack = property0.Value.GetObject();
 178                            continue;
 179                        }
 180                    }
 181                    continue;
 182                }
 0183                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0184                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 185            }
 0186            additionalProperties = additionalPropertiesDictionary;
 0187            return new WebHookActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userPr
 188        }
 189    }
 190}