< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Office365TenantId()-0%100%
get_ServicePrincipalTenantId()-0%100%
get_ServicePrincipalId()-0%100%
get_ServicePrincipalKey()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeOffice365LinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\Office365LinkedService.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> Office365 linked service. </summary>
 14    public partial class Office365LinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of Office365LinkedService. </summary>
 17        /// <param name="office365TenantId"> Azure tenant ID to which the Office 365 account belongs. Type: string (or E
 18        /// <param name="servicePrincipalTenantId"> Specify the tenant information under which your Azure AD web applica
 19        /// <param name="servicePrincipalId"> Specify the application&apos;s client ID. Type: string (or Expression with
 20        /// <param name="servicePrincipalKey"> Specify the application&apos;s key. </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="office365TenantId"/>, <paramref name="servicePrinci
 022        public Office365LinkedService(object office365TenantId, object servicePrincipalTenantId, object servicePrincipal
 23        {
 024            if (office365TenantId == null)
 25            {
 026                throw new ArgumentNullException(nameof(office365TenantId));
 27            }
 028            if (servicePrincipalTenantId == null)
 29            {
 030                throw new ArgumentNullException(nameof(servicePrincipalTenantId));
 31            }
 032            if (servicePrincipalId == null)
 33            {
 034                throw new ArgumentNullException(nameof(servicePrincipalId));
 35            }
 036            if (servicePrincipalKey == null)
 37            {
 038                throw new ArgumentNullException(nameof(servicePrincipalKey));
 39            }
 40
 041            Office365TenantId = office365TenantId;
 042            ServicePrincipalTenantId = servicePrincipalTenantId;
 043            ServicePrincipalId = servicePrincipalId;
 044            ServicePrincipalKey = servicePrincipalKey;
 045            Type = "Office365";
 046        }
 47
 48        /// <summary> Initializes a new instance of Office365LinkedService. </summary>
 49        /// <param name="type"> Type of linked service. </param>
 50        /// <param name="connectVia"> The integration runtime reference. </param>
 51        /// <param name="description"> Linked service description. </param>
 52        /// <param name="parameters"> Parameters for linked service. </param>
 53        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
 54        /// <param name="additionalProperties"> . </param>
 55        /// <param name="office365TenantId"> Azure tenant ID to which the Office 365 account belongs. Type: string (or E
 56        /// <param name="servicePrincipalTenantId"> Specify the tenant information under which your Azure AD web applica
 57        /// <param name="servicePrincipalId"> Specify the application&apos;s client ID. Type: string (or Expression with
 58        /// <param name="servicePrincipalKey"> Specify the application&apos;s key. </param>
 59        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 060        internal Office365LinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDictio
 61        {
 062            Office365TenantId = office365TenantId;
 063            ServicePrincipalTenantId = servicePrincipalTenantId;
 064            ServicePrincipalId = servicePrincipalId;
 065            ServicePrincipalKey = servicePrincipalKey;
 066            EncryptedCredential = encryptedCredential;
 067            Type = type ?? "Office365";
 068        }
 69
 70        /// <summary> Azure tenant ID to which the Office 365 account belongs. Type: string (or Expression with resultTy
 071        public object Office365TenantId { get; set; }
 72        /// <summary> Specify the tenant information under which your Azure AD web application resides. Type: string (or
 073        public object ServicePrincipalTenantId { get; set; }
 74        /// <summary> Specify the application&apos;s client ID. Type: string (or Expression with resultType string). </s
 075        public object ServicePrincipalId { get; set; }
 76        /// <summary> Specify the application&apos;s key. </summary>
 077        public SecretBase ServicePrincipalKey { get; set; }
 78        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 079        public object EncryptedCredential { get; set; }
 80    }
 81}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\Office365LinkedService.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 Office365LinkedService : 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("office365TenantId");
 055            writer.WriteObjectValue(Office365TenantId);
 056            writer.WritePropertyName("servicePrincipalTenantId");
 057            writer.WriteObjectValue(ServicePrincipalTenantId);
 058            writer.WritePropertyName("servicePrincipalId");
 059            writer.WriteObjectValue(ServicePrincipalId);
 060            writer.WritePropertyName("servicePrincipalKey");
 061            writer.WriteObjectValue(ServicePrincipalKey);
 062            if (Optional.IsDefined(EncryptedCredential))
 63            {
 064                writer.WritePropertyName("encryptedCredential");
 065                writer.WriteObjectValue(EncryptedCredential);
 66            }
 067            writer.WriteEndObject();
 068            foreach (var item in AdditionalProperties)
 69            {
 070                writer.WritePropertyName(item.Key);
 071                writer.WriteObjectValue(item.Value);
 72            }
 073            writer.WriteEndObject();
 074        }
 75
 76        internal static Office365LinkedService DeserializeOffice365LinkedService(JsonElement element)
 77        {
 078            string type = default;
 079            Optional<IntegrationRuntimeReference> connectVia = default;
 080            Optional<string> description = default;
 081            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 082            Optional<IList<object>> annotations = default;
 083            object office365TenantId = default;
 084            object servicePrincipalTenantId = default;
 085            object servicePrincipalId = default;
 086            SecretBase servicePrincipalKey = default;
 087            Optional<object> encryptedCredential = default;
 088            IDictionary<string, object> additionalProperties = default;
 089            Dictionary<string, object> additionalPropertiesDictionary = default;
 090            foreach (var property in element.EnumerateObject())
 91            {
 092                if (property.NameEquals("type"))
 93                {
 094                    type = property.Value.GetString();
 095                    continue;
 96                }
 097                if (property.NameEquals("connectVia"))
 98                {
 099                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 0100                    continue;
 101                }
 0102                if (property.NameEquals("description"))
 103                {
 0104                    description = property.Value.GetString();
 0105                    continue;
 106                }
 0107                if (property.NameEquals("parameters"))
 108                {
 0109                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0110                    foreach (var property0 in property.Value.EnumerateObject())
 111                    {
 0112                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 113                    }
 0114                    parameters = dictionary;
 0115                    continue;
 116                }
 0117                if (property.NameEquals("annotations"))
 118                {
 0119                    List<object> array = new List<object>();
 0120                    foreach (var item in property.Value.EnumerateArray())
 121                    {
 0122                        array.Add(item.GetObject());
 123                    }
 0124                    annotations = array;
 0125                    continue;
 126                }
 0127                if (property.NameEquals("typeProperties"))
 128                {
 0129                    foreach (var property0 in property.Value.EnumerateObject())
 130                    {
 0131                        if (property0.NameEquals("office365TenantId"))
 132                        {
 0133                            office365TenantId = property0.Value.GetObject();
 0134                            continue;
 135                        }
 0136                        if (property0.NameEquals("servicePrincipalTenantId"))
 137                        {
 0138                            servicePrincipalTenantId = property0.Value.GetObject();
 0139                            continue;
 140                        }
 0141                        if (property0.NameEquals("servicePrincipalId"))
 142                        {
 0143                            servicePrincipalId = property0.Value.GetObject();
 0144                            continue;
 145                        }
 0146                        if (property0.NameEquals("servicePrincipalKey"))
 147                        {
 0148                            servicePrincipalKey = SecretBase.DeserializeSecretBase(property0.Value);
 0149                            continue;
 150                        }
 0151                        if (property0.NameEquals("encryptedCredential"))
 152                        {
 0153                            encryptedCredential = property0.Value.GetObject();
 154                            continue;
 155                        }
 156                    }
 157                    continue;
 158                }
 0159                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0160                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 161            }
 0162            additionalProperties = additionalPropertiesDictionary;
 0163            return new Office365LinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameter
 164        }
 165    }
 166}