< Summary

Class:Azure.Analytics.Synapse.Spark.Models.SparkSession
Assembly:Azure.Analytics.Synapse.Spark
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Spark\src\Generated\Models\SparkSession.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Spark\src\Generated\Models\SparkSession.Serialization.cs
Covered lines:78
Uncovered lines:52
Coverable lines:130
Total lines:243
Line coverage:60% (78 of 130)
Covered branches:29
Total branches:46
Branch coverage:63% (29 of 46)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%100%
get_LivyInfo()-0%100%
get_Name()-100%100%
get_WorkspaceName()-0%100%
get_SparkPoolName()-0%100%
get_SubmitterName()-0%100%
get_SubmitterId()-100%100%
get_ArtifactId()-100%100%
get_JobType()-0%100%
get_Result()-0%100%
get_Scheduler()-0%100%
get_Plugin()-0%100%
get_Errors()-0%100%
get_Tags()-0%100%
get_Id()-100%100%
get_AppId()-100%100%
get_AppInfo()-0%100%
get_State()-0%100%
get_LogLines()-0%100%
DeserializeSparkSession(...)-62.35%63.04%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Spark\src\Generated\Models\SparkSession.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 Azure.Core;
 10
 11namespace Azure.Analytics.Synapse.Spark.Models
 12{
 13    /// <summary> The SparkSession. </summary>
 14    public partial class SparkSession
 15    {
 16        /// <summary> Initializes a new instance of SparkSession. </summary>
 17        /// <param name="id"> . </param>
 018        internal SparkSession(int id)
 19        {
 020            Errors = new ChangeTrackingList<SparkServiceError>();
 021            Tags = new ChangeTrackingDictionary<string, string>();
 022            Id = id;
 023            AppInfo = new ChangeTrackingDictionary<string, string>();
 024            LogLines = new ChangeTrackingList<string>();
 025        }
 26
 27        /// <summary> Initializes a new instance of SparkSession. </summary>
 28        /// <param name="livyInfo"> . </param>
 29        /// <param name="name"> . </param>
 30        /// <param name="workspaceName"> . </param>
 31        /// <param name="sparkPoolName"> . </param>
 32        /// <param name="submitterName"> . </param>
 33        /// <param name="submitterId"> . </param>
 34        /// <param name="artifactId"> . </param>
 35        /// <param name="jobType"> The job type. </param>
 36        /// <param name="result"> . </param>
 37        /// <param name="scheduler"> . </param>
 38        /// <param name="plugin"> . </param>
 39        /// <param name="errors"> The error information. </param>
 40        /// <param name="tags"> Dictionary of &lt;string&gt;. </param>
 41        /// <param name="id"> . </param>
 42        /// <param name="appId"> . </param>
 43        /// <param name="appInfo"> Dictionary of &lt;string&gt;. </param>
 44        /// <param name="state"> . </param>
 45        /// <param name="logLines"> . </param>
 16046        internal SparkSession(SparkSessionState livyInfo, string name, string workspaceName, string sparkPoolName, strin
 47        {
 16048            LivyInfo = livyInfo;
 16049            Name = name;
 16050            WorkspaceName = workspaceName;
 16051            SparkPoolName = sparkPoolName;
 16052            SubmitterName = submitterName;
 16053            SubmitterId = submitterId;
 16054            ArtifactId = artifactId;
 16055            JobType = jobType;
 16056            Result = result;
 16057            Scheduler = scheduler;
 16058            Plugin = plugin;
 16059            Errors = errors;
 16060            Tags = tags;
 16061            Id = id;
 16062            AppId = appId;
 16063            AppInfo = appInfo;
 16064            State = state;
 16065            LogLines = logLines;
 16066        }
 67
 068        public SparkSessionState LivyInfo { get; }
 16069        public string Name { get; }
 070        public string WorkspaceName { get; }
 071        public string SparkPoolName { get; }
 072        public string SubmitterName { get; }
 16073        public string SubmitterId { get; }
 16074        public string ArtifactId { get; }
 75        /// <summary> The job type. </summary>
 076        public SparkJobType? JobType { get; }
 077        public SparkSessionResultType? Result { get; }
 078        public SparkScheduler Scheduler { get; }
 079        public SparkServicePlugin Plugin { get; }
 80        /// <summary> The error information. </summary>
 081        public IReadOnlyList<SparkServiceError> Errors { get; }
 82        /// <summary> Dictionary of &lt;string&gt;. </summary>
 083        public IReadOnlyDictionary<string, string> Tags { get; }
 24084        public int Id { get; }
 16085        public string AppId { get; }
 86        /// <summary> Dictionary of &lt;string&gt;. </summary>
 087        public IReadOnlyDictionary<string, string> AppInfo { get; }
 088        public string State { get; }
 089        public IReadOnlyList<string> LogLines { get; }
 90    }
 91}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Spark\src\Generated\Models\SparkSession.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.Spark.Models
 13{
 14    public partial class SparkSession
 15    {
 16        internal static SparkSession DeserializeSparkSession(JsonElement element)
 17        {
 16018            Optional<SparkSessionState> livyInfo = default;
 16019            Optional<string> name = default;
 16020            Optional<string> workspaceName = default;
 16021            Optional<string> sparkPoolName = default;
 16022            Optional<string> submitterName = default;
 16023            Optional<string> submitterId = default;
 16024            Optional<string> artifactId = default;
 16025            Optional<SparkJobType> jobType = default;
 16026            Optional<SparkSessionResultType> result = default;
 16027            Optional<SparkScheduler> schedulerInfo = default;
 16028            Optional<SparkServicePlugin> pluginInfo = default;
 16029            Optional<IReadOnlyList<SparkServiceError>> errorInfo = default;
 16030            Optional<IReadOnlyDictionary<string, string>> tags = default;
 16031            int id = default;
 16032            Optional<string> appId = default;
 16033            Optional<IReadOnlyDictionary<string, string>> appInfo = default;
 16034            Optional<string> state = default;
 16035            Optional<IReadOnlyList<string>> log = default;
 192036            foreach (var property in element.EnumerateObject())
 37            {
 80038                if (property.NameEquals("livyInfo"))
 39                {
 040                    livyInfo = SparkSessionState.DeserializeSparkSessionState(property.Value);
 041                    continue;
 42                }
 80043                if (property.NameEquals("name"))
 44                {
 045                    name = property.Value.GetString();
 046                    continue;
 47                }
 80048                if (property.NameEquals("workspaceName"))
 49                {
 050                    workspaceName = property.Value.GetString();
 051                    continue;
 52                }
 80053                if (property.NameEquals("sparkPoolName"))
 54                {
 055                    sparkPoolName = property.Value.GetString();
 056                    continue;
 57                }
 80058                if (property.NameEquals("submitterName"))
 59                {
 060                    submitterName = property.Value.GetString();
 061                    continue;
 62                }
 80063                if (property.NameEquals("submitterId"))
 64                {
 065                    submitterId = property.Value.GetString();
 066                    continue;
 67                }
 80068                if (property.NameEquals("artifactId"))
 69                {
 070                    artifactId = property.Value.GetString();
 071                    continue;
 72                }
 80073                if (property.NameEquals("jobType"))
 74                {
 075                    jobType = new SparkJobType(property.Value.GetString());
 076                    continue;
 77                }
 80078                if (property.NameEquals("result"))
 79                {
 080                    result = new SparkSessionResultType(property.Value.GetString());
 081                    continue;
 82                }
 80083                if (property.NameEquals("schedulerInfo"))
 84                {
 085                    schedulerInfo = SparkScheduler.DeserializeSparkScheduler(property.Value);
 086                    continue;
 87                }
 80088                if (property.NameEquals("pluginInfo"))
 89                {
 090                    pluginInfo = SparkServicePlugin.DeserializeSparkServicePlugin(property.Value);
 091                    continue;
 92                }
 80093                if (property.NameEquals("errorInfo"))
 94                {
 095                    List<SparkServiceError> array = new List<SparkServiceError>();
 096                    foreach (var item in property.Value.EnumerateArray())
 97                    {
 098                        array.Add(SparkServiceError.DeserializeSparkServiceError(item));
 99                    }
 0100                    errorInfo = array;
 0101                    continue;
 102                }
 800103                if (property.NameEquals("tags"))
 104                {
 0105                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0106                    foreach (var property0 in property.Value.EnumerateObject())
 107                    {
 0108                        dictionary.Add(property0.Name, property0.Value.GetString());
 109                    }
 0110                    tags = dictionary;
 0111                    continue;
 112                }
 800113                if (property.NameEquals("id"))
 114                {
 160115                    id = property.Value.GetInt32();
 160116                    continue;
 117                }
 640118                if (property.NameEquals("appId"))
 119                {
 160120                    appId = property.Value.GetString();
 160121                    continue;
 122                }
 480123                if (property.NameEquals("appInfo"))
 124                {
 160125                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 960126                    foreach (var property0 in property.Value.EnumerateObject())
 127                    {
 320128                        dictionary.Add(property0.Name, property0.Value.GetString());
 129                    }
 160130                    appInfo = dictionary;
 160131                    continue;
 132                }
 320133                if (property.NameEquals("state"))
 134                {
 160135                    state = property.Value.GetString();
 160136                    continue;
 137                }
 160138                if (property.NameEquals("log"))
 139                {
 160140                    List<string> array = new List<string>();
 3520141                    foreach (var item in property.Value.EnumerateArray())
 142                    {
 1600143                        array.Add(item.GetString());
 144                    }
 160145                    log = array;
 146                    continue;
 147                }
 148            }
 160149            return new SparkSession(livyInfo.Value, name.Value, workspaceName.Value, sparkPoolName.Value, submitterName.
 150        }
 151    }
 152}