< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.NotebookResource
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookResource.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookResource.Serialization.cs
Covered lines:25
Uncovered lines:10
Coverable lines:35
Total lines:103
Line coverage:71.4% (25 of 35)
Covered branches:12
Total branches:14
Branch coverage:85.7% (12 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-100%100%
get_Properties()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeNotebookResource(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookResource.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> Notebook resource type. </summary>
 13    public partial class NotebookResource : SubResource
 14    {
 15        /// <summary> Initializes a new instance of NotebookResource. </summary>
 16        /// <param name="properties"> Properties of Notebook. </param>
 17        /// <exception cref="ArgumentNullException"> <paramref name="properties"/> is null. </exception>
 018        public NotebookResource(Notebook properties)
 19        {
 020            if (properties == null)
 21            {
 022                throw new ArgumentNullException(nameof(properties));
 23            }
 24
 025            Properties = properties;
 026        }
 27
 28        /// <summary> Initializes a new instance of NotebookResource. </summary>
 29        /// <param name="id"> The resource identifier. </param>
 30        /// <param name="name"> The resource name. </param>
 31        /// <param name="type"> The resource type. </param>
 32        /// <param name="etag"> Etag identifies change in the resource. </param>
 33        /// <param name="properties"> Properties of Notebook. </param>
 2434        internal NotebookResource(string id, string name, string type, string etag, Notebook properties) : base(id, name
 35        {
 2436            Properties = properties;
 2437        }
 38
 39        /// <summary> Properties of Notebook. </summary>
 4840        public Notebook Properties { get; set; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookResource.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 NotebookResource : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("properties");
 019            writer.WriteObjectValue(Properties);
 020            writer.WriteEndObject();
 021        }
 22
 23        internal static NotebookResource DeserializeNotebookResource(JsonElement element)
 24        {
 2425            Notebook properties = default;
 2426            Optional<string> id = default;
 2427            Optional<string> name = default;
 2428            Optional<string> type = default;
 2429            Optional<string> etag = default;
 28830            foreach (var property in element.EnumerateObject())
 31            {
 12032                if (property.NameEquals("properties"))
 33                {
 2434                    properties = Notebook.DeserializeNotebook(property.Value);
 2435                    continue;
 36                }
 9637                if (property.NameEquals("id"))
 38                {
 2439                    id = property.Value.GetString();
 2440                    continue;
 41                }
 7242                if (property.NameEquals("name"))
 43                {
 2444                    name = property.Value.GetString();
 2445                    continue;
 46                }
 4847                if (property.NameEquals("type"))
 48                {
 2449                    type = property.Value.GetString();
 2450                    continue;
 51                }
 2452                if (property.NameEquals("etag"))
 53                {
 2454                    etag = property.Value.GetString();
 55                    continue;
 56                }
 57            }
 2458            return new NotebookResource(id.Value, name.Value, type.Value, etag.Value, properties);
 59        }
 60    }
 61}