| | 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 Dataset : 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(Description)) |
| | 22 | | { |
| 0 | 23 | | writer.WritePropertyName("description"); |
| 0 | 24 | | writer.WriteStringValue(Description); |
| | 25 | | } |
| 0 | 26 | | if (Optional.IsDefined(Structure)) |
| | 27 | | { |
| 0 | 28 | | writer.WritePropertyName("structure"); |
| 0 | 29 | | writer.WriteObjectValue(Structure); |
| | 30 | | } |
| 0 | 31 | | if (Optional.IsDefined(Schema)) |
| | 32 | | { |
| 0 | 33 | | writer.WritePropertyName("schema"); |
| 0 | 34 | | writer.WriteObjectValue(Schema); |
| | 35 | | } |
| 0 | 36 | | writer.WritePropertyName("linkedServiceName"); |
| 0 | 37 | | writer.WriteObjectValue(LinkedServiceName); |
| 0 | 38 | | if (Optional.IsCollectionDefined(Parameters)) |
| | 39 | | { |
| 0 | 40 | | writer.WritePropertyName("parameters"); |
| 0 | 41 | | writer.WriteStartObject(); |
| 0 | 42 | | foreach (var item in Parameters) |
| | 43 | | { |
| 0 | 44 | | writer.WritePropertyName(item.Key); |
| 0 | 45 | | writer.WriteObjectValue(item.Value); |
| | 46 | | } |
| 0 | 47 | | writer.WriteEndObject(); |
| | 48 | | } |
| 0 | 49 | | if (Optional.IsCollectionDefined(Annotations)) |
| | 50 | | { |
| 0 | 51 | | writer.WritePropertyName("annotations"); |
| 0 | 52 | | writer.WriteStartArray(); |
| 0 | 53 | | foreach (var item in Annotations) |
| | 54 | | { |
| 0 | 55 | | writer.WriteObjectValue(item); |
| | 56 | | } |
| 0 | 57 | | writer.WriteEndArray(); |
| | 58 | | } |
| 0 | 59 | | if (Optional.IsDefined(Folder)) |
| | 60 | | { |
| 0 | 61 | | writer.WritePropertyName("folder"); |
| 0 | 62 | | writer.WriteObjectValue(Folder); |
| | 63 | | } |
| 0 | 64 | | foreach (var item in AdditionalProperties) |
| | 65 | | { |
| 0 | 66 | | writer.WritePropertyName(item.Key); |
| 0 | 67 | | writer.WriteObjectValue(item.Value); |
| | 68 | | } |
| 0 | 69 | | writer.WriteEndObject(); |
| 0 | 70 | | } |
| | 71 | |
|
| | 72 | | internal static Dataset DeserializeDataset(JsonElement element) |
| | 73 | | { |
| 0 | 74 | | if (element.TryGetProperty("type", out JsonElement discriminator)) |
| | 75 | | { |
| 0 | 76 | | switch (discriminator.GetString()) |
| | 77 | | { |
| 0 | 78 | | case "AmazonMWSObject": return AmazonMWSObjectDataset.DeserializeAmazonMWSObjectDataset(element); |
| 0 | 79 | | case "AmazonRedshiftTable": return AmazonRedshiftTableDataset.DeserializeAmazonRedshiftTableDataset( |
| 0 | 80 | | case "Avro": return AvroDataset.DeserializeAvroDataset(element); |
| 0 | 81 | | case "AzureDataExplorerTable": return AzureDataExplorerTableDataset.DeserializeAzureDataExplorerTabl |
| 0 | 82 | | case "AzureMariaDBTable": return AzureMariaDBTableDataset.DeserializeAzureMariaDBTableDataset(elemen |
| 0 | 83 | | case "AzureMySqlTable": return AzureMySqlTableDataset.DeserializeAzureMySqlTableDataset(element); |
| 0 | 84 | | case "AzurePostgreSqlTable": return AzurePostgreSqlTableDataset.DeserializeAzurePostgreSqlTableDatas |
| 0 | 85 | | case "AzureSearchIndex": return AzureSearchIndexDataset.DeserializeAzureSearchIndexDataset(element); |
| 0 | 86 | | case "AzureSqlDWTable": return AzureSqlDWTableDataset.DeserializeAzureSqlDWTableDataset(element); |
| 0 | 87 | | case "AzureSqlMITable": return AzureSqlMITableDataset.DeserializeAzureSqlMITableDataset(element); |
| 0 | 88 | | case "AzureSqlTable": return AzureSqlTableDataset.DeserializeAzureSqlTableDataset(element); |
| 0 | 89 | | case "AzureTable": return AzureTableDataset.DeserializeAzureTableDataset(element); |
| 0 | 90 | | case "Binary": return BinaryDataset.DeserializeBinaryDataset(element); |
| 0 | 91 | | case "CassandraTable": return CassandraTableDataset.DeserializeCassandraTableDataset(element); |
| 0 | 92 | | case "CommonDataServiceForAppsEntity": return CommonDataServiceForAppsEntityDataset.DeserializeCommo |
| 0 | 93 | | case "ConcurObject": return ConcurObjectDataset.DeserializeConcurObjectDataset(element); |
| 0 | 94 | | case "CosmosDbMongoDbApiCollection": return CosmosDbMongoDbApiCollectionDataset.DeserializeCosmosDbM |
| 0 | 95 | | case "CosmosDbSqlApiCollection": return CosmosDbSqlApiCollectionDataset.DeserializeCosmosDbSqlApiCol |
| 0 | 96 | | case "CouchbaseTable": return CouchbaseTableDataset.DeserializeCouchbaseTableDataset(element); |
| 0 | 97 | | case "Db2Table": return Db2TableDataset.DeserializeDb2TableDataset(element); |
| 0 | 98 | | case "DelimitedText": return DelimitedTextDataset.DeserializeDelimitedTextDataset(element); |
| 0 | 99 | | case "DocumentDbCollection": return DocumentDbCollectionDataset.DeserializeDocumentDbCollectionDatas |
| 0 | 100 | | case "DrillTable": return DrillTableDataset.DeserializeDrillTableDataset(element); |
| 0 | 101 | | case "DynamicsAXResource": return DynamicsAXResourceDataset.DeserializeDynamicsAXResourceDataset(ele |
| 0 | 102 | | case "DynamicsCrmEntity": return DynamicsCrmEntityDataset.DeserializeDynamicsCrmEntityDataset(elemen |
| 0 | 103 | | case "DynamicsEntity": return DynamicsEntityDataset.DeserializeDynamicsEntityDataset(element); |
| 0 | 104 | | case "EloquaObject": return EloquaObjectDataset.DeserializeEloquaObjectDataset(element); |
| 0 | 105 | | case "GoogleAdWordsObject": return GoogleAdWordsObjectDataset.DeserializeGoogleAdWordsObjectDataset( |
| 0 | 106 | | case "GoogleBigQueryObject": return GoogleBigQueryObjectDataset.DeserializeGoogleBigQueryObjectDatas |
| 0 | 107 | | case "GreenplumTable": return GreenplumTableDataset.DeserializeGreenplumTableDataset(element); |
| 0 | 108 | | case "HBaseObject": return HBaseObjectDataset.DeserializeHBaseObjectDataset(element); |
| 0 | 109 | | case "HiveObject": return HiveObjectDataset.DeserializeHiveObjectDataset(element); |
| 0 | 110 | | case "HubspotObject": return HubspotObjectDataset.DeserializeHubspotObjectDataset(element); |
| 0 | 111 | | case "ImpalaObject": return ImpalaObjectDataset.DeserializeImpalaObjectDataset(element); |
| 0 | 112 | | case "InformixTable": return InformixTableDataset.DeserializeInformixTableDataset(element); |
| 0 | 113 | | case "JiraObject": return JiraObjectDataset.DeserializeJiraObjectDataset(element); |
| 0 | 114 | | case "Json": return JsonDataset.DeserializeJsonDataset(element); |
| 0 | 115 | | case "MagentoObject": return MagentoObjectDataset.DeserializeMagentoObjectDataset(element); |
| 0 | 116 | | case "MariaDBTable": return MariaDBTableDataset.DeserializeMariaDBTableDataset(element); |
| 0 | 117 | | case "MarketoObject": return MarketoObjectDataset.DeserializeMarketoObjectDataset(element); |
| 0 | 118 | | case "MicrosoftAccessTable": return MicrosoftAccessTableDataset.DeserializeMicrosoftAccessTableDatas |
| 0 | 119 | | case "MongoDbCollection": return MongoDbCollectionDataset.DeserializeMongoDbCollectionDataset(elemen |
| 0 | 120 | | case "MongoDbV2Collection": return MongoDbV2CollectionDataset.DeserializeMongoDbV2CollectionDataset( |
| 0 | 121 | | case "MySqlTable": return MySqlTableDataset.DeserializeMySqlTableDataset(element); |
| 0 | 122 | | case "NetezzaTable": return NetezzaTableDataset.DeserializeNetezzaTableDataset(element); |
| 0 | 123 | | case "ODataResource": return ODataResourceDataset.DeserializeODataResourceDataset(element); |
| 0 | 124 | | case "OdbcTable": return OdbcTableDataset.DeserializeOdbcTableDataset(element); |
| 0 | 125 | | case "Office365Table": return Office365Dataset.DeserializeOffice365Dataset(element); |
| 0 | 126 | | case "OracleServiceCloudObject": return OracleServiceCloudObjectDataset.DeserializeOracleServiceClou |
| 0 | 127 | | case "OracleTable": return OracleTableDataset.DeserializeOracleTableDataset(element); |
| 0 | 128 | | case "Orc": return OrcDataset.DeserializeOrcDataset(element); |
| 0 | 129 | | case "Parquet": return ParquetDataset.DeserializeParquetDataset(element); |
| 0 | 130 | | case "PaypalObject": return PaypalObjectDataset.DeserializePaypalObjectDataset(element); |
| 0 | 131 | | case "PhoenixObject": return PhoenixObjectDataset.DeserializePhoenixObjectDataset(element); |
| 0 | 132 | | case "PostgreSqlTable": return PostgreSqlTableDataset.DeserializePostgreSqlTableDataset(element); |
| 0 | 133 | | case "PrestoObject": return PrestoObjectDataset.DeserializePrestoObjectDataset(element); |
| 0 | 134 | | case "QuickBooksObject": return QuickBooksObjectDataset.DeserializeQuickBooksObjectDataset(element); |
| 0 | 135 | | case "RelationalTable": return RelationalTableDataset.DeserializeRelationalTableDataset(element); |
| 0 | 136 | | case "ResponsysObject": return ResponsysObjectDataset.DeserializeResponsysObjectDataset(element); |
| 0 | 137 | | case "RestResource": return RestResourceDataset.DeserializeRestResourceDataset(element); |
| 0 | 138 | | case "SalesforceMarketingCloudObject": return SalesforceMarketingCloudObjectDataset.DeserializeSales |
| 0 | 139 | | case "SalesforceObject": return SalesforceObjectDataset.DeserializeSalesforceObjectDataset(element); |
| 0 | 140 | | case "SalesforceServiceCloudObject": return SalesforceServiceCloudObjectDataset.DeserializeSalesforc |
| 0 | 141 | | case "SapBwCube": return SapBwCubeDataset.DeserializeSapBwCubeDataset(element); |
| 0 | 142 | | case "SapCloudForCustomerResource": return SapCloudForCustomerResourceDataset.DeserializeSapCloudFor |
| 0 | 143 | | case "SapEccResource": return SapEccResourceDataset.DeserializeSapEccResourceDataset(element); |
| 0 | 144 | | case "SapHanaTable": return SapHanaTableDataset.DeserializeSapHanaTableDataset(element); |
| 0 | 145 | | case "SapOpenHubTable": return SapOpenHubTableDataset.DeserializeSapOpenHubTableDataset(element); |
| 0 | 146 | | case "SapTableResource": return SapTableResourceDataset.DeserializeSapTableResourceDataset(element); |
| 0 | 147 | | case "ServiceNowObject": return ServiceNowObjectDataset.DeserializeServiceNowObjectDataset(element); |
| 0 | 148 | | case "ShopifyObject": return ShopifyObjectDataset.DeserializeShopifyObjectDataset(element); |
| 0 | 149 | | case "SparkObject": return SparkObjectDataset.DeserializeSparkObjectDataset(element); |
| 0 | 150 | | case "SqlServerTable": return SqlServerTableDataset.DeserializeSqlServerTableDataset(element); |
| 0 | 151 | | case "SquareObject": return SquareObjectDataset.DeserializeSquareObjectDataset(element); |
| 0 | 152 | | case "SybaseTable": return SybaseTableDataset.DeserializeSybaseTableDataset(element); |
| 0 | 153 | | case "TeradataTable": return TeradataTableDataset.DeserializeTeradataTableDataset(element); |
| 0 | 154 | | case "VerticaTable": return VerticaTableDataset.DeserializeVerticaTableDataset(element); |
| 0 | 155 | | case "WebTable": return WebTableDataset.DeserializeWebTableDataset(element); |
| 0 | 156 | | case "XeroObject": return XeroObjectDataset.DeserializeXeroObjectDataset(element); |
| 0 | 157 | | case "ZohoObject": return ZohoObjectDataset.DeserializeZohoObjectDataset(element); |
| | 158 | | } |
| | 159 | | } |
| 0 | 160 | | string type = default; |
| 0 | 161 | | Optional<string> description = default; |
| 0 | 162 | | Optional<object> structure = default; |
| 0 | 163 | | Optional<object> schema = default; |
| 0 | 164 | | LinkedServiceReference linkedServiceName = default; |
| 0 | 165 | | Optional<IDictionary<string, ParameterSpecification>> parameters = default; |
| 0 | 166 | | Optional<IList<object>> annotations = default; |
| 0 | 167 | | Optional<DatasetFolder> folder = default; |
| 0 | 168 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 169 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 170 | | foreach (var property in element.EnumerateObject()) |
| | 171 | | { |
| 0 | 172 | | if (property.NameEquals("type")) |
| | 173 | | { |
| 0 | 174 | | type = property.Value.GetString(); |
| 0 | 175 | | continue; |
| | 176 | | } |
| 0 | 177 | | if (property.NameEquals("description")) |
| | 178 | | { |
| 0 | 179 | | description = property.Value.GetString(); |
| 0 | 180 | | continue; |
| | 181 | | } |
| 0 | 182 | | if (property.NameEquals("structure")) |
| | 183 | | { |
| 0 | 184 | | structure = property.Value.GetObject(); |
| 0 | 185 | | continue; |
| | 186 | | } |
| 0 | 187 | | if (property.NameEquals("schema")) |
| | 188 | | { |
| 0 | 189 | | schema = property.Value.GetObject(); |
| 0 | 190 | | continue; |
| | 191 | | } |
| 0 | 192 | | if (property.NameEquals("linkedServiceName")) |
| | 193 | | { |
| 0 | 194 | | linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value); |
| 0 | 195 | | continue; |
| | 196 | | } |
| 0 | 197 | | if (property.NameEquals("parameters")) |
| | 198 | | { |
| 0 | 199 | | Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio |
| 0 | 200 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 201 | | { |
| 0 | 202 | | dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property |
| | 203 | | } |
| 0 | 204 | | parameters = dictionary; |
| 0 | 205 | | continue; |
| | 206 | | } |
| 0 | 207 | | if (property.NameEquals("annotations")) |
| | 208 | | { |
| 0 | 209 | | List<object> array = new List<object>(); |
| 0 | 210 | | foreach (var item in property.Value.EnumerateArray()) |
| | 211 | | { |
| 0 | 212 | | array.Add(item.GetObject()); |
| | 213 | | } |
| 0 | 214 | | annotations = array; |
| 0 | 215 | | continue; |
| | 216 | | } |
| 0 | 217 | | if (property.NameEquals("folder")) |
| | 218 | | { |
| 0 | 219 | | folder = DatasetFolder.DeserializeDatasetFolder(property.Value); |
| 0 | 220 | | continue; |
| | 221 | | } |
| 0 | 222 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 223 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 224 | | } |
| 0 | 225 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 226 | | return new Dataset(type, description.Value, structure.Value, schema.Value, linkedServiceName, Optional.ToDic |
| | 227 | | } |
| | 228 | | } |
| | 229 | | } |