< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Name()-0%100%
get_Uri()-0%100%
get_Roles()-0%100%
get_Parameters()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeScriptAction(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ScriptAction.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;
 9
 10namespace Azure.Analytics.Synapse.Artifacts.Models
 11{
 12    /// <summary> Custom script action to run on HDI ondemand cluster once it&apos;s up. </summary>
 13    public partial class ScriptAction
 14    {
 15        /// <summary> Initializes a new instance of ScriptAction. </summary>
 16        /// <param name="name"> The user provided name of the script action. </param>
 17        /// <param name="uri"> The URI for the script action. </param>
 18        /// <param name="roles"> The node types on which the script action should be executed. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="uri"/> is null. </except
 020        public ScriptAction(string name, string uri, HdiNodeTypes roles)
 21        {
 022            if (name == null)
 23            {
 024                throw new ArgumentNullException(nameof(name));
 25            }
 026            if (uri == null)
 27            {
 028                throw new ArgumentNullException(nameof(uri));
 29            }
 30
 031            Name = name;
 032            Uri = uri;
 033            Roles = roles;
 034        }
 35
 36        /// <summary> Initializes a new instance of ScriptAction. </summary>
 37        /// <param name="name"> The user provided name of the script action. </param>
 38        /// <param name="uri"> The URI for the script action. </param>
 39        /// <param name="roles"> The node types on which the script action should be executed. </param>
 40        /// <param name="parameters"> The parameters for the script action. </param>
 041        internal ScriptAction(string name, string uri, HdiNodeTypes roles, string parameters)
 42        {
 043            Name = name;
 044            Uri = uri;
 045            Roles = roles;
 046            Parameters = parameters;
 047        }
 48
 49        /// <summary> The user provided name of the script action. </summary>
 050        public string Name { get; set; }
 51        /// <summary> The URI for the script action. </summary>
 052        public string Uri { get; set; }
 53        /// <summary> The node types on which the script action should be executed. </summary>
 054        public HdiNodeTypes Roles { get; set; }
 55        /// <summary> The parameters for the script action. </summary>
 056        public string Parameters { get; set; }
 57    }
 58}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ScriptAction.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Analytics.Synapse.Artifacts.Models
 12{
 13    public partial class ScriptAction : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("name");
 019            writer.WriteStringValue(Name);
 020            writer.WritePropertyName("uri");
 021            writer.WriteStringValue(Uri);
 022            writer.WritePropertyName("roles");
 023            writer.WriteStringValue(Roles.ToString());
 024            if (Optional.IsDefined(Parameters))
 25            {
 026                writer.WritePropertyName("parameters");
 027                writer.WriteStringValue(Parameters);
 28            }
 029            writer.WriteEndObject();
 030        }
 31
 32        internal static ScriptAction DeserializeScriptAction(JsonElement element)
 33        {
 034            string name = default;
 035            string uri = default;
 036            HdiNodeTypes roles = default;
 037            Optional<string> parameters = default;
 038            foreach (var property in element.EnumerateObject())
 39            {
 040                if (property.NameEquals("name"))
 41                {
 042                    name = property.Value.GetString();
 043                    continue;
 44                }
 045                if (property.NameEquals("uri"))
 46                {
 047                    uri = property.Value.GetString();
 048                    continue;
 49                }
 050                if (property.NameEquals("roles"))
 51                {
 052                    roles = new HdiNodeTypes(property.Value.GetString());
 053                    continue;
 54                }
 055                if (property.NameEquals("parameters"))
 56                {
 057                    parameters = property.Value.GetString();
 58                    continue;
 59                }
 60            }
 061            return new ScriptAction(name, uri, roles, parameters.Value);
 62        }
 63    }
 64}