< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Type()-0%100%
get_ReferenceName()-0%100%
get_Parameters()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeLinkedServiceReference(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\LinkedServiceReference.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.Generic;
 10using Azure.Analytics.Synapse.Artifacts;
 11using Azure.Core;
 12
 13namespace Azure.Analytics.Synapse.Artifacts.Models
 14{
 15    /// <summary> Linked service reference type. </summary>
 16    public partial class LinkedServiceReference
 17    {
 18        /// <summary> Initializes a new instance of LinkedServiceReference. </summary>
 19        /// <param name="type"> Linked service reference type. </param>
 20        /// <param name="referenceName"> Reference LinkedService name. </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="referenceName"/> is null. </exception>
 022        public LinkedServiceReference(LinkedServiceReferenceType type, string referenceName)
 23        {
 024            if (referenceName == null)
 25            {
 026                throw new ArgumentNullException(nameof(referenceName));
 27            }
 28
 029            Type = type;
 030            ReferenceName = referenceName;
 031            Parameters = new ChangeTrackingDictionary<string, object>();
 032        }
 33
 34        /// <summary> Initializes a new instance of LinkedServiceReference. </summary>
 35        /// <param name="type"> Linked service reference type. </param>
 36        /// <param name="referenceName"> Reference LinkedService name. </param>
 37        /// <param name="parameters"> Arguments for LinkedService. </param>
 038        internal LinkedServiceReference(LinkedServiceReferenceType type, string referenceName, IDictionary<string, objec
 39        {
 040            Type = type;
 041            ReferenceName = referenceName;
 042            Parameters = parameters;
 043        }
 44
 45        /// <summary> Linked service reference type. </summary>
 046        public LinkedServiceReferenceType Type { get; set; }
 47        /// <summary> Reference LinkedService name. </summary>
 048        public string ReferenceName { get; set; }
 49        /// <summary> Arguments for LinkedService. </summary>
 050        public IDictionary<string, object> Parameters { get; }
 51    }
 52}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\LinkedServiceReference.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.Analytics.Synapse.Artifacts;
 11using Azure.Core;
 12
 13namespace Azure.Analytics.Synapse.Artifacts.Models
 14{
 15    public partial class LinkedServiceReference : IUtf8JsonSerializable
 16    {
 17        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 18        {
 019            writer.WriteStartObject();
 020            writer.WritePropertyName("type");
 021            writer.WriteStringValue(Type.ToString());
 022            writer.WritePropertyName("referenceName");
 023            writer.WriteStringValue(ReferenceName);
 024            if (Optional.IsCollectionDefined(Parameters))
 25            {
 026                writer.WritePropertyName("parameters");
 027                writer.WriteStartObject();
 028                foreach (var item in Parameters)
 29                {
 030                    writer.WritePropertyName(item.Key);
 031                    writer.WriteObjectValue(item.Value);
 32                }
 033                writer.WriteEndObject();
 34            }
 035            writer.WriteEndObject();
 036        }
 37
 38        internal static LinkedServiceReference DeserializeLinkedServiceReference(JsonElement element)
 39        {
 040            LinkedServiceReferenceType type = default;
 041            string referenceName = default;
 042            Optional<IDictionary<string, object>> parameters = default;
 043            foreach (var property in element.EnumerateObject())
 44            {
 045                if (property.NameEquals("type"))
 46                {
 047                    type = new LinkedServiceReferenceType(property.Value.GetString());
 048                    continue;
 49                }
 050                if (property.NameEquals("referenceName"))
 51                {
 052                    referenceName = property.Value.GetString();
 053                    continue;
 54                }
 055                if (property.NameEquals("parameters"))
 56                {
 057                    Dictionary<string, object> dictionary = new Dictionary<string, object>();
 058                    foreach (var property0 in property.Value.EnumerateObject())
 59                    {
 060                        dictionary.Add(property0.Name, property0.Value.GetObject());
 61                    }
 062                    parameters = dictionary;
 63                    continue;
 64                }
 65            }
 066            return new LinkedServiceReference(type, referenceName, Optional.ToDictionary(parameters));
 67        }
 68    }
 69}