< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.SqlScriptContent
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlScriptContent.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlScriptContent.Serialization.cs
Covered lines:0
Uncovered lines:68
Coverable lines:68
Total lines:162
Line coverage:0% (0 of 68)
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_Query()-0%100%
get_CurrentConnection()-0%100%
get_Metadata()-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%
DeserializeSqlScriptContent(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlScriptContent.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> The content of the SQL script. </summary>
 16    public partial class SqlScriptContent : IDictionary<string, object>
 17    {
 18        /// <summary> Initializes a new instance of SqlScriptContent. </summary>
 19        /// <param name="query"> SQL query to execute. </param>
 20        /// <param name="currentConnection"> The connection used to execute the SQL script. </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="query"/> or <paramref name="currentConnection"/> is
 022        public SqlScriptContent(string query, SqlConnection currentConnection)
 23        {
 024            if (query == null)
 25            {
 026                throw new ArgumentNullException(nameof(query));
 27            }
 028            if (currentConnection == null)
 29            {
 030                throw new ArgumentNullException(nameof(currentConnection));
 31            }
 32
 033            Query = query;
 034            CurrentConnection = currentConnection;
 035            AdditionalProperties = new ChangeTrackingDictionary<string, object>();
 036        }
 37
 38        /// <summary> Initializes a new instance of SqlScriptContent. </summary>
 39        /// <param name="query"> SQL query to execute. </param>
 40        /// <param name="currentConnection"> The connection used to execute the SQL script. </param>
 41        /// <param name="metadata"> The metadata of the SQL script. </param>
 42        /// <param name="additionalProperties"> . </param>
 043        internal SqlScriptContent(string query, SqlConnection currentConnection, SqlScriptMetadata metadata, IDictionary
 44        {
 045            Query = query;
 046            CurrentConnection = currentConnection;
 047            Metadata = metadata;
 048            AdditionalProperties = additionalProperties;
 049        }
 50
 51        /// <summary> SQL query to execute. </summary>
 052        public string Query { get; set; }
 53        /// <summary> The connection used to execute the SQL script. </summary>
 054        public SqlConnection CurrentConnection { get; set; }
 55        /// <summary> The metadata of the SQL script. </summary>
 056        public SqlScriptMetadata Metadata { get; set; }
 057        internal IDictionary<string, object> AdditionalProperties { get; }
 58        /// <inheritdoc />
 059        public IEnumerator<KeyValuePair<string, object>> GetEnumerator() => AdditionalProperties.GetEnumerator();
 60        /// <inheritdoc />
 061        IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator();
 62        /// <inheritdoc />
 063        public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value);
 64        /// <inheritdoc />
 065        public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key);
 66        /// <inheritdoc />
 067        public ICollection<string> Keys => AdditionalProperties.Keys;
 68        /// <inheritdoc />
 069        public ICollection<object> Values => AdditionalProperties.Values;
 70        /// <inheritdoc />
 071        int ICollection<KeyValuePair<string, object>>.Count => AdditionalProperties.Count;
 72        /// <inheritdoc />
 073        public void Add(string key, object value) => AdditionalProperties.Add(key, value);
 74        /// <inheritdoc />
 075        public bool Remove(string key) => AdditionalProperties.Remove(key);
 76        /// <inheritdoc />
 077        bool ICollection<KeyValuePair<string, object>>.IsReadOnly => AdditionalProperties.IsReadOnly;
 78        /// <inheritdoc />
 079        void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> value) => AdditionalProperties.A
 80        /// <inheritdoc />
 081        bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> value) => AdditionalPropertie
 82        /// <inheritdoc />
 083        bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> value) => AdditionalPropert
 84        /// <inheritdoc />
 085        void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] destination, int offset) =>
 86        /// <inheritdoc />
 087        void ICollection<KeyValuePair<string, object>>.Clear() => AdditionalProperties.Clear();
 88        /// <inheritdoc />
 89        public object this[string key]
 90        {
 091            get => AdditionalProperties[key];
 092            set => AdditionalProperties[key] = value;
 93        }
 94    }
 95}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlScriptContent.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 SqlScriptContent : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("query");
 020            writer.WriteStringValue(Query);
 021            writer.WritePropertyName("currentConnection");
 022            writer.WriteObjectValue(CurrentConnection);
 023            if (Optional.IsDefined(Metadata))
 24            {
 025                writer.WritePropertyName("metadata");
 026                writer.WriteObjectValue(Metadata);
 27            }
 028            foreach (var item in AdditionalProperties)
 29            {
 030                writer.WritePropertyName(item.Key);
 031                writer.WriteObjectValue(item.Value);
 32            }
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static SqlScriptContent DeserializeSqlScriptContent(JsonElement element)
 37        {
 038            string query = default;
 039            SqlConnection currentConnection = default;
 040            Optional<SqlScriptMetadata> metadata = default;
 041            IDictionary<string, object> additionalProperties = default;
 042            Dictionary<string, object> additionalPropertiesDictionary = default;
 043            foreach (var property in element.EnumerateObject())
 44            {
 045                if (property.NameEquals("query"))
 46                {
 047                    query = property.Value.GetString();
 048                    continue;
 49                }
 050                if (property.NameEquals("currentConnection"))
 51                {
 052                    currentConnection = SqlConnection.DeserializeSqlConnection(property.Value);
 053                    continue;
 54                }
 055                if (property.NameEquals("metadata"))
 56                {
 057                    metadata = SqlScriptMetadata.DeserializeSqlScriptMetadata(property.Value);
 058                    continue;
 59                }
 060                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 061                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 62            }
 063            additionalProperties = additionalPropertiesDictionary;
 064            return new SqlScriptContent(query, currentConnection, metadata.Value, additionalProperties);
 65        }
 66    }
 67}