< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Description()-0%100%
get_Type()-0%100%
get_Content()-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%
DeserializeSqlScript(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlScript.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> SQL script. </summary>
 16    public partial class SqlScript : IDictionary<string, object>
 17    {
 18        /// <summary> Initializes a new instance of SqlScript. </summary>
 19        /// <param name="content"> The content of the SQL script. </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="content"/> is null. </exception>
 021        public SqlScript(SqlScriptContent content)
 22        {
 023            if (content == null)
 24            {
 025                throw new ArgumentNullException(nameof(content));
 26            }
 27
 028            Content = content;
 029            AdditionalProperties = new ChangeTrackingDictionary<string, object>();
 030        }
 31
 32        /// <summary> Initializes a new instance of SqlScript. </summary>
 33        /// <param name="description"> The description of the SQL script. </param>
 34        /// <param name="type"> The type of the SQL script. </param>
 35        /// <param name="content"> The content of the SQL script. </param>
 36        /// <param name="additionalProperties"> . </param>
 037        internal SqlScript(string description, SqlScriptType? type, SqlScriptContent content, IDictionary<string, object
 38        {
 039            Description = description;
 040            Type = type;
 041            Content = content;
 042            AdditionalProperties = additionalProperties;
 043        }
 44
 45        /// <summary> The description of the SQL script. </summary>
 046        public string Description { get; set; }
 47        /// <summary> The type of the SQL script. </summary>
 048        public SqlScriptType? Type { get; set; }
 49        /// <summary> The content of the SQL script. </summary>
 050        public SqlScriptContent Content { get; set; }
 051        internal IDictionary<string, object> AdditionalProperties { get; }
 52        /// <inheritdoc />
 053        public IEnumerator<KeyValuePair<string, object>> GetEnumerator() => AdditionalProperties.GetEnumerator();
 54        /// <inheritdoc />
 055        IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator();
 56        /// <inheritdoc />
 057        public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value);
 58        /// <inheritdoc />
 059        public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key);
 60        /// <inheritdoc />
 061        public ICollection<string> Keys => AdditionalProperties.Keys;
 62        /// <inheritdoc />
 063        public ICollection<object> Values => AdditionalProperties.Values;
 64        /// <inheritdoc />
 065        int ICollection<KeyValuePair<string, object>>.Count => AdditionalProperties.Count;
 66        /// <inheritdoc />
 067        public void Add(string key, object value) => AdditionalProperties.Add(key, value);
 68        /// <inheritdoc />
 069        public bool Remove(string key) => AdditionalProperties.Remove(key);
 70        /// <inheritdoc />
 071        bool ICollection<KeyValuePair<string, object>>.IsReadOnly => AdditionalProperties.IsReadOnly;
 72        /// <inheritdoc />
 073        void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> value) => AdditionalProperties.A
 74        /// <inheritdoc />
 075        bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> value) => AdditionalPropertie
 76        /// <inheritdoc />
 077        bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> value) => AdditionalPropert
 78        /// <inheritdoc />
 079        void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] destination, int offset) =>
 80        /// <inheritdoc />
 081        void ICollection<KeyValuePair<string, object>>.Clear() => AdditionalProperties.Clear();
 82        /// <inheritdoc />
 83        public object this[string key]
 84        {
 085            get => AdditionalProperties[key];
 086            set => AdditionalProperties[key] = value;
 87        }
 88    }
 89}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlScript.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 SqlScript : 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            if (Optional.IsDefined(Type))
 25            {
 026                writer.WritePropertyName("type");
 027                writer.WriteStringValue(Type.Value.ToString());
 28            }
 029            writer.WritePropertyName("content");
 030            writer.WriteObjectValue(Content);
 031            foreach (var item in AdditionalProperties)
 32            {
 033                writer.WritePropertyName(item.Key);
 034                writer.WriteObjectValue(item.Value);
 35            }
 036            writer.WriteEndObject();
 037        }
 38
 39        internal static SqlScript DeserializeSqlScript(JsonElement element)
 40        {
 041            Optional<string> description = default;
 042            Optional<SqlScriptType> type = default;
 043            SqlScriptContent content = default;
 044            IDictionary<string, object> additionalProperties = default;
 045            Dictionary<string, object> additionalPropertiesDictionary = default;
 046            foreach (var property in element.EnumerateObject())
 47            {
 048                if (property.NameEquals("description"))
 49                {
 050                    description = property.Value.GetString();
 051                    continue;
 52                }
 053                if (property.NameEquals("type"))
 54                {
 055                    type = new SqlScriptType(property.Value.GetString());
 056                    continue;
 57                }
 058                if (property.NameEquals("content"))
 59                {
 060                    content = SqlScriptContent.DeserializeSqlScriptContent(property.Value);
 061                    continue;
 62                }
 063                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 064                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 65            }
 066            additionalProperties = additionalPropertiesDictionary;
 067            return new SqlScript(description.Value, Optional.ToNullable(type), content, additionalProperties);
 68        }
 69    }
 70}