| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System.Collections.Generic; |
| | 9 | | using System.Text.Json; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.Analytics.Synapse.Artifacts.Models |
| | 13 | | { |
| | 14 | | public partial class LinkedService : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | writer.WritePropertyName("type"); |
| 0 | 20 | | writer.WriteStringValue(Type); |
| 0 | 21 | | if (Optional.IsDefined(ConnectVia)) |
| | 22 | | { |
| 0 | 23 | | writer.WritePropertyName("connectVia"); |
| 0 | 24 | | writer.WriteObjectValue(ConnectVia); |
| | 25 | | } |
| 0 | 26 | | if (Optional.IsDefined(Description)) |
| | 27 | | { |
| 0 | 28 | | writer.WritePropertyName("description"); |
| 0 | 29 | | writer.WriteStringValue(Description); |
| | 30 | | } |
| 0 | 31 | | if (Optional.IsCollectionDefined(Parameters)) |
| | 32 | | { |
| 0 | 33 | | writer.WritePropertyName("parameters"); |
| 0 | 34 | | writer.WriteStartObject(); |
| 0 | 35 | | foreach (var item in Parameters) |
| | 36 | | { |
| 0 | 37 | | writer.WritePropertyName(item.Key); |
| 0 | 38 | | writer.WriteObjectValue(item.Value); |
| | 39 | | } |
| 0 | 40 | | writer.WriteEndObject(); |
| | 41 | | } |
| 0 | 42 | | if (Optional.IsCollectionDefined(Annotations)) |
| | 43 | | { |
| 0 | 44 | | writer.WritePropertyName("annotations"); |
| 0 | 45 | | writer.WriteStartArray(); |
| 0 | 46 | | foreach (var item in Annotations) |
| | 47 | | { |
| 0 | 48 | | writer.WriteObjectValue(item); |
| | 49 | | } |
| 0 | 50 | | writer.WriteEndArray(); |
| | 51 | | } |
| 0 | 52 | | foreach (var item in AdditionalProperties) |
| | 53 | | { |
| 0 | 54 | | writer.WritePropertyName(item.Key); |
| 0 | 55 | | writer.WriteObjectValue(item.Value); |
| | 56 | | } |
| 0 | 57 | | writer.WriteEndObject(); |
| 0 | 58 | | } |
| | 59 | |
|
| | 60 | | internal static LinkedService DeserializeLinkedService(JsonElement element) |
| | 61 | | { |
| 0 | 62 | | if (element.TryGetProperty("type", out JsonElement discriminator)) |
| | 63 | | { |
| 0 | 64 | | switch (discriminator.GetString()) |
| | 65 | | { |
| 0 | 66 | | case "AmazonMWS": return AmazonMWSLinkedService.DeserializeAmazonMWSLinkedService(element); |
| 0 | 67 | | case "AmazonRedshift": return AmazonRedshiftLinkedService.DeserializeAmazonRedshiftLinkedService(ele |
| 0 | 68 | | case "AmazonS3": return AmazonS3LinkedService.DeserializeAmazonS3LinkedService(element); |
| 0 | 69 | | case "AzureBatch": return AzureBatchLinkedService.DeserializeAzureBatchLinkedService(element); |
| 0 | 70 | | case "AzureBlobFS": return AzureBlobFSLinkedService.DeserializeAzureBlobFSLinkedService(element); |
| 0 | 71 | | case "AzureBlobStorage": return AzureBlobStorageLinkedService.DeserializeAzureBlobStorageLinkedServi |
| 0 | 72 | | case "AzureDataExplorer": return AzureDataExplorerLinkedService.DeserializeAzureDataExplorerLinkedSe |
| 0 | 73 | | case "AzureDataLakeAnalytics": return AzureDataLakeAnalyticsLinkedService.DeserializeAzureDataLakeAn |
| 0 | 74 | | case "AzureDataLakeStore": return AzureDataLakeStoreLinkedService.DeserializeAzureDataLakeStoreLinke |
| 0 | 75 | | case "AzureDatabricks": return AzureDatabricksLinkedService.DeserializeAzureDatabricksLinkedService( |
| 0 | 76 | | case "AzureFileStorage": return AzureFileStorageLinkedService.DeserializeAzureFileStorageLinkedServi |
| 0 | 77 | | case "AzureFunction": return AzureFunctionLinkedService.DeserializeAzureFunctionLinkedService(elemen |
| 0 | 78 | | case "AzureKeyVault": return AzureKeyVaultLinkedService.DeserializeAzureKeyVaultLinkedService(elemen |
| 0 | 79 | | case "AzureML": return AzureMLLinkedService.DeserializeAzureMLLinkedService(element); |
| 0 | 80 | | case "AzureMLService": return AzureMLServiceLinkedService.DeserializeAzureMLServiceLinkedService(ele |
| 0 | 81 | | case "AzureMariaDB": return AzureMariaDBLinkedService.DeserializeAzureMariaDBLinkedService(element); |
| 0 | 82 | | case "AzureMySql": return AzureMySqlLinkedService.DeserializeAzureMySqlLinkedService(element); |
| 0 | 83 | | case "AzurePostgreSql": return AzurePostgreSqlLinkedService.DeserializeAzurePostgreSqlLinkedService( |
| 0 | 84 | | case "AzureSearch": return AzureSearchLinkedService.DeserializeAzureSearchLinkedService(element); |
| 0 | 85 | | case "AzureSqlDW": return AzureSqlDWLinkedService.DeserializeAzureSqlDWLinkedService(element); |
| 0 | 86 | | case "AzureSqlDatabase": return AzureSqlDatabaseLinkedService.DeserializeAzureSqlDatabaseLinkedServi |
| 0 | 87 | | case "AzureSqlMI": return AzureSqlMILinkedService.DeserializeAzureSqlMILinkedService(element); |
| 0 | 88 | | case "AzureStorage": return AzureStorageLinkedService.DeserializeAzureStorageLinkedService(element); |
| 0 | 89 | | case "AzureTableStorage": return AzureTableStorageLinkedService.DeserializeAzureTableStorageLinkedSe |
| 0 | 90 | | case "Cassandra": return CassandraLinkedService.DeserializeCassandraLinkedService(element); |
| 0 | 91 | | case "CommonDataServiceForApps": return CommonDataServiceForAppsLinkedService.DeserializeCommonDataS |
| 0 | 92 | | case "Concur": return ConcurLinkedService.DeserializeConcurLinkedService(element); |
| 0 | 93 | | case "CosmosDb": return CosmosDbLinkedService.DeserializeCosmosDbLinkedService(element); |
| 0 | 94 | | case "CosmosDbMongoDbApi": return CosmosDbMongoDbApiLinkedService.DeserializeCosmosDbMongoDbApiLinke |
| 0 | 95 | | case "Couchbase": return CouchbaseLinkedService.DeserializeCouchbaseLinkedService(element); |
| 0 | 96 | | case "CustomDataSource": return CustomDataSourceLinkedService.DeserializeCustomDataSourceLinkedServi |
| 0 | 97 | | case "Db2": return Db2LinkedService.DeserializeDb2LinkedService(element); |
| 0 | 98 | | case "Drill": return DrillLinkedService.DeserializeDrillLinkedService(element); |
| 0 | 99 | | case "Dynamics": return DynamicsLinkedService.DeserializeDynamicsLinkedService(element); |
| 0 | 100 | | case "DynamicsAX": return DynamicsAXLinkedService.DeserializeDynamicsAXLinkedService(element); |
| 0 | 101 | | case "DynamicsCrm": return DynamicsCrmLinkedService.DeserializeDynamicsCrmLinkedService(element); |
| 0 | 102 | | case "Eloqua": return EloquaLinkedService.DeserializeEloquaLinkedService(element); |
| 0 | 103 | | case "FileServer": return FileServerLinkedService.DeserializeFileServerLinkedService(element); |
| 0 | 104 | | case "FtpServer": return FtpServerLinkedService.DeserializeFtpServerLinkedService(element); |
| 0 | 105 | | case "GoogleAdWords": return GoogleAdWordsLinkedService.DeserializeGoogleAdWordsLinkedService(elemen |
| 0 | 106 | | case "GoogleBigQuery": return GoogleBigQueryLinkedService.DeserializeGoogleBigQueryLinkedService(ele |
| 0 | 107 | | case "GoogleCloudStorage": return GoogleCloudStorageLinkedService.DeserializeGoogleCloudStorageLinke |
| 0 | 108 | | case "Greenplum": return GreenplumLinkedService.DeserializeGreenplumLinkedService(element); |
| 0 | 109 | | case "HBase": return HBaseLinkedService.DeserializeHBaseLinkedService(element); |
| 0 | 110 | | case "HDInsight": return HDInsightLinkedService.DeserializeHDInsightLinkedService(element); |
| 0 | 111 | | case "HDInsightOnDemand": return HDInsightOnDemandLinkedService.DeserializeHDInsightOnDemandLinkedSe |
| 0 | 112 | | case "Hdfs": return HdfsLinkedService.DeserializeHdfsLinkedService(element); |
| 0 | 113 | | case "Hive": return HiveLinkedService.DeserializeHiveLinkedService(element); |
| 0 | 114 | | case "HttpServer": return HttpLinkedService.DeserializeHttpLinkedService(element); |
| 0 | 115 | | case "Hubspot": return HubspotLinkedService.DeserializeHubspotLinkedService(element); |
| 0 | 116 | | case "Impala": return ImpalaLinkedService.DeserializeImpalaLinkedService(element); |
| 0 | 117 | | case "Informix": return InformixLinkedService.DeserializeInformixLinkedService(element); |
| 0 | 118 | | case "Jira": return JiraLinkedService.DeserializeJiraLinkedService(element); |
| 0 | 119 | | case "Magento": return MagentoLinkedService.DeserializeMagentoLinkedService(element); |
| 0 | 120 | | case "MariaDB": return MariaDBLinkedService.DeserializeMariaDBLinkedService(element); |
| 0 | 121 | | case "Marketo": return MarketoLinkedService.DeserializeMarketoLinkedService(element); |
| 0 | 122 | | case "MicrosoftAccess": return MicrosoftAccessLinkedService.DeserializeMicrosoftAccessLinkedService( |
| 0 | 123 | | case "MongoDb": return MongoDbLinkedService.DeserializeMongoDbLinkedService(element); |
| 0 | 124 | | case "MongoDbV2": return MongoDbV2LinkedService.DeserializeMongoDbV2LinkedService(element); |
| 0 | 125 | | case "MySql": return MySqlLinkedService.DeserializeMySqlLinkedService(element); |
| 0 | 126 | | case "Netezza": return NetezzaLinkedService.DeserializeNetezzaLinkedService(element); |
| 0 | 127 | | case "OData": return ODataLinkedService.DeserializeODataLinkedService(element); |
| 0 | 128 | | case "Odbc": return OdbcLinkedService.DeserializeOdbcLinkedService(element); |
| 0 | 129 | | case "Office365": return Office365LinkedService.DeserializeOffice365LinkedService(element); |
| 0 | 130 | | case "Oracle": return OracleLinkedService.DeserializeOracleLinkedService(element); |
| 0 | 131 | | case "OracleServiceCloud": return OracleServiceCloudLinkedService.DeserializeOracleServiceCloudLinke |
| 0 | 132 | | case "Paypal": return PaypalLinkedService.DeserializePaypalLinkedService(element); |
| 0 | 133 | | case "Phoenix": return PhoenixLinkedService.DeserializePhoenixLinkedService(element); |
| 0 | 134 | | case "PostgreSql": return PostgreSqlLinkedService.DeserializePostgreSqlLinkedService(element); |
| 0 | 135 | | case "Presto": return PrestoLinkedService.DeserializePrestoLinkedService(element); |
| 0 | 136 | | case "QuickBooks": return QuickBooksLinkedService.DeserializeQuickBooksLinkedService(element); |
| 0 | 137 | | case "Responsys": return ResponsysLinkedService.DeserializeResponsysLinkedService(element); |
| 0 | 138 | | case "RestService": return RestServiceLinkedService.DeserializeRestServiceLinkedService(element); |
| 0 | 139 | | case "Salesforce": return SalesforceLinkedService.DeserializeSalesforceLinkedService(element); |
| 0 | 140 | | case "SalesforceMarketingCloud": return SalesforceMarketingCloudLinkedService.DeserializeSalesforceM |
| 0 | 141 | | case "SalesforceServiceCloud": return SalesforceServiceCloudLinkedService.DeserializeSalesforceServi |
| 0 | 142 | | case "SapBW": return SapBWLinkedService.DeserializeSapBWLinkedService(element); |
| 0 | 143 | | case "SapCloudForCustomer": return SapCloudForCustomerLinkedService.DeserializeSapCloudForCustomerLi |
| 0 | 144 | | case "SapEcc": return SapEccLinkedService.DeserializeSapEccLinkedService(element); |
| 0 | 145 | | case "SapHana": return SapHanaLinkedService.DeserializeSapHanaLinkedService(element); |
| 0 | 146 | | case "SapOpenHub": return SapOpenHubLinkedService.DeserializeSapOpenHubLinkedService(element); |
| 0 | 147 | | case "SapTable": return SapTableLinkedService.DeserializeSapTableLinkedService(element); |
| 0 | 148 | | case "ServiceNow": return ServiceNowLinkedService.DeserializeServiceNowLinkedService(element); |
| 0 | 149 | | case "Sftp": return SftpServerLinkedService.DeserializeSftpServerLinkedService(element); |
| 0 | 150 | | case "Shopify": return ShopifyLinkedService.DeserializeShopifyLinkedService(element); |
| 0 | 151 | | case "Spark": return SparkLinkedService.DeserializeSparkLinkedService(element); |
| 0 | 152 | | case "SqlServer": return SqlServerLinkedService.DeserializeSqlServerLinkedService(element); |
| 0 | 153 | | case "Square": return SquareLinkedService.DeserializeSquareLinkedService(element); |
| 0 | 154 | | case "Sybase": return SybaseLinkedService.DeserializeSybaseLinkedService(element); |
| 0 | 155 | | case "Teradata": return TeradataLinkedService.DeserializeTeradataLinkedService(element); |
| 0 | 156 | | case "Vertica": return VerticaLinkedService.DeserializeVerticaLinkedService(element); |
| 0 | 157 | | case "Web": return WebLinkedService.DeserializeWebLinkedService(element); |
| 0 | 158 | | case "Xero": return XeroLinkedService.DeserializeXeroLinkedService(element); |
| 0 | 159 | | case "Zoho": return ZohoLinkedService.DeserializeZohoLinkedService(element); |
| | 160 | | } |
| | 161 | | } |
| 0 | 162 | | string type = default; |
| 0 | 163 | | Optional<IntegrationRuntimeReference> connectVia = default; |
| 0 | 164 | | Optional<string> description = default; |
| 0 | 165 | | Optional<IDictionary<string, ParameterSpecification>> parameters = default; |
| 0 | 166 | | Optional<IList<object>> annotations = default; |
| 0 | 167 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 168 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 169 | | foreach (var property in element.EnumerateObject()) |
| | 170 | | { |
| 0 | 171 | | if (property.NameEquals("type")) |
| | 172 | | { |
| 0 | 173 | | type = property.Value.GetString(); |
| 0 | 174 | | continue; |
| | 175 | | } |
| 0 | 176 | | if (property.NameEquals("connectVia")) |
| | 177 | | { |
| 0 | 178 | | connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value); |
| 0 | 179 | | continue; |
| | 180 | | } |
| 0 | 181 | | if (property.NameEquals("description")) |
| | 182 | | { |
| 0 | 183 | | description = property.Value.GetString(); |
| 0 | 184 | | continue; |
| | 185 | | } |
| 0 | 186 | | if (property.NameEquals("parameters")) |
| | 187 | | { |
| 0 | 188 | | Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio |
| 0 | 189 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 190 | | { |
| 0 | 191 | | dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property |
| | 192 | | } |
| 0 | 193 | | parameters = dictionary; |
| 0 | 194 | | continue; |
| | 195 | | } |
| 0 | 196 | | if (property.NameEquals("annotations")) |
| | 197 | | { |
| 0 | 198 | | List<object> array = new List<object>(); |
| 0 | 199 | | foreach (var item in property.Value.EnumerateArray()) |
| | 200 | | { |
| 0 | 201 | | array.Add(item.GetObject()); |
| | 202 | | } |
| 0 | 203 | | annotations = array; |
| 0 | 204 | | continue; |
| | 205 | | } |
| 0 | 206 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 207 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 208 | | } |
| 0 | 209 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 210 | | return new LinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters), Optio |
| | 211 | | } |
| | 212 | | } |
| | 213 | | } |