< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Url()-0%100%
get_Key()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAzureSearchLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\AzureSearchLinkedService.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;
 10
 11namespace Azure.Analytics.Synapse.Artifacts.Models
 12{
 13    /// <summary> Linked service for Windows Azure Search Service. </summary>
 14    public partial class AzureSearchLinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of AzureSearchLinkedService. </summary>
 17        /// <param name="url"> URL for Azure Search service. Type: string (or Expression with resultType string). </para
 18        /// <exception cref="ArgumentNullException"> <paramref name="url"/> is null. </exception>
 019        public AzureSearchLinkedService(object url)
 20        {
 021            if (url == null)
 22            {
 023                throw new ArgumentNullException(nameof(url));
 24            }
 25
 026            Url = url;
 027            Type = "AzureSearch";
 028        }
 29
 30        /// <summary> Initializes a new instance of AzureSearchLinkedService. </summary>
 31        /// <param name="type"> Type of linked service. </param>
 32        /// <param name="connectVia"> The integration runtime reference. </param>
 33        /// <param name="description"> Linked service description. </param>
 34        /// <param name="parameters"> Parameters for linked service. </param>
 35        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
 36        /// <param name="additionalProperties"> . </param>
 37        /// <param name="url"> URL for Azure Search service. Type: string (or Expression with resultType string). </para
 38        /// <param name="key"> Admin Key for Azure Search service. </param>
 39        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 040        internal AzureSearchLinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDict
 41        {
 042            Url = url;
 043            Key = key;
 044            EncryptedCredential = encryptedCredential;
 045            Type = type ?? "AzureSearch";
 046        }
 47
 48        /// <summary> URL for Azure Search service. Type: string (or Expression with resultType string). </summary>
 049        public object Url { get; set; }
 50        /// <summary> Admin Key for Azure Search service. </summary>
 051        public SecretBase Key { get; set; }
 52        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 053        public object EncryptedCredential { get; set; }
 54    }
 55}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\AzureSearchLinkedService.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 AzureSearchLinkedService : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("type");
 020            writer.WriteStringValue(Type);
 021            if (Optional.IsDefined(ConnectVia))
 22            {
 023                writer.WritePropertyName("connectVia");
 024                writer.WriteObjectValue(ConnectVia);
 25            }
 026            if (Optional.IsDefined(Description))
 27            {
 028                writer.WritePropertyName("description");
 029                writer.WriteStringValue(Description);
 30            }
 031            if (Optional.IsCollectionDefined(Parameters))
 32            {
 033                writer.WritePropertyName("parameters");
 034                writer.WriteStartObject();
 035                foreach (var item in Parameters)
 36                {
 037                    writer.WritePropertyName(item.Key);
 038                    writer.WriteObjectValue(item.Value);
 39                }
 040                writer.WriteEndObject();
 41            }
 042            if (Optional.IsCollectionDefined(Annotations))
 43            {
 044                writer.WritePropertyName("annotations");
 045                writer.WriteStartArray();
 046                foreach (var item in Annotations)
 47                {
 048                    writer.WriteObjectValue(item);
 49                }
 050                writer.WriteEndArray();
 51            }
 052            writer.WritePropertyName("typeProperties");
 053            writer.WriteStartObject();
 054            writer.WritePropertyName("url");
 055            writer.WriteObjectValue(Url);
 056            if (Optional.IsDefined(Key))
 57            {
 058                writer.WritePropertyName("key");
 059                writer.WriteObjectValue(Key);
 60            }
 061            if (Optional.IsDefined(EncryptedCredential))
 62            {
 063                writer.WritePropertyName("encryptedCredential");
 064                writer.WriteObjectValue(EncryptedCredential);
 65            }
 066            writer.WriteEndObject();
 067            foreach (var item in AdditionalProperties)
 68            {
 069                writer.WritePropertyName(item.Key);
 070                writer.WriteObjectValue(item.Value);
 71            }
 072            writer.WriteEndObject();
 073        }
 74
 75        internal static AzureSearchLinkedService DeserializeAzureSearchLinkedService(JsonElement element)
 76        {
 077            string type = default;
 078            Optional<IntegrationRuntimeReference> connectVia = default;
 079            Optional<string> description = default;
 080            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 081            Optional<IList<object>> annotations = default;
 082            object url = default;
 083            Optional<SecretBase> key = default;
 084            Optional<object> encryptedCredential = default;
 085            IDictionary<string, object> additionalProperties = default;
 086            Dictionary<string, object> additionalPropertiesDictionary = default;
 087            foreach (var property in element.EnumerateObject())
 88            {
 089                if (property.NameEquals("type"))
 90                {
 091                    type = property.Value.GetString();
 092                    continue;
 93                }
 094                if (property.NameEquals("connectVia"))
 95                {
 096                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 097                    continue;
 98                }
 099                if (property.NameEquals("description"))
 100                {
 0101                    description = property.Value.GetString();
 0102                    continue;
 103                }
 0104                if (property.NameEquals("parameters"))
 105                {
 0106                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0107                    foreach (var property0 in property.Value.EnumerateObject())
 108                    {
 0109                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 110                    }
 0111                    parameters = dictionary;
 0112                    continue;
 113                }
 0114                if (property.NameEquals("annotations"))
 115                {
 0116                    List<object> array = new List<object>();
 0117                    foreach (var item in property.Value.EnumerateArray())
 118                    {
 0119                        array.Add(item.GetObject());
 120                    }
 0121                    annotations = array;
 0122                    continue;
 123                }
 0124                if (property.NameEquals("typeProperties"))
 125                {
 0126                    foreach (var property0 in property.Value.EnumerateObject())
 127                    {
 0128                        if (property0.NameEquals("url"))
 129                        {
 0130                            url = property0.Value.GetObject();
 0131                            continue;
 132                        }
 0133                        if (property0.NameEquals("key"))
 134                        {
 0135                            key = SecretBase.DeserializeSecretBase(property0.Value);
 0136                            continue;
 137                        }
 0138                        if (property0.NameEquals("encryptedCredential"))
 139                        {
 0140                            encryptedCredential = property0.Value.GetObject();
 141                            continue;
 142                        }
 143                    }
 144                    continue;
 145                }
 0146                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0147                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 148            }
 0149            additionalProperties = additionalPropertiesDictionary;
 0150            return new AzureSearchLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(paramet
 151        }
 152    }
 153}