< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Description()-0%100%
get_TargetBigDataPool()-0%100%
get_RequiredSparkVersion()-0%100%
get_Language()-0%100%
get_JobProperties()-0%100%
get_AdditionalProperties()-0%100%
GetEnumerator()-0%100%
System.Collections.IEnumerable.GetEnumerator()-0%100%
TryGetValue(...)-0%100%
ContainsKey(...)-0%100%
get_Keys()-0%100%
get_Values()-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.get_Count()-0%100%
Add(...)-0%100%
Remove(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.get_IsReadOnly()-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Add(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Remove(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Contains(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.CopyTo(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Clear()-0%100%
get_Item(...)-0%100%
set_Item(...)-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSparkJobDefinition(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SparkJobDefinition.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;
 10using System.Collections.Generic;
 11using Azure.Core;
 12
 13namespace Azure.Analytics.Synapse.Artifacts.Models
 14{
 15    /// <summary> Spark job definition. </summary>
 16    public partial class SparkJobDefinition : IDictionary<string, object>
 17    {
 18        /// <summary> Initializes a new instance of SparkJobDefinition. </summary>
 19        /// <param name="targetBigDataPool"> Big data pool reference. </param>
 20        /// <param name="jobProperties"> The properties of the Spark job. </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="targetBigDataPool"/> or <paramref name="jobProperti
 022        public SparkJobDefinition(BigDataPoolReference targetBigDataPool, SparkJobProperties jobProperties)
 23        {
 024            if (targetBigDataPool == null)
 25            {
 026                throw new ArgumentNullException(nameof(targetBigDataPool));
 27            }
 028            if (jobProperties == null)
 29            {
 030                throw new ArgumentNullException(nameof(jobProperties));
 31            }
 32
 033            TargetBigDataPool = targetBigDataPool;
 034            JobProperties = jobProperties;
 035            AdditionalProperties = new ChangeTrackingDictionary<string, object>();
 036        }
 37
 38        /// <summary> Initializes a new instance of SparkJobDefinition. </summary>
 39        /// <param name="description"> The description of the Spark job definition. </param>
 40        /// <param name="targetBigDataPool"> Big data pool reference. </param>
 41        /// <param name="requiredSparkVersion"> The required Spark version of the application. </param>
 42        /// <param name="language"> The language of the Spark application. </param>
 43        /// <param name="jobProperties"> The properties of the Spark job. </param>
 44        /// <param name="additionalProperties"> . </param>
 045        internal SparkJobDefinition(string description, BigDataPoolReference targetBigDataPool, string requiredSparkVers
 46        {
 047            Description = description;
 048            TargetBigDataPool = targetBigDataPool;
 049            RequiredSparkVersion = requiredSparkVersion;
 050            Language = language;
 051            JobProperties = jobProperties;
 052            AdditionalProperties = additionalProperties;
 053        }
 54
 55        /// <summary> The description of the Spark job definition. </summary>
 056        public string Description { get; set; }
 57        /// <summary> Big data pool reference. </summary>
 058        public BigDataPoolReference TargetBigDataPool { get; set; }
 59        /// <summary> The required Spark version of the application. </summary>
 060        public string RequiredSparkVersion { get; set; }
 61        /// <summary> The language of the Spark application. </summary>
 062        public string Language { get; set; }
 63        /// <summary> The properties of the Spark job. </summary>
 064        public SparkJobProperties JobProperties { get; set; }
 065        internal IDictionary<string, object> AdditionalProperties { get; }
 66        /// <inheritdoc />
 067        public IEnumerator<KeyValuePair<string, object>> GetEnumerator() => AdditionalProperties.GetEnumerator();
 68        /// <inheritdoc />
 069        IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator();
 70        /// <inheritdoc />
 071        public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value);
 72        /// <inheritdoc />
 073        public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key);
 74        /// <inheritdoc />
 075        public ICollection<string> Keys => AdditionalProperties.Keys;
 76        /// <inheritdoc />
 077        public ICollection<object> Values => AdditionalProperties.Values;
 78        /// <inheritdoc />
 079        int ICollection<KeyValuePair<string, object>>.Count => AdditionalProperties.Count;
 80        /// <inheritdoc />
 081        public void Add(string key, object value) => AdditionalProperties.Add(key, value);
 82        /// <inheritdoc />
 083        public bool Remove(string key) => AdditionalProperties.Remove(key);
 84        /// <inheritdoc />
 085        bool ICollection<KeyValuePair<string, object>>.IsReadOnly => AdditionalProperties.IsReadOnly;
 86        /// <inheritdoc />
 087        void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> value) => AdditionalProperties.A
 88        /// <inheritdoc />
 089        bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> value) => AdditionalPropertie
 90        /// <inheritdoc />
 091        bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> value) => AdditionalPropert
 92        /// <inheritdoc />
 093        void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] destination, int offset) =>
 94        /// <inheritdoc />
 095        void ICollection<KeyValuePair<string, object>>.Clear() => AdditionalProperties.Clear();
 96        /// <inheritdoc />
 97        public object this[string key]
 98        {
 099            get => AdditionalProperties[key];
 0100            set => AdditionalProperties[key] = value;
 101        }
 102    }
 103}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SparkJobDefinition.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 SparkJobDefinition : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsDefined(Description))
 20            {
 021                writer.WritePropertyName("description");
 022                writer.WriteStringValue(Description);
 23            }
 024            writer.WritePropertyName("targetBigDataPool");
 025            writer.WriteObjectValue(TargetBigDataPool);
 026            if (Optional.IsDefined(RequiredSparkVersion))
 27            {
 028                writer.WritePropertyName("requiredSparkVersion");
 029                writer.WriteStringValue(RequiredSparkVersion);
 30            }
 031            if (Optional.IsDefined(Language))
 32            {
 033                writer.WritePropertyName("language");
 034                writer.WriteStringValue(Language);
 35            }
 036            writer.WritePropertyName("jobProperties");
 037            writer.WriteObjectValue(JobProperties);
 038            foreach (var item in AdditionalProperties)
 39            {
 040                writer.WritePropertyName(item.Key);
 041                writer.WriteObjectValue(item.Value);
 42            }
 043            writer.WriteEndObject();
 044        }
 45
 46        internal static SparkJobDefinition DeserializeSparkJobDefinition(JsonElement element)
 47        {
 048            Optional<string> description = default;
 049            BigDataPoolReference targetBigDataPool = default;
 050            Optional<string> requiredSparkVersion = default;
 051            Optional<string> language = default;
 052            SparkJobProperties jobProperties = default;
 053            IDictionary<string, object> additionalProperties = default;
 054            Dictionary<string, object> additionalPropertiesDictionary = default;
 055            foreach (var property in element.EnumerateObject())
 56            {
 057                if (property.NameEquals("description"))
 58                {
 059                    description = property.Value.GetString();
 060                    continue;
 61                }
 062                if (property.NameEquals("targetBigDataPool"))
 63                {
 064                    targetBigDataPool = BigDataPoolReference.DeserializeBigDataPoolReference(property.Value);
 065                    continue;
 66                }
 067                if (property.NameEquals("requiredSparkVersion"))
 68                {
 069                    requiredSparkVersion = property.Value.GetString();
 070                    continue;
 71                }
 072                if (property.NameEquals("language"))
 73                {
 074                    language = property.Value.GetString();
 075                    continue;
 76                }
 077                if (property.NameEquals("jobProperties"))
 78                {
 079                    jobProperties = SparkJobProperties.DeserializeSparkJobProperties(property.Value);
 080                    continue;
 81                }
 082                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 083                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 84            }
 085            additionalProperties = additionalPropertiesDictionary;
 086            return new SparkJobDefinition(description.Value, targetBigDataPool, requiredSparkVersion.Value, language.Val
 87        }
 88    }
 89}