< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Host()-0%100%
get_ClientId()-0%100%
get_ClientSecret()-0%100%
get_RedirectUri()-0%100%
get_UseEncryptedEndpoints()-0%100%
get_UseHostVerification()-0%100%
get_UsePeerVerification()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSquareLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SquareLinkedService.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> Square Service linked service. </summary>
 14    public partial class SquareLinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of SquareLinkedService. </summary>
 17        /// <param name="host"> The URL of the Square instance. (i.e. mystore.mysquare.com). </param>
 18        /// <param name="clientId"> The client ID associated with your Square application. </param>
 19        /// <param name="redirectUri"> The redirect URL assigned in the Square application dashboard. (i.e. http://local
 20        /// <exception cref="ArgumentNullException"> <paramref name="host"/>, <paramref name="clientId"/>, or <paramref 
 021        public SquareLinkedService(object host, object clientId, object redirectUri)
 22        {
 023            if (host == null)
 24            {
 025                throw new ArgumentNullException(nameof(host));
 26            }
 027            if (clientId == null)
 28            {
 029                throw new ArgumentNullException(nameof(clientId));
 30            }
 031            if (redirectUri == null)
 32            {
 033                throw new ArgumentNullException(nameof(redirectUri));
 34            }
 35
 036            Host = host;
 037            ClientId = clientId;
 038            RedirectUri = redirectUri;
 039            Type = "Square";
 040        }
 41
 42        /// <summary> Initializes a new instance of SquareLinkedService. </summary>
 43        /// <param name="type"> Type of linked service. </param>
 44        /// <param name="connectVia"> The integration runtime reference. </param>
 45        /// <param name="description"> Linked service description. </param>
 46        /// <param name="parameters"> Parameters for linked service. </param>
 47        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
 48        /// <param name="additionalProperties"> . </param>
 49        /// <param name="host"> The URL of the Square instance. (i.e. mystore.mysquare.com). </param>
 50        /// <param name="clientId"> The client ID associated with your Square application. </param>
 51        /// <param name="clientSecret"> The client secret associated with your Square application. </param>
 52        /// <param name="redirectUri"> The redirect URL assigned in the Square application dashboard. (i.e. http://local
 53        /// <param name="useEncryptedEndpoints"> Specifies whether the data source endpoints are encrypted using HTTPS. 
 54        /// <param name="useHostVerification"> Specifies whether to require the host name in the server&apos;s certifica
 55        /// <param name="usePeerVerification"> Specifies whether to verify the identity of the server when connecting ov
 56        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 057        internal SquareLinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDictionar
 58        {
 059            Host = host;
 060            ClientId = clientId;
 061            ClientSecret = clientSecret;
 062            RedirectUri = redirectUri;
 063            UseEncryptedEndpoints = useEncryptedEndpoints;
 064            UseHostVerification = useHostVerification;
 065            UsePeerVerification = usePeerVerification;
 066            EncryptedCredential = encryptedCredential;
 067            Type = type ?? "Square";
 068        }
 69
 70        /// <summary> The URL of the Square instance. (i.e. mystore.mysquare.com). </summary>
 071        public object Host { get; set; }
 72        /// <summary> The client ID associated with your Square application. </summary>
 073        public object ClientId { get; set; }
 74        /// <summary> The client secret associated with your Square application. </summary>
 075        public SecretBase ClientSecret { get; set; }
 76        /// <summary> The redirect URL assigned in the Square application dashboard. (i.e. http://localhost:2500). </sum
 077        public object RedirectUri { get; set; }
 78        /// <summary> Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. 
 079        public object UseEncryptedEndpoints { get; set; }
 80        /// <summary> Specifies whether to require the host name in the server&apos;s certificate to match the host name
 081        public object UseHostVerification { get; set; }
 82        /// <summary> Specifies whether to verify the identity of the server when connecting over SSL. The default value
 083        public object UsePeerVerification { get; set; }
 84        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 085        public object EncryptedCredential { get; set; }
 86    }
 87}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SquareLinkedService.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 SquareLinkedService : 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("host");
 055            writer.WriteObjectValue(Host);
 056            writer.WritePropertyName("clientId");
 057            writer.WriteObjectValue(ClientId);
 058            if (Optional.IsDefined(ClientSecret))
 59            {
 060                writer.WritePropertyName("clientSecret");
 061                writer.WriteObjectValue(ClientSecret);
 62            }
 063            writer.WritePropertyName("redirectUri");
 064            writer.WriteObjectValue(RedirectUri);
 065            if (Optional.IsDefined(UseEncryptedEndpoints))
 66            {
 067                writer.WritePropertyName("useEncryptedEndpoints");
 068                writer.WriteObjectValue(UseEncryptedEndpoints);
 69            }
 070            if (Optional.IsDefined(UseHostVerification))
 71            {
 072                writer.WritePropertyName("useHostVerification");
 073                writer.WriteObjectValue(UseHostVerification);
 74            }
 075            if (Optional.IsDefined(UsePeerVerification))
 76            {
 077                writer.WritePropertyName("usePeerVerification");
 078                writer.WriteObjectValue(UsePeerVerification);
 79            }
 080            if (Optional.IsDefined(EncryptedCredential))
 81            {
 082                writer.WritePropertyName("encryptedCredential");
 083                writer.WriteObjectValue(EncryptedCredential);
 84            }
 085            writer.WriteEndObject();
 086            foreach (var item in AdditionalProperties)
 87            {
 088                writer.WritePropertyName(item.Key);
 089                writer.WriteObjectValue(item.Value);
 90            }
 091            writer.WriteEndObject();
 092        }
 93
 94        internal static SquareLinkedService DeserializeSquareLinkedService(JsonElement element)
 95        {
 096            string type = default;
 097            Optional<IntegrationRuntimeReference> connectVia = default;
 098            Optional<string> description = default;
 099            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 0100            Optional<IList<object>> annotations = default;
 0101            object host = default;
 0102            object clientId = default;
 0103            Optional<SecretBase> clientSecret = default;
 0104            object redirectUri = default;
 0105            Optional<object> useEncryptedEndpoints = default;
 0106            Optional<object> useHostVerification = default;
 0107            Optional<object> usePeerVerification = default;
 0108            Optional<object> encryptedCredential = default;
 0109            IDictionary<string, object> additionalProperties = default;
 0110            Dictionary<string, object> additionalPropertiesDictionary = default;
 0111            foreach (var property in element.EnumerateObject())
 112            {
 0113                if (property.NameEquals("type"))
 114                {
 0115                    type = property.Value.GetString();
 0116                    continue;
 117                }
 0118                if (property.NameEquals("connectVia"))
 119                {
 0120                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 0121                    continue;
 122                }
 0123                if (property.NameEquals("description"))
 124                {
 0125                    description = property.Value.GetString();
 0126                    continue;
 127                }
 0128                if (property.NameEquals("parameters"))
 129                {
 0130                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0131                    foreach (var property0 in property.Value.EnumerateObject())
 132                    {
 0133                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 134                    }
 0135                    parameters = dictionary;
 0136                    continue;
 137                }
 0138                if (property.NameEquals("annotations"))
 139                {
 0140                    List<object> array = new List<object>();
 0141                    foreach (var item in property.Value.EnumerateArray())
 142                    {
 0143                        array.Add(item.GetObject());
 144                    }
 0145                    annotations = array;
 0146                    continue;
 147                }
 0148                if (property.NameEquals("typeProperties"))
 149                {
 0150                    foreach (var property0 in property.Value.EnumerateObject())
 151                    {
 0152                        if (property0.NameEquals("host"))
 153                        {
 0154                            host = property0.Value.GetObject();
 0155                            continue;
 156                        }
 0157                        if (property0.NameEquals("clientId"))
 158                        {
 0159                            clientId = property0.Value.GetObject();
 0160                            continue;
 161                        }
 0162                        if (property0.NameEquals("clientSecret"))
 163                        {
 0164                            clientSecret = SecretBase.DeserializeSecretBase(property0.Value);
 0165                            continue;
 166                        }
 0167                        if (property0.NameEquals("redirectUri"))
 168                        {
 0169                            redirectUri = property0.Value.GetObject();
 0170                            continue;
 171                        }
 0172                        if (property0.NameEquals("useEncryptedEndpoints"))
 173                        {
 0174                            useEncryptedEndpoints = property0.Value.GetObject();
 0175                            continue;
 176                        }
 0177                        if (property0.NameEquals("useHostVerification"))
 178                        {
 0179                            useHostVerification = property0.Value.GetObject();
 0180                            continue;
 181                        }
 0182                        if (property0.NameEquals("usePeerVerification"))
 183                        {
 0184                            usePeerVerification = property0.Value.GetObject();
 0185                            continue;
 186                        }
 0187                        if (property0.NameEquals("encryptedCredential"))
 188                        {
 0189                            encryptedCredential = property0.Value.GetObject();
 190                            continue;
 191                        }
 192                    }
 193                    continue;
 194                }
 0195                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0196                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 197            }
 0198            additionalProperties = additionalPropertiesDictionary;
 0199            return new SquareLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters),
 200        }
 201    }
 202}