< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Name()-0%100%
get_DisplayName()-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%
DeserializeNotebookKernelSpec(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookKernelSpec.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> Kernel information. </summary>
 16    public partial class NotebookKernelSpec : IDictionary<string, object>
 17    {
 18        /// <summary> Initializes a new instance of NotebookKernelSpec. </summary>
 19        /// <param name="name"> Name of the kernel specification. </param>
 20        /// <param name="displayName"> Name to display in UI. </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="displayName"/> is null. 
 022        public NotebookKernelSpec(string name, string displayName)
 23        {
 024            if (name == null)
 25            {
 026                throw new ArgumentNullException(nameof(name));
 27            }
 028            if (displayName == null)
 29            {
 030                throw new ArgumentNullException(nameof(displayName));
 31            }
 32
 033            Name = name;
 034            DisplayName = displayName;
 035            AdditionalProperties = new ChangeTrackingDictionary<string, object>();
 036        }
 37
 38        /// <summary> Initializes a new instance of NotebookKernelSpec. </summary>
 39        /// <param name="name"> Name of the kernel specification. </param>
 40        /// <param name="displayName"> Name to display in UI. </param>
 41        /// <param name="additionalProperties"> . </param>
 042        internal NotebookKernelSpec(string name, string displayName, IDictionary<string, object> additionalProperties)
 43        {
 044            Name = name;
 045            DisplayName = displayName;
 046            AdditionalProperties = additionalProperties;
 047        }
 48
 49        /// <summary> Name of the kernel specification. </summary>
 050        public string Name { get; set; }
 51        /// <summary> Name to display in UI. </summary>
 052        public string DisplayName { get; set; }
 053        internal IDictionary<string, object> AdditionalProperties { get; }
 54        /// <inheritdoc />
 055        public IEnumerator<KeyValuePair<string, object>> GetEnumerator() => AdditionalProperties.GetEnumerator();
 56        /// <inheritdoc />
 057        IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator();
 58        /// <inheritdoc />
 059        public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value);
 60        /// <inheritdoc />
 061        public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key);
 62        /// <inheritdoc />
 063        public ICollection<string> Keys => AdditionalProperties.Keys;
 64        /// <inheritdoc />
 065        public ICollection<object> Values => AdditionalProperties.Values;
 66        /// <inheritdoc />
 067        int ICollection<KeyValuePair<string, object>>.Count => AdditionalProperties.Count;
 68        /// <inheritdoc />
 069        public void Add(string key, object value) => AdditionalProperties.Add(key, value);
 70        /// <inheritdoc />
 071        public bool Remove(string key) => AdditionalProperties.Remove(key);
 72        /// <inheritdoc />
 073        bool ICollection<KeyValuePair<string, object>>.IsReadOnly => AdditionalProperties.IsReadOnly;
 74        /// <inheritdoc />
 075        void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> value) => AdditionalProperties.A
 76        /// <inheritdoc />
 077        bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> value) => AdditionalPropertie
 78        /// <inheritdoc />
 079        bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> value) => AdditionalPropert
 80        /// <inheritdoc />
 081        void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] destination, int offset) =>
 82        /// <inheritdoc />
 083        void ICollection<KeyValuePair<string, object>>.Clear() => AdditionalProperties.Clear();
 84        /// <inheritdoc />
 85        public object this[string key]
 86        {
 087            get => AdditionalProperties[key];
 088            set => AdditionalProperties[key] = value;
 89        }
 90    }
 91}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookKernelSpec.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 NotebookKernelSpec : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("name");
 020            writer.WriteStringValue(Name);
 021            writer.WritePropertyName("display_name");
 022            writer.WriteStringValue(DisplayName);
 023            foreach (var item in AdditionalProperties)
 24            {
 025                writer.WritePropertyName(item.Key);
 026                writer.WriteObjectValue(item.Value);
 27            }
 028            writer.WriteEndObject();
 029        }
 30
 31        internal static NotebookKernelSpec DeserializeNotebookKernelSpec(JsonElement element)
 32        {
 033            string name = default;
 034            string displayName = default;
 035            IDictionary<string, object> additionalProperties = default;
 036            Dictionary<string, object> additionalPropertiesDictionary = default;
 037            foreach (var property in element.EnumerateObject())
 38            {
 039                if (property.NameEquals("name"))
 40                {
 041                    name = property.Value.GetString();
 042                    continue;
 43                }
 044                if (property.NameEquals("display_name"))
 45                {
 046                    displayName = property.Value.GetString();
 047                    continue;
 48                }
 049                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 050                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 51            }
 052            additionalProperties = additionalPropertiesDictionary;
 053            return new NotebookKernelSpec(name, displayName, additionalProperties);
 54        }
 55    }
 56}