From 23f2ce2ea207afc05772c348bc472b02be5c1ade Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik Date: Wed, 6 Feb 2019 19:00:32 -0800 Subject: [PATCH 1/3] Regenerate azure-arm-kusto package --- lib/services/kustoManagement/LICENSE.txt | 42 +- lib/services/kustoManagement/README.md | 89 +- .../lib/kustoManagementClient.d.ts | 2 +- .../lib/kustoManagementClient.js | 4 +- .../lib/models/azureCapacity.js | 3 +- .../lib/models/azureResourceSku.js | 7 +- .../kustoManagement/lib/models/azureSku.js | 7 +- .../lib/models/checkNameResult.js | 3 +- .../kustoManagement/lib/models/cluster.js | 15 +- .../lib/models/clusterCheckNameRequest.js | 3 +- .../lib/models/clusterUpdate.js | 15 +- .../kustoManagement/lib/models/database.js | 52 +- .../lib/models/databaseCheckNameRequest.js | 3 +- .../lib/models/databasePrincipal.js | 3 +- .../lib/models/databaseStatistics.js | 3 +- .../lib/models/databaseUpdate.js | 31 +- .../lib/models/eventHubConnection.js | 125 - .../models/eventHubConnectionListResult.js | 59 - .../lib/models/eventHubConnectionUpdate.js | 125 - .../models/eventHubConnectionValidation.js | 98 - .../eventHubConnectionValidationListResult.js | 61 - .../eventHubConnectionValidationResult.js | 52 - .../kustoManagement/lib/models/index.d.ts | 290 +- .../kustoManagement/lib/models/index.js | 20 +- .../lib/models/trustedExternalTenant.js | 3 +- .../lib/operations/clusters.js | 24 +- .../lib/operations/databases.js | 139 +- .../lib/operations/eventHubConnections.js | 2451 ----------------- .../kustoManagement/lib/operations/index.d.ts | 517 ++-- .../kustoManagement/lib/operations/index.js | 2 +- lib/services/kustoManagement/package.json | 5 +- 31 files changed, 553 insertions(+), 3700 deletions(-) delete mode 100644 lib/services/kustoManagement/lib/models/eventHubConnection.js delete mode 100644 lib/services/kustoManagement/lib/models/eventHubConnectionListResult.js delete mode 100644 lib/services/kustoManagement/lib/models/eventHubConnectionUpdate.js delete mode 100644 lib/services/kustoManagement/lib/models/eventHubConnectionValidation.js delete mode 100644 lib/services/kustoManagement/lib/models/eventHubConnectionValidationListResult.js delete mode 100644 lib/services/kustoManagement/lib/models/eventHubConnectionValidationResult.js delete mode 100644 lib/services/kustoManagement/lib/operations/eventHubConnections.js diff --git a/lib/services/kustoManagement/LICENSE.txt b/lib/services/kustoManagement/LICENSE.txt index a70e8cf66..8f3d85614 100644 --- a/lib/services/kustoManagement/LICENSE.txt +++ b/lib/services/kustoManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2019 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/kustoManagement/README.md b/lib/services/kustoManagement/README.md index 05b83ac84..30b5dd7fb 100644 --- a/lib/services/kustoManagement/README.md +++ b/lib/services/kustoManagement/README.md @@ -1,43 +1,46 @@ ---- -uid: azure-arm-kusto -summary: *content - ---- -**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.** -## Microsoft Azure SDK for Node.js - KustoManagementClient -This project provides a Node.js package for accessing Azure. Right now it supports: -- **Node.js version 6.x.x or higher** - -### Features - - -### How to Install - -```bash -npm install azure-arm-kusto -``` - -### How to use - -#### Authentication, client creation and get clusters as an example. - -```javascript -const msRestAzure = require("ms-rest-azure"); -const KustoManagementClient = require("azure-arm-kusto"); -msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new KustoManagementClient(creds, subscriptionId); - const resourceGroupName = "testresourceGroupName"; - const clusterName = "testclusterName"; - return client.clusters.get(resourceGroupName, clusterName).then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.log('An error occurred:'); - console.dir(err, {depth: null, colors: true}); -}); - -### Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) +--- +uid: azure-arm-kusto +summary: *content + +--- +**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://www.npmjs.com/package/@azure/arm-kusto) which works on Node.js and browsers.** +**See https://aka.ms/azure-sdk-for-js-migration to learn more.** +## Microsoft Azure SDK for Node.js - KustoManagementClient + +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +### Features + + +### How to Install + +```bash +npm install azure-arm-kusto +``` + +### How to use + +#### Authentication, client creation, and get clusters as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const KustoManagementClient = require("azure-arm-kusto"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new KustoManagementClient(creds, subscriptionId); + const resourceGroupName = "testresourceGroupName"; + const clusterName = "testclusterName"; + + return client.clusters.get(resourceGroupName, clusterName).then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.log('An error occurred:'); + console.dir(err, {depth: null, colors: true}); +}); +``` +### Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/kustoManagement/lib/kustoManagementClient.d.ts b/lib/services/kustoManagement/lib/kustoManagementClient.d.ts index 955d1414f..cd74456a8 100644 --- a/lib/services/kustoManagement/lib/kustoManagementClient.d.ts +++ b/lib/services/kustoManagement/lib/kustoManagementClient.d.ts @@ -58,7 +58,7 @@ export default class KustoManagementClient extends AzureServiceClient { // Operation groups clusters: operations.Clusters; databases: operations.Databases; - eventHubConnections: operations.EventHubConnections; + dataConnections: operations.DataConnections; operations: operations.Operations; } diff --git a/lib/services/kustoManagement/lib/kustoManagementClient.js b/lib/services/kustoManagement/lib/kustoManagementClient.js index 037a6acc5..f44bf354f 100644 --- a/lib/services/kustoManagement/lib/kustoManagementClient.js +++ b/lib/services/kustoManagement/lib/kustoManagementClient.js @@ -50,7 +50,7 @@ class KustoManagementClient extends ServiceClient { super(credentials, options); - this.apiVersion = '2018-09-07-preview'; + this.apiVersion = '2019-01-21'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -74,7 +74,7 @@ class KustoManagementClient extends ServiceClient { } this.clusters = new operations.Clusters(this); this.databases = new operations.Databases(this); - this.eventHubConnections = new operations.EventHubConnections(this); + this.dataConnections = new operations.DataConnections(this); this.operations = new operations.Operations(this); this.models = models; msRest.addSerializationMixin(this); diff --git a/lib/services/kustoManagement/lib/models/azureCapacity.js b/lib/services/kustoManagement/lib/models/azureCapacity.js index 906cc942e..672dff572 100644 --- a/lib/services/kustoManagement/lib/models/azureCapacity.js +++ b/lib/services/kustoManagement/lib/models/azureCapacity.js @@ -11,7 +11,8 @@ 'use strict'; /** - * Class representing a AzureCapacity. + * Azure capacity definition. + * */ class AzureCapacity { /** diff --git a/lib/services/kustoManagement/lib/models/azureResourceSku.js b/lib/services/kustoManagement/lib/models/azureResourceSku.js index f6b264058..6188cd847 100644 --- a/lib/services/kustoManagement/lib/models/azureResourceSku.js +++ b/lib/services/kustoManagement/lib/models/azureResourceSku.js @@ -11,15 +11,16 @@ 'use strict'; /** - * Class representing a AzureResourceSku. + * Azure resource SKU definition. + * */ class AzureResourceSku { /** * Create a AzureResourceSku. * @property {string} [resourceType] Resource Namespace and Type. * @property {object} [sku] The SKU details. - * @property {string} [sku.name] SKU name. Possible values include: 'KC8', - * 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * @property {string} [sku.name] SKU name. Possible values include: 'D13_v2', + * 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * @property {number} [sku.capacity] SKU capacity. * @property {object} [capacity] The SKU capacity. * @property {string} [capacity.scaleType] Scale type. Possible values diff --git a/lib/services/kustoManagement/lib/models/azureSku.js b/lib/services/kustoManagement/lib/models/azureSku.js index 99238926b..05efe7132 100644 --- a/lib/services/kustoManagement/lib/models/azureSku.js +++ b/lib/services/kustoManagement/lib/models/azureSku.js @@ -11,13 +11,14 @@ 'use strict'; /** - * Class representing a AzureSku. + * Azure SKU definition. + * */ class AzureSku { /** * Create a AzureSku. - * @property {string} name SKU name. Possible values include: 'KC8', 'KC16', - * 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * @property {string} name SKU name. Possible values include: 'D13_v2', + * 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * @property {number} [capacity] SKU capacity. */ constructor() { diff --git a/lib/services/kustoManagement/lib/models/checkNameResult.js b/lib/services/kustoManagement/lib/models/checkNameResult.js index 27b8cabe9..492edf3e7 100644 --- a/lib/services/kustoManagement/lib/models/checkNameResult.js +++ b/lib/services/kustoManagement/lib/models/checkNameResult.js @@ -11,7 +11,8 @@ 'use strict'; /** - * Class representing a CheckNameResult. + * The result returned from a check name availability request. + * */ class CheckNameResult { /** diff --git a/lib/services/kustoManagement/lib/models/cluster.js b/lib/services/kustoManagement/lib/models/cluster.js index 73eebccb1..5f2c22349 100644 --- a/lib/services/kustoManagement/lib/models/cluster.js +++ b/lib/services/kustoManagement/lib/models/cluster.js @@ -20,14 +20,13 @@ const models = require('./index'); class Cluster extends models['TrackedResource'] { /** * Create a Cluster. - * @property {string} [etag] An ETag of the resource created. * @property {object} sku The SKU of the cluster. - * @property {string} [sku.name] SKU name. Possible values include: 'KC8', - * 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * @property {string} [sku.name] SKU name. Possible values include: 'D13_v2', + * 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * @property {number} [sku.capacity] SKU capacity. * @property {string} [state] The state of the resource. Possible values * include: 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', - * 'Stopping', 'Stopped', 'Starting' + * 'Stopping', 'Stopped', 'Starting', 'Updating' * @property {string} [provisioningState] The provisioned state of the * resource. Possible values include: 'Running', 'Creating', 'Deleting', * 'Succeeded', 'Failed' @@ -98,14 +97,6 @@ class Cluster extends models['TrackedResource'] { name: 'String' } }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - }, sku: { required: true, serializedName: 'sku', diff --git a/lib/services/kustoManagement/lib/models/clusterCheckNameRequest.js b/lib/services/kustoManagement/lib/models/clusterCheckNameRequest.js index e52276f0e..d17fcf465 100644 --- a/lib/services/kustoManagement/lib/models/clusterCheckNameRequest.js +++ b/lib/services/kustoManagement/lib/models/clusterCheckNameRequest.js @@ -11,7 +11,8 @@ 'use strict'; /** - * Class representing a ClusterCheckNameRequest. + * The result returned from a cluster check name availability request. + * */ class ClusterCheckNameRequest { /** diff --git a/lib/services/kustoManagement/lib/models/clusterUpdate.js b/lib/services/kustoManagement/lib/models/clusterUpdate.js index 038ad2bd3..c2da7e8a0 100644 --- a/lib/services/kustoManagement/lib/models/clusterUpdate.js +++ b/lib/services/kustoManagement/lib/models/clusterUpdate.js @@ -22,14 +22,13 @@ class ClusterUpdate extends models['Resource'] { * Create a ClusterUpdate. * @property {object} [tags] Resource tags. * @property {string} [location] Resource location. - * @property {string} [etag] An ETag of the resource updated. * @property {object} [sku] The SKU of the cluster. - * @property {string} [sku.name] SKU name. Possible values include: 'KC8', - * 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * @property {string} [sku.name] SKU name. Possible values include: 'D13_v2', + * 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * @property {number} [sku.capacity] SKU capacity. * @property {string} [state] The state of the resource. Possible values * include: 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', - * 'Stopping', 'Stopped', 'Starting' + * 'Stopping', 'Stopped', 'Starting', 'Updating' * @property {string} [provisioningState] The provisioned state of the * resource. Possible values include: 'Running', 'Creating', 'Deleting', * 'Succeeded', 'Failed' @@ -100,14 +99,6 @@ class ClusterUpdate extends models['Resource'] { name: 'String' } }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - }, sku: { required: false, serializedName: 'sku', diff --git a/lib/services/kustoManagement/lib/models/database.js b/lib/services/kustoManagement/lib/models/database.js index ef65324d1..75e09fef9 100644 --- a/lib/services/kustoManagement/lib/models/database.js +++ b/lib/services/kustoManagement/lib/models/database.js @@ -15,19 +15,19 @@ const models = require('./index'); /** * Class representing a Kusto database. * - * @extends models['TrackedResource'] + * @extends models['ProxyResource'] */ -class Database extends models['TrackedResource'] { +class Database extends models['ProxyResource'] { /** * Create a Database. - * @property {string} [etag] An ETag of the resource created. + * @property {string} [location] Resource location. * @property {string} [provisioningState] The provisioned state of the * resource. Possible values include: 'Running', 'Creating', 'Deleting', * 'Succeeded', 'Failed' - * @property {number} softDeletePeriodInDays The number of days data should - * be kept before it stops being accessible to queries. - * @property {number} [hotCachePeriodInDays] The number of days of data that - * should be kept in cache for fast queries. + * @property {moment.duration} [softDeletePeriod] The time the data should be + * kept before it stops being accessible to queries in TimeSpan. + * @property {moment.duration} [hotCachePeriod] The time the data that should + * be kept in cache for fast queries in TimeSpan. * @property {object} [statistics] The statistics of the database. * @property {number} [statistics.size] The database size - the total size of * compressed data and index in bytes. @@ -74,31 +74,9 @@ class Database extends models['TrackedResource'] { name: 'String' } }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, location: { - required: true, - serializedName: 'location', - type: { - name: 'String' - } - }, - etag: { required: false, - readOnly: true, - serializedName: 'etag', + serializedName: 'location', type: { name: 'String' } @@ -111,18 +89,18 @@ class Database extends models['TrackedResource'] { name: 'String' } }, - softDeletePeriodInDays: { - required: true, - serializedName: 'properties.softDeletePeriodInDays', + softDeletePeriod: { + required: false, + serializedName: 'properties.softDeletePeriod', type: { - name: 'Number' + name: 'TimeSpan' } }, - hotCachePeriodInDays: { + hotCachePeriod: { required: false, - serializedName: 'properties.hotCachePeriodInDays', + serializedName: 'properties.hotCachePeriod', type: { - name: 'Number' + name: 'TimeSpan' } }, statistics: { diff --git a/lib/services/kustoManagement/lib/models/databaseCheckNameRequest.js b/lib/services/kustoManagement/lib/models/databaseCheckNameRequest.js index 9d21449bf..32dc74fcd 100644 --- a/lib/services/kustoManagement/lib/models/databaseCheckNameRequest.js +++ b/lib/services/kustoManagement/lib/models/databaseCheckNameRequest.js @@ -11,7 +11,8 @@ 'use strict'; /** - * Class representing a DatabaseCheckNameRequest. + * The result returned from a database check name availability request. + * */ class DatabaseCheckNameRequest { /** diff --git a/lib/services/kustoManagement/lib/models/databasePrincipal.js b/lib/services/kustoManagement/lib/models/databasePrincipal.js index 32ba0470a..d549ab695 100644 --- a/lib/services/kustoManagement/lib/models/databasePrincipal.js +++ b/lib/services/kustoManagement/lib/models/databasePrincipal.js @@ -11,7 +11,8 @@ 'use strict'; /** - * Class representing a DatabasePrincipal. + * A class representing database principal entity. + * */ class DatabasePrincipal { /** diff --git a/lib/services/kustoManagement/lib/models/databaseStatistics.js b/lib/services/kustoManagement/lib/models/databaseStatistics.js index d5ce0a819..c9ad69fdc 100644 --- a/lib/services/kustoManagement/lib/models/databaseStatistics.js +++ b/lib/services/kustoManagement/lib/models/databaseStatistics.js @@ -11,7 +11,8 @@ 'use strict'; /** - * Class representing a DatabaseStatistics. + * A class that contains database statistics information. + * */ class DatabaseStatistics { /** diff --git a/lib/services/kustoManagement/lib/models/databaseUpdate.js b/lib/services/kustoManagement/lib/models/databaseUpdate.js index db268fc53..c295a14b2 100644 --- a/lib/services/kustoManagement/lib/models/databaseUpdate.js +++ b/lib/services/kustoManagement/lib/models/databaseUpdate.js @@ -21,14 +21,13 @@ class DatabaseUpdate extends models['Resource'] { /** * Create a DatabaseUpdate. * @property {string} [location] Resource location. - * @property {string} [etag] An ETag of the resource updated. * @property {string} [provisioningState] The provisioned state of the * resource. Possible values include: 'Running', 'Creating', 'Deleting', * 'Succeeded', 'Failed' - * @property {number} softDeletePeriodInDays The number of days data should - * be kept before it stops being accessible to queries. - * @property {number} [hotCachePeriodInDays] The number of days of data that - * should be kept in cache for fast queries. + * @property {moment.duration} [softDeletePeriod] The time the data should be + * kept before it stops being accessible to queries in TimeSpan. + * @property {moment.duration} [hotCachePeriod] The time the data that should + * be kept in cache for fast queries in TimeSpan. * @property {object} [statistics] The statistics of the database. * @property {number} [statistics.size] The database size - the total size of * compressed data and index in bytes. @@ -82,14 +81,6 @@ class DatabaseUpdate extends models['Resource'] { name: 'String' } }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - }, provisioningState: { required: false, readOnly: true, @@ -98,18 +89,18 @@ class DatabaseUpdate extends models['Resource'] { name: 'String' } }, - softDeletePeriodInDays: { - required: true, - serializedName: 'properties.softDeletePeriodInDays', + softDeletePeriod: { + required: false, + serializedName: 'properties.softDeletePeriod', type: { - name: 'Number' + name: 'TimeSpan' } }, - hotCachePeriodInDays: { + hotCachePeriod: { required: false, - serializedName: 'properties.hotCachePeriodInDays', + serializedName: 'properties.hotCachePeriod', type: { - name: 'Number' + name: 'TimeSpan' } }, statistics: { diff --git a/lib/services/kustoManagement/lib/models/eventHubConnection.js b/lib/services/kustoManagement/lib/models/eventHubConnection.js deleted file mode 100644 index 29f5fa2e8..000000000 --- a/lib/services/kustoManagement/lib/models/eventHubConnection.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing an event hub connection. - * - * @extends models['ProxyResource'] - */ -class EventHubConnection extends models['ProxyResource'] { - /** - * Create a EventHubConnection. - * @property {string} [location] Resource location. - * @property {string} eventHubResourceId The resource ID of the event hub to - * be used to create a data connection. - * @property {string} consumerGroup The event hub consumer group. - * @property {string} [tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * @property {string} [mappingRuleName] The mapping rule to be used to ingest - * the data. Optionally the mapping information can be added to each message. - * @property {string} [dataFormat] The data format of the message. Optionally - * the data format can be added to each message. Possible values include: - * 'MULTIJSON', 'JSON', 'CSV' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of EventHubConnection - * - * @returns {object} metadata of EventHubConnection - * - */ - mapper() { - return { - required: false, - serializedName: 'EventHubConnection', - type: { - name: 'Composite', - className: 'EventHubConnection', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - eventHubResourceId: { - required: true, - serializedName: 'properties.eventHubResourceId', - type: { - name: 'String' - } - }, - consumerGroup: { - required: true, - serializedName: 'properties.consumerGroup', - type: { - name: 'String' - } - }, - tableName: { - required: false, - serializedName: 'properties.tableName', - type: { - name: 'String' - } - }, - mappingRuleName: { - required: false, - serializedName: 'properties.mappingRuleName', - type: { - name: 'String' - } - }, - dataFormat: { - required: false, - serializedName: 'properties.dataFormat', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EventHubConnection; diff --git a/lib/services/kustoManagement/lib/models/eventHubConnectionListResult.js b/lib/services/kustoManagement/lib/models/eventHubConnectionListResult.js deleted file mode 100644 index cf29802e8..000000000 --- a/lib/services/kustoManagement/lib/models/eventHubConnectionListResult.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The list Kusto event hub connections operation response. - */ -class EventHubConnectionListResult extends Array { - /** - * Create a EventHubConnectionListResult. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of EventHubConnectionListResult - * - * @returns {object} metadata of EventHubConnectionListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'EventHubConnectionListResult', - type: { - name: 'Composite', - className: 'EventHubConnectionListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'EventHubConnectionElementType', - type: { - name: 'Composite', - className: 'EventHubConnection' - } - } - } - } - } - } - }; - } -} - -module.exports = EventHubConnectionListResult; diff --git a/lib/services/kustoManagement/lib/models/eventHubConnectionUpdate.js b/lib/services/kustoManagement/lib/models/eventHubConnectionUpdate.js deleted file mode 100644 index fda6c0dce..000000000 --- a/lib/services/kustoManagement/lib/models/eventHubConnectionUpdate.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing an update to event hub connection. - * - * @extends models['ProxyResource'] - */ -class EventHubConnectionUpdate extends models['ProxyResource'] { - /** - * Create a EventHubConnectionUpdate. - * @property {string} [location] Resource location. - * @property {string} eventHubResourceId The resource ID of the event hub to - * be used to create a data connection. - * @property {string} consumerGroup The event hub consumer group. - * @property {string} [tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * @property {string} [mappingRuleName] The mapping rule to be used to ingest - * the data. Optionally the mapping information can be added to each message. - * @property {string} [dataFormat] The data format of the message. Optionally - * the data format can be added to each message. Possible values include: - * 'MULTIJSON', 'JSON', 'CSV' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of EventHubConnectionUpdate - * - * @returns {object} metadata of EventHubConnectionUpdate - * - */ - mapper() { - return { - required: false, - serializedName: 'EventHubConnectionUpdate', - type: { - name: 'Composite', - className: 'EventHubConnectionUpdate', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - eventHubResourceId: { - required: true, - serializedName: 'properties.eventHubResourceId', - type: { - name: 'String' - } - }, - consumerGroup: { - required: true, - serializedName: 'properties.consumerGroup', - type: { - name: 'String' - } - }, - tableName: { - required: false, - serializedName: 'properties.tableName', - type: { - name: 'String' - } - }, - mappingRuleName: { - required: false, - serializedName: 'properties.mappingRuleName', - type: { - name: 'String' - } - }, - dataFormat: { - required: false, - serializedName: 'properties.dataFormat', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EventHubConnectionUpdate; diff --git a/lib/services/kustoManagement/lib/models/eventHubConnectionValidation.js b/lib/services/kustoManagement/lib/models/eventHubConnectionValidation.js deleted file mode 100644 index 7b9422412..000000000 --- a/lib/services/kustoManagement/lib/models/eventHubConnectionValidation.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Class representing an event hub connection validation. - * - */ -class EventHubConnectionValidation { - /** - * Create a EventHubConnectionValidation. - * @property {string} [eventhubConnectionName] The name of the event hub - * connection. - * @property {string} eventHubResourceId The resource ID of the event hub to - * be used to create a data connection. - * @property {string} consumerGroup The event hub consumer group. - * @property {string} [tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * @property {string} [mappingRuleName] The mapping rule to be used to ingest - * the data. Optionally the mapping information can be added to each message. - * @property {string} [dataFormat] The data format of the message. Optionally - * the data format can be added to each message. Possible values include: - * 'MULTIJSON', 'JSON', 'CSV' - */ - constructor() { - } - - /** - * Defines the metadata of EventHubConnectionValidation - * - * @returns {object} metadata of EventHubConnectionValidation - * - */ - mapper() { - return { - required: false, - serializedName: 'EventHubConnectionValidation', - type: { - name: 'Composite', - className: 'EventHubConnectionValidation', - modelProperties: { - eventhubConnectionName: { - required: false, - serializedName: 'eventhubConnectionName', - type: { - name: 'String' - } - }, - eventHubResourceId: { - required: true, - serializedName: 'properties.eventHubResourceId', - type: { - name: 'String' - } - }, - consumerGroup: { - required: true, - serializedName: 'properties.consumerGroup', - type: { - name: 'String' - } - }, - tableName: { - required: false, - serializedName: 'properties.tableName', - type: { - name: 'String' - } - }, - mappingRuleName: { - required: false, - serializedName: 'properties.mappingRuleName', - type: { - name: 'String' - } - }, - dataFormat: { - required: false, - serializedName: 'properties.dataFormat', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EventHubConnectionValidation; diff --git a/lib/services/kustoManagement/lib/models/eventHubConnectionValidationListResult.js b/lib/services/kustoManagement/lib/models/eventHubConnectionValidationListResult.js deleted file mode 100644 index 7365a7747..000000000 --- a/lib/services/kustoManagement/lib/models/eventHubConnectionValidationListResult.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The list Kusto event hub connection validation result. - * - */ -class EventHubConnectionValidationListResult { - /** - * Create a EventHubConnectionValidationListResult. - * @property {array} [value] The list of Kusto event hub connection - * validation errors. - */ - constructor() { - } - - /** - * Defines the metadata of EventHubConnectionValidationListResult - * - * @returns {object} metadata of EventHubConnectionValidationListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'EventHubConnectionValidationListResult', - type: { - name: 'Composite', - className: 'EventHubConnectionValidationListResult', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'EventHubConnectionValidationResultElementType', - type: { - name: 'Composite', - className: 'EventHubConnectionValidationResult' - } - } - } - } - } - } - }; - } -} - -module.exports = EventHubConnectionValidationListResult; diff --git a/lib/services/kustoManagement/lib/models/eventHubConnectionValidationResult.js b/lib/services/kustoManagement/lib/models/eventHubConnectionValidationResult.js deleted file mode 100644 index 8292ebc59..000000000 --- a/lib/services/kustoManagement/lib/models/eventHubConnectionValidationResult.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Class representing a EventHubConnectionValidationResult. - */ -class EventHubConnectionValidationResult { - /** - * Create a EventHubConnectionValidationResult. - * @property {string} [errorMessage] A message which indicates a problem in - * event hub connection validation. - */ - constructor() { - } - - /** - * Defines the metadata of EventHubConnectionValidationResult - * - * @returns {object} metadata of EventHubConnectionValidationResult - * - */ - mapper() { - return { - required: false, - serializedName: 'EventHubConnectionValidationResult', - type: { - name: 'Composite', - className: 'EventHubConnectionValidationResult', - modelProperties: { - errorMessage: { - required: false, - serializedName: 'errorMessage', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EventHubConnectionValidationResult; diff --git a/lib/services/kustoManagement/lib/models/index.d.ts b/lib/services/kustoManagement/lib/models/index.d.ts index ae29d4d6f..4790ab2d6 100644 --- a/lib/services/kustoManagement/lib/models/index.d.ts +++ b/lib/services/kustoManagement/lib/models/index.d.ts @@ -15,99 +15,80 @@ export { CloudError }; +/** + * Represents a tenant ID that is trusted by the cluster. + */ export interface TrustedExternalTenant { /** * GUID representing an external tenant. - */ + */ value?: string; } +/** + * Azure SKU definition. + */ export interface AzureSku { /** - * SKU name. Possible values include: 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', - * 'L16' - */ + * SKU name. Possible values include: 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' + */ name: string; /** * SKU capacity. - */ + */ capacity?: number; } +/** + * Azure capacity definition. + */ export interface AzureCapacity { /** * Scale type. Possible values include: 'automatic', 'manual', 'none' - */ + */ scaleType: string; /** * Minimum allowed capacity. - */ + */ minimum: number; /** * Maximum allowed capacity. - */ + */ maximum: number; /** * The default capacity that would be used. - */ + */ default: number; } +/** + * Azure resource SKU definition. + */ export interface AzureResourceSku { /** * Resource Namespace and Type. - */ + */ resourceType?: string; /** * The SKU details. - */ + */ sku?: AzureSku; /** * The SKU capacity. - */ + */ capacity?: AzureCapacity; } +/** + * A class that contains database statistics information. + */ export interface DatabaseStatistics { /** * The database size - the total size of compressed data and index in bytes. - */ + */ size?: number; } -/** - * Class representing an event hub connection validation. -*/ -export interface EventHubConnectionValidation { - /** - * The name of the event hub connection. - */ - eventhubConnectionName?: string; - /** - * The resource ID of the event hub to be used to create a data connection. - */ - eventHubResourceId: string; - /** - * The event hub consumer group. - */ - consumerGroup: string; - /** - * The table where the data should be ingested. Optionally the table information can be added to - * each message. - */ - tableName?: string; - /** - * The mapping rule to be used to ingest the data. Optionally the mapping information can be - * added to each message. - */ - mappingRuleName?: string; - /** - * The data format of the message. Optionally the data format can be added to each message. - * Possible values include: 'MULTIJSON', 'JSON', 'CSV' - */ - dataFormat?: string; -} - export interface Resource extends BaseResource { /** * Fully qualified resource Id for the resource. Ex - @@ -143,17 +124,13 @@ export interface TrackedResource extends Resource { * Class representing a Kusto cluster. */ export interface Cluster extends TrackedResource { - /** - * An ETag of the resource created. - */ - readonly etag?: string; /** * The SKU of the cluster. */ sku: AzureSku; /** * The state of the resource. Possible values include: 'Creating', 'Unavailable', 'Running', - * 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting' + * 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting', 'Updating' */ readonly state?: string; /** @@ -187,17 +164,13 @@ export interface ClusterUpdate extends Resource { * Resource location. */ location?: string; - /** - * An ETag of the resource updated. - */ - readonly etag?: string; /** * The SKU of the cluster. */ sku?: AzureSku; /** * The state of the resource. Possible values include: 'Creating', 'Unavailable', 'Running', - * 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting' + * 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting', 'Updating' */ readonly state?: string; /** @@ -219,27 +192,34 @@ export interface ClusterUpdate extends Resource { trustedExternalTenants?: TrustedExternalTenant[]; } +/** + * The resource model definition for a ARM proxy resource. It will have everything other than + * required location and tags +*/ +export interface ProxyResource extends Resource { +} + /** * Class representing a Kusto database. */ -export interface Database extends TrackedResource { +export interface Database extends ProxyResource { /** - * An ETag of the resource created. + * Resource location. */ - readonly etag?: string; + location?: string; /** * The provisioned state of the resource. Possible values include: 'Running', 'Creating', * 'Deleting', 'Succeeded', 'Failed' */ readonly provisioningState?: string; /** - * The number of days data should be kept before it stops being accessible to queries. + * The time the data should be kept before it stops being accessible to queries in TimeSpan. */ - softDeletePeriodInDays: number; + softDeletePeriod?: moment.Duration; /** - * The number of days of data that should be kept in cache for fast queries. + * The time the data that should be kept in cache for fast queries in TimeSpan. */ - hotCachePeriodInDays?: number; + hotCachePeriod?: moment.Duration; /** * The statistics of the database. */ @@ -254,29 +234,28 @@ export interface DatabaseUpdate extends Resource { * Resource location. */ location?: string; - /** - * An ETag of the resource updated. - */ - readonly etag?: string; /** * The provisioned state of the resource. Possible values include: 'Running', 'Creating', * 'Deleting', 'Succeeded', 'Failed' */ readonly provisioningState?: string; /** - * The number of days data should be kept before it stops being accessible to queries. + * The time the data should be kept before it stops being accessible to queries in TimeSpan. */ - softDeletePeriodInDays: number; + softDeletePeriod?: moment.Duration; /** - * The number of days of data that should be kept in cache for fast queries. + * The time the data that should be kept in cache for fast queries in TimeSpan. */ - hotCachePeriodInDays?: number; + hotCachePeriod?: moment.Duration; /** * The statistics of the database. */ statistics?: DatabaseStatistics; } +/** + * A class representing database principal entity. +*/ export interface DatabasePrincipal { /** * Database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', @@ -306,81 +285,25 @@ export interface DatabasePrincipal { } /** - * The resource model definition for a ARM proxy resource. It will have everything other than - * required location and tags + * Class representing an data connection. */ -export interface ProxyResource extends Resource { -} - -/** - * Class representing an update to event hub connection. -*/ -export interface EventHubConnectionUpdate extends ProxyResource { +export interface DataConnection extends ProxyResource { /** * Resource location. */ location?: string; /** - * The resource ID of the event hub to be used to create a data connection. + * Polymorphic Discriminator */ - eventHubResourceId: string; - /** - * The event hub consumer group. - */ - consumerGroup: string; - /** - * The table where the data should be ingested. Optionally the table information can be added to - * each message. - */ - tableName?: string; - /** - * The mapping rule to be used to ingest the data. Optionally the mapping information can be - * added to each message. - */ - mappingRuleName?: string; - /** - * The data format of the message. Optionally the data format can be added to each message. - * Possible values include: 'MULTIJSON', 'JSON', 'CSV' - */ - dataFormat?: string; + kind: string; } /** - * Class representing an event hub connection. + * The result returned from a data connection validation request. */ -export interface EventHubConnection extends ProxyResource { +export interface DataConnectionValidationResult { /** - * Resource location. - */ - location?: string; - /** - * The resource ID of the event hub to be used to create a data connection. - */ - eventHubResourceId: string; - /** - * The event hub consumer group. - */ - consumerGroup: string; - /** - * The table where the data should be ingested. Optionally the table information can be added to - * each message. - */ - tableName?: string; - /** - * The mapping rule to be used to ingest the data. Optionally the mapping information can be - * added to each message. - */ - mappingRuleName?: string; - /** - * The data format of the message. Optionally the data format can be added to each message. - * Possible values include: 'MULTIJSON', 'JSON', 'CSV' - */ - dataFormat?: string; -} - -export interface EventHubConnectionValidationResult { - /** - * A message which indicates a problem in event hub connection validation. + * A message which indicates a problem in data connection validation. */ errorMessage?: string; } @@ -396,15 +319,96 @@ export interface DatabasePrincipalListRequest { } /** - * The list Kusto event hub connection validation result. + * Class representing an data connection validation. */ -export interface EventHubConnectionValidationListResult { +export interface DataConnectionValidation { /** - * The list of Kusto event hub connection validation errors. + * The name of the data connection. */ - value?: EventHubConnectionValidationResult[]; + dataConnectionName?: string; + /** + * The data connection properties to validate. + */ + properties?: DataConnection; } +/** + * Class representing an event hub data connection. +*/ +export interface EventHubDataConnection extends DataConnection { + /** + * The resource ID of the event hub to be used to create a data connection. + */ + eventHubResourceId: string; + /** + * The event hub consumer group. + */ + consumerGroup: string; + /** + * The table where the data should be ingested. Optionally the table information can be added to + * each message. + */ + tableName?: string; + /** + * The mapping rule to be used to ingest the data. Optionally the mapping information can be + * added to each message. + */ + mappingRuleName?: string; + /** + * The data format of the message. Optionally the data format can be added to each message. + * Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', + * 'RAW', 'SINGLEJSON', 'AVRO' + */ + dataFormat?: string; +} + +/** + * Class representing an Event Grid data connection. +*/ +export interface EventGridDataConnection extends DataConnection { + /** + * The resource ID of the storage account where the data resides. + */ + storageAccountResourceId: string; + /** + * The resource ID where the event grid is configured to send events. + */ + eventHubResourceId: string; + /** + * The event hub consumer group. + */ + consumerGroup: string; + /** + * The table where the data should be ingested. Optionally the table information can be added to + * each message. + */ + tableName: string; + /** + * The mapping rule to be used to ingest the data. Optionally the mapping information can be + * added to each message. + */ + mappingRuleName?: string; + /** + * The data format of the message. Optionally the data format can be added to each message. + * Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', + * 'RAW', 'SINGLEJSON', 'AVRO' + */ + dataFormat: string; +} + +/** + * The list Kusto data connection validation result. +*/ +export interface DataConnectionValidationListResult { + /** + * The list of Kusto data connection validation errors. + */ + value?: DataConnectionValidationResult[]; +} + +/** + * The result returned from a cluster check name availability request. +*/ export interface ClusterCheckNameRequest { /** * Cluster name. @@ -412,6 +416,9 @@ export interface ClusterCheckNameRequest { name: string; } +/** + * The result returned from a database check name availability request. +*/ export interface DatabaseCheckNameRequest { /** * Database name. @@ -419,6 +426,9 @@ export interface DatabaseCheckNameRequest { name: string; } +/** + * The result returned from a check name availability request. +*/ export interface CheckNameResult { /** * Specifies a Boolean value that indicates if the name is available. @@ -522,9 +532,9 @@ export interface DatabasePrincipalListResult extends Array { } /** - * The list Kusto event hub connections operation response. + * The list Kusto data connections operation response. */ -export interface EventHubConnectionListResult extends Array { +export interface DataConnectionListResult extends Array { } /** diff --git a/lib/services/kustoManagement/lib/models/index.js b/lib/services/kustoManagement/lib/models/index.js index eabd4e0f3..da1e3a4f8 100644 --- a/lib/services/kustoManagement/lib/models/index.js +++ b/lib/services/kustoManagement/lib/models/index.js @@ -23,20 +23,21 @@ exports.AzureSku = require('./azureSku'); exports.AzureCapacity = require('./azureCapacity'); exports.AzureResourceSku = require('./azureResourceSku'); exports.DatabaseStatistics = require('./databaseStatistics'); -exports.EventHubConnectionValidation = require('./eventHubConnectionValidation'); exports.Resource = require('./resource'); exports.TrackedResource = require('./trackedResource'); exports.Cluster = require('./cluster'); exports.ClusterUpdate = require('./clusterUpdate'); +exports.ProxyResource = require('./proxyResource'); exports.Database = require('./database'); exports.DatabaseUpdate = require('./databaseUpdate'); exports.DatabasePrincipal = require('./databasePrincipal'); -exports.ProxyResource = require('./proxyResource'); -exports.EventHubConnectionUpdate = require('./eventHubConnectionUpdate'); -exports.EventHubConnection = require('./eventHubConnection'); -exports.EventHubConnectionValidationResult = require('./eventHubConnectionValidationResult'); +exports.DataConnection = require('./dataConnection'); +exports.DataConnectionValidationResult = require('./dataConnectionValidationResult'); exports.DatabasePrincipalListRequest = require('./databasePrincipalListRequest'); -exports.EventHubConnectionValidationListResult = require('./eventHubConnectionValidationListResult'); +exports.DataConnectionValidation = require('./dataConnectionValidation'); +exports.EventHubDataConnection = require('./eventHubDataConnection'); +exports.EventGridDataConnection = require('./eventGridDataConnection'); +exports.DataConnectionValidationListResult = require('./dataConnectionValidationListResult'); exports.ClusterCheckNameRequest = require('./clusterCheckNameRequest'); exports.DatabaseCheckNameRequest = require('./databaseCheckNameRequest'); exports.CheckNameResult = require('./checkNameResult'); @@ -48,5 +49,10 @@ exports.ListSkusResult = require('./listSkusResult'); exports.ListResourceSkusResult = require('./listResourceSkusResult'); exports.DatabaseListResult = require('./databaseListResult'); exports.DatabasePrincipalListResult = require('./databasePrincipalListResult'); -exports.EventHubConnectionListResult = require('./eventHubConnectionListResult'); +exports.DataConnectionListResult = require('./dataConnectionListResult'); exports.OperationListResult = require('./operationListResult'); +exports.discriminators = { + 'BaseResource.DataConnection' : exports.DataConnection, + 'BaseResource.EventHub' : exports.EventHubDataConnection, + 'BaseResource.EventGrid' : exports.EventGridDataConnection +}; diff --git a/lib/services/kustoManagement/lib/models/trustedExternalTenant.js b/lib/services/kustoManagement/lib/models/trustedExternalTenant.js index 63902b764..cbc728f04 100644 --- a/lib/services/kustoManagement/lib/models/trustedExternalTenant.js +++ b/lib/services/kustoManagement/lib/models/trustedExternalTenant.js @@ -11,7 +11,8 @@ 'use strict'; /** - * Class representing a TrustedExternalTenant. + * Represents a tenant ID that is trusted by the cluster. + * */ class TrustedExternalTenant { /** diff --git a/lib/services/kustoManagement/lib/operations/clusters.js b/lib/services/kustoManagement/lib/operations/clusters.js index e9241e3a1..1f57c9665 100644 --- a/lib/services/kustoManagement/lib/operations/clusters.js +++ b/lib/services/kustoManagement/lib/operations/clusters.js @@ -175,7 +175,7 @@ function _get(resourceGroupName, clusterName, options, callback) { * @param {object} parameters.sku The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -276,7 +276,7 @@ function _createOrUpdate(resourceGroupName, clusterName, parameters, options, ca * @param {object} [parameters.sku] The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -1276,7 +1276,7 @@ function _listSkusByResource(resourceGroupName, clusterName, options, callback) * @param {object} parameters.sku The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -1482,7 +1482,7 @@ function _beginCreateOrUpdate(resourceGroupName, clusterName, parameters, option * @param {object} [parameters.sku] The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -2177,7 +2177,7 @@ class Clusters { * @param {object} parameters.sku The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -2228,7 +2228,7 @@ class Clusters { * @param {object} parameters.sku The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -2305,7 +2305,7 @@ class Clusters { * @param {object} [parameters.sku] The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -2355,7 +2355,7 @@ class Clusters { * @param {object} [parameters.sku] The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -3103,7 +3103,7 @@ class Clusters { * @param {object} parameters.sku The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -3154,7 +3154,7 @@ class Clusters { * @param {object} parameters.sku The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -3231,7 +3231,7 @@ class Clusters { * @param {object} [parameters.sku] The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -3281,7 +3281,7 @@ class Clusters { * @param {object} [parameters.sku] The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * diff --git a/lib/services/kustoManagement/lib/operations/databases.js b/lib/services/kustoManagement/lib/operations/databases.js index 1cebc2a5c..9c9f2e495 100644 --- a/lib/services/kustoManagement/lib/operations/databases.js +++ b/lib/services/kustoManagement/lib/operations/databases.js @@ -13,6 +13,7 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; +const moment = require('moment'); /** * Checks that the database name is valid and is not already in use. @@ -497,22 +498,19 @@ function _get(resourceGroupName, clusterName, databaseName, options, callback) { * @param {object} parameters The database parameters supplied to the * CreateOrUpdate operation. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {string} [parameters.location] Resource location. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. + * + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * * @param {number} [parameters.statistics.size] The database size - the total * size of compressed data and index in bytes. * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location The geo-location where the resource - * lives - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -599,11 +597,11 @@ function _createOrUpdate(resourceGroupName, clusterName, databaseName, parameter * * @param {string} [parameters.location] Resource location. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * @@ -1264,22 +1262,19 @@ function _removePrincipals(resourceGroupName, clusterName, databaseName, databas * @param {object} parameters The database parameters supplied to the * CreateOrUpdate operation. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {string} [parameters.location] Resource location. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. + * + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * * @param {number} [parameters.statistics.size] The database size - the total * size of compressed data and index in bytes. * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location The geo-location where the resource - * lives - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1471,11 +1466,11 @@ function _beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, para * * @param {string} [parameters.location] Resource location. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * @@ -2103,22 +2098,19 @@ class Databases { * @param {object} parameters The database parameters supplied to the * CreateOrUpdate operation. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {string} [parameters.location] Resource location. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. + * + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * * @param {number} [parameters.statistics.size] The database size - the total * size of compressed data and index in bytes. * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location The geo-location where the resource - * lives - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2157,22 +2149,19 @@ class Databases { * @param {object} parameters The database parameters supplied to the * CreateOrUpdate operation. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {string} [parameters.location] Resource location. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. + * + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * * @param {number} [parameters.statistics.size] The database size - the total * size of compressed data and index in bytes. * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location The geo-location where the resource - * lives - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2235,11 +2224,11 @@ class Databases { * * @param {string} [parameters.location] Resource location. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * @@ -2286,11 +2275,11 @@ class Databases { * * @param {string} [parameters.location] Resource location. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * @@ -2751,22 +2740,19 @@ class Databases { * @param {object} parameters The database parameters supplied to the * CreateOrUpdate operation. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {string} [parameters.location] Resource location. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. + * + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * * @param {number} [parameters.statistics.size] The database size - the total * size of compressed data and index in bytes. * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location The geo-location where the resource - * lives - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2805,22 +2791,19 @@ class Databases { * @param {object} parameters The database parameters supplied to the * CreateOrUpdate operation. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {string} [parameters.location] Resource location. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. + * + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * * @param {number} [parameters.statistics.size] The database size - the total * size of compressed data and index in bytes. * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location The geo-location where the resource - * lives - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2883,11 +2866,11 @@ class Databases { * * @param {string} [parameters.location] Resource location. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * @@ -2934,11 +2917,11 @@ class Databases { * * @param {string} [parameters.location] Resource location. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * diff --git a/lib/services/kustoManagement/lib/operations/eventHubConnections.js b/lib/services/kustoManagement/lib/operations/eventHubConnections.js deleted file mode 100644 index f1b39442c..000000000 --- a/lib/services/kustoManagement/lib/operations/eventHubConnections.js +++ /dev/null @@ -1,2451 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Returns the list of Event Hub connections of the given Kusto database. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnectionListResult} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listByDatabase(resourceGroupName, clusterName, databaseName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { - throw new Error('clusterName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EventHubConnectionListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Checks that the Event Hub data connection parameters are valid. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. - * - * @param {string} [parameters.eventhubConnectionName] The name of the event - * hub connection. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnectionValidationListResult} for - * more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _eventhubConnectionValidation(resourceGroupName, clusterName, databaseName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { - throw new Error('clusterName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubConnectionValidation'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['EventHubConnectionValidation']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EventHubConnectionValidationListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Returns an Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _get(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { - throw new Error('clusterName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (eventHubConnectionName === null || eventHubConnectionName === undefined || typeof eventHubConnectionName.valueOf() !== 'string') { - throw new Error('eventHubConnectionName cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{eventHubConnectionName}', encodeURIComponent(eventHubConnectionName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EventHubConnection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - - -/** - * Creates or updates a Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _createOrUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EventHubConnection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Updates a Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the Update operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _update(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EventHubConnection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Deletes the Event Hub connection with the given name. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _deleteMethod(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Creates or updates a Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { - throw new Error('clusterName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (eventHubConnectionName === null || eventHubConnectionName === undefined || typeof eventHubConnectionName.valueOf() !== 'string') { - throw new Error('eventHubConnectionName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{eventHubConnectionName}', encodeURIComponent(eventHubConnectionName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['EventHubConnection']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EventHubConnection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EventHubConnection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the Update operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _beginUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { - throw new Error('clusterName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (eventHubConnectionName === null || eventHubConnectionName === undefined || typeof eventHubConnectionName.valueOf() !== 'string') { - throw new Error('eventHubConnectionName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{eventHubConnectionName}', encodeURIComponent(eventHubConnectionName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['EventHubConnectionUpdate']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EventHubConnection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EventHubConnection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes the Event Hub connection with the given name. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _beginDeleteMethod(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { - throw new Error('clusterName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (eventHubConnectionName === null || eventHubConnectionName === undefined || typeof eventHubConnectionName.valueOf() !== 'string') { - throw new Error('eventHubConnectionName cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{eventHubConnectionName}', encodeURIComponent(eventHubConnectionName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - - return callback(null, result, httpRequest, response); - }); -} - -/** Class representing a EventHubConnections. */ -class EventHubConnections { - /** - * Create a EventHubConnections. - * @param {KustoManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByDatabase = _listByDatabase; - this._eventhubConnectionValidation = _eventhubConnectionValidation; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdate = _beginUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - } - - /** - * Returns the list of Event Hub connections of the given Kusto database. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listByDatabaseWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDatabase(resourceGroupName, clusterName, databaseName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the list of Event Hub connections of the given Kusto database. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {EventHubConnectionListResult} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnectionListResult} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listByDatabase(resourceGroupName, clusterName, databaseName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listByDatabase(resourceGroupName, clusterName, databaseName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDatabase(resourceGroupName, clusterName, databaseName, options, optionalCallback); - } - } - - /** - * Checks that the Event Hub data connection parameters are valid. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. - * - * @param {string} [parameters.eventhubConnectionName] The name of the event - * hub connection. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - eventhubConnectionValidationWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._eventhubConnectionValidation(resourceGroupName, clusterName, databaseName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Checks that the Event Hub data connection parameters are valid. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. - * - * @param {string} [parameters.eventhubConnectionName] The name of the event - * hub connection. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {EventHubConnectionValidationListResult} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnectionValidationListResult} for - * more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - eventhubConnectionValidation(resourceGroupName, clusterName, databaseName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._eventhubConnectionValidation(resourceGroupName, clusterName, databaseName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._eventhubConnectionValidation(resourceGroupName, clusterName, databaseName, parameters, options, optionalCallback); - } - } - - /** - * Returns an Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns an Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {EventHubConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._get(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, optionalCallback); - } - } - - /** - * Creates or updates a Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {EventHubConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, optionalCallback); - } - } - - /** - * Updates a Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the Update operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - updateWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._update(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the Update operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {EventHubConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - update(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._update(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._update(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, optionalCallback); - } - } - - /** - * Deletes the Event Hub connection with the given name. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the Event Hub connection with the given name. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, optionalCallback); - } - } - - /** - * Creates or updates a Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {EventHubConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, optionalCallback); - } - } - - /** - * Updates a Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the Update operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a Event Hub connection. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} parameters The Event Hub connection parameters supplied to - * the Update operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {EventHubConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdate(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters, options, optionalCallback); - } - } - - /** - * Deletes the Event Hub connection with the given name. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the Event Hub connection with the given name. - * - * @param {string} resourceGroupName The name of the resource group containing - * the Kusto cluster. - * - * @param {string} clusterName The name of the Kusto cluster. - * - * @param {string} databaseName The name of the database in the Kusto cluster. - * - * @param {string} eventHubConnectionName The name of the event hub connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, clusterName, databaseName, eventHubConnectionName, options, optionalCallback); - } - } - -} - -module.exports = EventHubConnections; diff --git a/lib/services/kustoManagement/lib/operations/index.d.ts b/lib/services/kustoManagement/lib/operations/index.d.ts index 473e0e99b..e4a3e09e4 100644 --- a/lib/services/kustoManagement/lib/operations/index.d.ts +++ b/lib/services/kustoManagement/lib/operations/index.d.ts @@ -9,6 +9,7 @@ */ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; +import * as moment from 'moment'; import * as models from '../models'; @@ -96,7 +97,7 @@ export interface Clusters { * @param {object} parameters.sku The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -135,7 +136,7 @@ export interface Clusters { * @param {object} parameters.sku The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -197,7 +198,7 @@ export interface Clusters { * @param {object} [parameters.sku] The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -235,7 +236,7 @@ export interface Clusters { * @param {object} [parameters.sku] The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -752,7 +753,7 @@ export interface Clusters { * @param {object} parameters.sku The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -791,7 +792,7 @@ export interface Clusters { * @param {object} parameters.sku The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -853,7 +854,7 @@ export interface Clusters { * @param {object} [parameters.sku] The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -891,7 +892,7 @@ export interface Clusters { * @param {object} [parameters.sku] The SKU of the cluster. * * @param {string} parameters.sku.name SKU name. Possible values include: - * 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16' + * 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4' * * @param {number} [parameters.sku.capacity] SKU capacity. * @@ -1327,22 +1328,19 @@ export interface Databases { * @param {object} parameters The database parameters supplied to the * CreateOrUpdate operation. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {string} [parameters.location] Resource location. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. + * + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * * @param {number} [parameters.statistics.size] The database size - the total * size of compressed data and index in bytes. * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location The geo-location where the resource - * lives - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1369,22 +1367,19 @@ export interface Databases { * @param {object} parameters The database parameters supplied to the * CreateOrUpdate operation. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {string} [parameters.location] Resource location. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. + * + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * * @param {number} [parameters.statistics.size] The database size - the total * size of compressed data and index in bytes. * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location The geo-location where the resource - * lives - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1432,11 +1427,11 @@ export interface Databases { * * @param {string} [parameters.location] Resource location. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * @@ -1471,11 +1466,11 @@ export interface Databases { * * @param {string} [parameters.location] Resource location. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * @@ -1813,22 +1808,19 @@ export interface Databases { * @param {object} parameters The database parameters supplied to the * CreateOrUpdate operation. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {string} [parameters.location] Resource location. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. + * + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * * @param {number} [parameters.statistics.size] The database size - the total * size of compressed data and index in bytes. * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location The geo-location where the resource - * lives - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1855,22 +1847,19 @@ export interface Databases { * @param {object} parameters The database parameters supplied to the * CreateOrUpdate operation. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {string} [parameters.location] Resource location. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. + * + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * * @param {number} [parameters.statistics.size] The database size - the total * size of compressed data and index in bytes. * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location The geo-location where the resource - * lives - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1918,11 +1907,11 @@ export interface Databases { * * @param {string} [parameters.location] Resource location. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * @@ -1957,11 +1946,11 @@ export interface Databases { * * @param {string} [parameters.location] Resource location. * - * @param {number} parameters.softDeletePeriodInDays The number of days data - * should be kept before it stops being accessible to queries. + * @param {moment.duration} [parameters.softDeletePeriod] The time the data + * should be kept before it stops being accessible to queries in TimeSpan. * - * @param {number} [parameters.hotCachePeriodInDays] The number of days of data - * that should be kept in cache for fast queries. + * @param {moment.duration} [parameters.hotCachePeriod] The time the data that + * should be kept in cache for fast queries in TimeSpan. * * @param {object} [parameters.statistics] The statistics of the database. * @@ -2066,15 +2055,15 @@ export interface Databases { /** * @class - * EventHubConnections + * DataConnections * __NOTE__: An instance of this class is automatically created for an * instance of the KustoManagementClient. */ -export interface EventHubConnections { +export interface DataConnections { /** - * Returns the list of Event Hub connections of the given Kusto database. + * Returns the list of data connections of the given Kusto database. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2090,14 +2079,14 @@ export interface EventHubConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns the list of Event Hub connections of the given Kusto database. + * Returns the list of data connections of the given Kusto database. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2118,7 +2107,7 @@ export interface EventHubConnections { * * {Promise} A promise is returned. * - * @resolve {EventHubConnectionListResult} - The deserialized result object. + * @resolve {DataConnectionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2126,21 +2115,21 @@ export interface EventHubConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EventHubConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnectionListResult} for more + * {DataConnectionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnectionListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, clusterName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, clusterName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, clusterName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, clusterName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, clusterName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, clusterName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Checks that the Event Hub data connection parameters are valid. + * Checks that the data connection parameters are valid. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2149,27 +2138,18 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. * - * @param {string} [parameters.eventhubConnectionName] The name of the event - * hub connection. + * @param {string} [parameters.dataConnectionName] The name of the data + * connection. * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. + * @param {object} [parameters.properties] The data connection properties to + * validate. * - * @param {string} parameters.consumerGroup The event hub consumer group. + * @param {string} [parameters.properties.location] Resource location. * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' + * @param {string} parameters.properties.kind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2178,14 +2158,14 @@ export interface EventHubConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - eventhubConnectionValidationWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, parameters: models.EventHubConnectionValidation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + dataConnectionValidationMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, parameters: models.DataConnectionValidation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Checks that the Event Hub data connection parameters are valid. + * Checks that the data connection parameters are valid. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2194,27 +2174,18 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. * - * @param {string} [parameters.eventhubConnectionName] The name of the event - * hub connection. + * @param {string} [parameters.dataConnectionName] The name of the data + * connection. * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. + * @param {object} [parameters.properties] The data connection properties to + * validate. * - * @param {string} parameters.consumerGroup The event hub consumer group. + * @param {string} [parameters.properties.location] Resource location. * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' + * @param {string} parameters.properties.kind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2228,7 +2199,7 @@ export interface EventHubConnections { * * {Promise} A promise is returned. * - * @resolve {EventHubConnectionValidationListResult} - The deserialized result object. + * @resolve {DataConnectionValidationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2236,21 +2207,21 @@ export interface EventHubConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EventHubConnectionValidationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnectionValidationListResult} for - * more information. + * {DataConnectionValidationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnectionValidationListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - eventhubConnectionValidation(resourceGroupName: string, clusterName: string, databaseName: string, parameters: models.EventHubConnectionValidation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - eventhubConnectionValidation(resourceGroupName: string, clusterName: string, databaseName: string, parameters: models.EventHubConnectionValidation, callback: ServiceCallback): void; - eventhubConnectionValidation(resourceGroupName: string, clusterName: string, databaseName: string, parameters: models.EventHubConnectionValidation, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + dataConnectionValidationMethod(resourceGroupName: string, clusterName: string, databaseName: string, parameters: models.DataConnectionValidation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + dataConnectionValidationMethod(resourceGroupName: string, clusterName: string, databaseName: string, parameters: models.DataConnectionValidation, callback: ServiceCallback): void; + dataConnectionValidationMethod(resourceGroupName: string, clusterName: string, databaseName: string, parameters: models.DataConnectionValidation, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns an Event Hub connection. + * Returns a data connection. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2259,7 +2230,7 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * * @param {object} [options] Optional Parameters. * @@ -2268,14 +2239,14 @@ export interface EventHubConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns an Event Hub connection. + * Returns a data connection. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2284,7 +2255,7 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * * @param {object} [options] Optional Parameters. * @@ -2298,7 +2269,7 @@ export interface EventHubConnections { * * {Promise} A promise is returned. * - * @resolve {EventHubConnection} - The deserialized result object. + * @resolve {DataConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2306,20 +2277,20 @@ export interface EventHubConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EventHubConnection} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. + * {DataConnection} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a Event Hub connection. + * Creates or updates a data connection. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2328,28 +2299,14 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. * * @param {string} [parameters.location] Resource location. * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' + * @param {string} parameters.kind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2358,14 +2315,14 @@ export interface EventHubConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a Event Hub connection. + * Creates or updates a data connection. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2374,28 +2331,14 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. * * @param {string} [parameters.location] Resource location. * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' + * @param {string} parameters.kind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2409,7 +2352,7 @@ export interface EventHubConnections { * * {Promise} A promise is returned. * - * @resolve {EventHubConnection} - The deserialized result object. + * @resolve {DataConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2417,20 +2360,20 @@ export interface EventHubConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EventHubConnection} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. + * {DataConnection} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnection, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a Event Hub connection. + * Updates a data connection. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2439,28 +2382,14 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * - * @param {object} parameters The Event Hub connection parameters supplied to - * the Update operation. + * @param {object} parameters The data connection parameters supplied to the + * Update operation. * * @param {string} [parameters.location] Resource location. * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' + * @param {string} parameters.kind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2469,14 +2398,14 @@ export interface EventHubConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnectionUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a Event Hub connection. + * Updates a data connection. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2485,28 +2414,14 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * - * @param {object} parameters The Event Hub connection parameters supplied to - * the Update operation. + * @param {object} parameters The data connection parameters supplied to the + * Update operation. * * @param {string} [parameters.location] Resource location. * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' + * @param {string} parameters.kind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2520,7 +2435,7 @@ export interface EventHubConnections { * * {Promise} A promise is returned. * - * @resolve {EventHubConnection} - The deserialized result object. + * @resolve {DataConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2528,20 +2443,20 @@ export interface EventHubConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EventHubConnection} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. + * {DataConnection} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnectionUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnectionUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnectionUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, callback: ServiceCallback): void; + update(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the Event Hub connection with the given name. + * Deletes the data connection with the given name. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2550,7 +2465,7 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * * @param {object} [options] Optional Parameters. * @@ -2563,10 +2478,10 @@ export interface EventHubConnections { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the Event Hub connection with the given name. + * Deletes the data connection with the given name. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2575,7 +2490,7 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * * @param {object} [options] Optional Parameters. * @@ -2603,13 +2518,13 @@ export interface EventHubConnections { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a Event Hub connection. + * Creates or updates a data connection. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2618,28 +2533,14 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. * * @param {string} [parameters.location] Resource location. * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' + * @param {string} parameters.kind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2648,14 +2549,14 @@ export interface EventHubConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a Event Hub connection. + * Creates or updates a data connection. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2664,28 +2565,14 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * - * @param {object} parameters The Event Hub connection parameters supplied to - * the CreateOrUpdate operation. + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. * * @param {string} [parameters.location] Resource location. * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' + * @param {string} parameters.kind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2699,7 +2586,7 @@ export interface EventHubConnections { * * {Promise} A promise is returned. * - * @resolve {EventHubConnection} - The deserialized result object. + * @resolve {DataConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2707,20 +2594,20 @@ export interface EventHubConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EventHubConnection} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. + * {DataConnection} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnection, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a Event Hub connection. + * Updates a data connection. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2729,28 +2616,14 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * - * @param {object} parameters The Event Hub connection parameters supplied to - * the Update operation. + * @param {object} parameters The data connection parameters supplied to the + * Update operation. * * @param {string} [parameters.location] Resource location. * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' + * @param {string} parameters.kind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2759,14 +2632,14 @@ export interface EventHubConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnectionUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a Event Hub connection. + * Updates a data connection. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2775,28 +2648,14 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * - * @param {object} parameters The Event Hub connection parameters supplied to - * the Update operation. + * @param {object} parameters The data connection parameters supplied to the + * Update operation. * * @param {string} [parameters.location] Resource location. * - * @param {string} parameters.eventHubResourceId The resource ID of the event - * hub to be used to create a data connection. - * - * @param {string} parameters.consumerGroup The event hub consumer group. - * - * @param {string} [parameters.tableName] The table where the data should be - * ingested. Optionally the table information can be added to each message. - * - * @param {string} [parameters.mappingRuleName] The mapping rule to be used to - * ingest the data. Optionally the mapping information can be added to each - * message. - * - * @param {string} [parameters.dataFormat] The data format of the message. - * Optionally the data format can be added to each message. Possible values - * include: 'MULTIJSON', 'JSON', 'CSV' + * @param {string} parameters.kind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2810,7 +2669,7 @@ export interface EventHubConnections { * * {Promise} A promise is returned. * - * @resolve {EventHubConnection} - The deserialized result object. + * @resolve {DataConnection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2818,20 +2677,20 @@ export interface EventHubConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EventHubConnection} [result] - The deserialized result object if an error did not occur. - * See {@link EventHubConnection} for more information. + * {DataConnection} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnectionUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnectionUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, parameters: models.EventHubConnectionUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, parameters: models.DataConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the Event Hub connection with the given name. + * Deletes the data connection with the given name. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2840,7 +2699,7 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * * @param {object} [options] Optional Parameters. * @@ -2853,10 +2712,10 @@ export interface EventHubConnections { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the Event Hub connection with the given name. + * Deletes the data connection with the given name. * * @param {string} resourceGroupName The name of the resource group containing * the Kusto cluster. @@ -2865,7 +2724,7 @@ export interface EventHubConnections { * * @param {string} databaseName The name of the database in the Kusto cluster. * - * @param {string} eventHubConnectionName The name of the event hub connection. + * @param {string} dataConnectionName The name of the data connection. * * @param {object} [options] Optional Parameters. * @@ -2893,9 +2752,9 @@ export interface EventHubConnections { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, eventHubConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, clusterName: string, databaseName: string, dataConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** diff --git a/lib/services/kustoManagement/lib/operations/index.js b/lib/services/kustoManagement/lib/operations/index.js index e6ecebc32..20d1962f6 100644 --- a/lib/services/kustoManagement/lib/operations/index.js +++ b/lib/services/kustoManagement/lib/operations/index.js @@ -16,5 +16,5 @@ exports.Clusters = require('./clusters'); exports.Databases = require('./databases'); -exports.EventHubConnections = require('./eventHubConnections'); +exports.DataConnections = require('./dataConnections'); exports.Operations = require('./operations'); diff --git a/lib/services/kustoManagement/package.json b/lib/services/kustoManagement/package.json index 6ec944a03..303ab4d61 100644 --- a/lib/services/kustoManagement/package.json +++ b/lib/services/kustoManagement/package.json @@ -4,7 +4,7 @@ "description": "KustoManagementClient Library with typescript type definitions for node", "version": "1.0.0-preview", "dependencies": { - "ms-rest": "^2.3.3", + "ms-rest": "^2.4.1", "ms-rest-azure": "^2.5.5" }, "keywords": [ @@ -21,5 +21,8 @@ }, "bugs": { "url": "https://github.com/azure/azure-sdk-for-node/issues" + }, + "scripts": { + "postinstall": "npm explore ms-rest -- npm run print-deprecation-message" } } From 4fdd5991618efa2033d5d3192687c8f22a578f84 Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik Date: Wed, 6 Feb 2019 19:02:04 -0800 Subject: [PATCH 2/3] Regenerate azure-arm-kusto package --- .../lib/models/dataConnection.js | 94 + .../lib/models/dataConnectionListResult.js | 64 + .../lib/models/dataConnectionValidation.js | 69 + .../dataConnectionValidationListResult.js | 61 + .../models/dataConnectionValidationResult.js | 53 + .../lib/models/eventGridDataConnection.js | 147 ++ .../lib/models/eventHubDataConnection.js | 138 + .../lib/operations/dataConnections.js | 2256 +++++++++++++++++ 8 files changed, 2882 insertions(+) create mode 100644 lib/services/kustoManagement/lib/models/dataConnection.js create mode 100644 lib/services/kustoManagement/lib/models/dataConnectionListResult.js create mode 100644 lib/services/kustoManagement/lib/models/dataConnectionValidation.js create mode 100644 lib/services/kustoManagement/lib/models/dataConnectionValidationListResult.js create mode 100644 lib/services/kustoManagement/lib/models/dataConnectionValidationResult.js create mode 100644 lib/services/kustoManagement/lib/models/eventGridDataConnection.js create mode 100644 lib/services/kustoManagement/lib/models/eventHubDataConnection.js create mode 100644 lib/services/kustoManagement/lib/operations/dataConnections.js diff --git a/lib/services/kustoManagement/lib/models/dataConnection.js b/lib/services/kustoManagement/lib/models/dataConnection.js new file mode 100644 index 000000000..02f3c685a --- /dev/null +++ b/lib/services/kustoManagement/lib/models/dataConnection.js @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing an data connection. + * + * @extends models['ProxyResource'] + */ +class DataConnection extends models['ProxyResource'] { + /** + * Create a DataConnection. + * @property {string} [location] Resource location. + * @property {string} kind Polymorphic Discriminator + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DataConnection + * + * @returns {object} metadata of DataConnection + * + */ + mapper() { + return { + required: false, + serializedName: 'DataConnection', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'BaseResource', + className: 'DataConnection', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DataConnection; diff --git a/lib/services/kustoManagement/lib/models/dataConnectionListResult.js b/lib/services/kustoManagement/lib/models/dataConnectionListResult.js new file mode 100644 index 000000000..d991803f0 --- /dev/null +++ b/lib/services/kustoManagement/lib/models/dataConnectionListResult.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The list Kusto data connections operation response. + */ +class DataConnectionListResult extends Array { + /** + * Create a DataConnectionListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DataConnectionListResult + * + * @returns {object} metadata of DataConnectionListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DataConnectionListResult', + type: { + name: 'Composite', + className: 'DataConnectionListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DataConnectionElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'BaseResource', + className: 'DataConnection' + } + } + } + } + } + } + }; + } +} + +module.exports = DataConnectionListResult; diff --git a/lib/services/kustoManagement/lib/models/dataConnectionValidation.js b/lib/services/kustoManagement/lib/models/dataConnectionValidation.js new file mode 100644 index 000000000..2847b0327 --- /dev/null +++ b/lib/services/kustoManagement/lib/models/dataConnectionValidation.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing an data connection validation. + * + */ +class DataConnectionValidation { + /** + * Create a DataConnectionValidation. + * @property {string} [dataConnectionName] The name of the data connection. + * @property {object} [properties] The data connection properties to + * validate. + * @property {string} [properties.location] Resource location. + * @property {string} [properties.kind] Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of DataConnectionValidation + * + * @returns {object} metadata of DataConnectionValidation + * + */ + mapper() { + return { + required: false, + serializedName: 'DataConnectionValidation', + type: { + name: 'Composite', + className: 'DataConnectionValidation', + modelProperties: { + dataConnectionName: { + required: false, + serializedName: 'dataConnectionName', + type: { + name: 'String' + } + }, + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'BaseResource', + className: 'DataConnection' + } + } + } + } + }; + } +} + +module.exports = DataConnectionValidation; diff --git a/lib/services/kustoManagement/lib/models/dataConnectionValidationListResult.js b/lib/services/kustoManagement/lib/models/dataConnectionValidationListResult.js new file mode 100644 index 000000000..16aa974a5 --- /dev/null +++ b/lib/services/kustoManagement/lib/models/dataConnectionValidationListResult.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The list Kusto data connection validation result. + * + */ +class DataConnectionValidationListResult { + /** + * Create a DataConnectionValidationListResult. + * @property {array} [value] The list of Kusto data connection validation + * errors. + */ + constructor() { + } + + /** + * Defines the metadata of DataConnectionValidationListResult + * + * @returns {object} metadata of DataConnectionValidationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DataConnectionValidationListResult', + type: { + name: 'Composite', + className: 'DataConnectionValidationListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DataConnectionValidationResultElementType', + type: { + name: 'Composite', + className: 'DataConnectionValidationResult' + } + } + } + } + } + } + }; + } +} + +module.exports = DataConnectionValidationListResult; diff --git a/lib/services/kustoManagement/lib/models/dataConnectionValidationResult.js b/lib/services/kustoManagement/lib/models/dataConnectionValidationResult.js new file mode 100644 index 000000000..9e9ebc826 --- /dev/null +++ b/lib/services/kustoManagement/lib/models/dataConnectionValidationResult.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The result returned from a data connection validation request. + * + */ +class DataConnectionValidationResult { + /** + * Create a DataConnectionValidationResult. + * @property {string} [errorMessage] A message which indicates a problem in + * data connection validation. + */ + constructor() { + } + + /** + * Defines the metadata of DataConnectionValidationResult + * + * @returns {object} metadata of DataConnectionValidationResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DataConnectionValidationResult', + type: { + name: 'Composite', + className: 'DataConnectionValidationResult', + modelProperties: { + errorMessage: { + required: false, + serializedName: 'errorMessage', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DataConnectionValidationResult; diff --git a/lib/services/kustoManagement/lib/models/eventGridDataConnection.js b/lib/services/kustoManagement/lib/models/eventGridDataConnection.js new file mode 100644 index 000000000..19a36ce7e --- /dev/null +++ b/lib/services/kustoManagement/lib/models/eventGridDataConnection.js @@ -0,0 +1,147 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing an Event Grid data connection. + * + * @extends models['DataConnection'] + */ +class EventGridDataConnection extends models['DataConnection'] { + /** + * Create a EventGridDataConnection. + * @property {string} storageAccountResourceId The resource ID of the storage + * account where the data resides. + * @property {string} eventHubResourceId The resource ID where the event grid + * is configured to send events. + * @property {string} consumerGroup The event hub consumer group. + * @property {string} tableName The table where the data should be ingested. + * Optionally the table information can be added to each message. + * @property {string} [mappingRuleName] The mapping rule to be used to ingest + * the data. Optionally the mapping information can be added to each message. + * @property {string} dataFormat The data format of the message. Optionally + * the data format can be added to each message. Possible values include: + * 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', + * 'SINGLEJSON', 'AVRO' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of EventGridDataConnection + * + * @returns {object} metadata of EventGridDataConnection + * + */ + mapper() { + return { + required: false, + serializedName: 'EventGrid', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'BaseResource', + className: 'EventGridDataConnection', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + storageAccountResourceId: { + required: true, + serializedName: 'properties.storageAccountResourceId', + type: { + name: 'String' + } + }, + eventHubResourceId: { + required: true, + serializedName: 'properties.eventHubResourceId', + type: { + name: 'String' + } + }, + consumerGroup: { + required: true, + serializedName: 'properties.consumerGroup', + type: { + name: 'String' + } + }, + tableName: { + required: true, + serializedName: 'properties.tableName', + type: { + name: 'String' + } + }, + mappingRuleName: { + required: false, + serializedName: 'properties.mappingRuleName', + type: { + name: 'String' + } + }, + dataFormat: { + required: true, + serializedName: 'properties.dataFormat', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EventGridDataConnection; diff --git a/lib/services/kustoManagement/lib/models/eventHubDataConnection.js b/lib/services/kustoManagement/lib/models/eventHubDataConnection.js new file mode 100644 index 000000000..c99b6e704 --- /dev/null +++ b/lib/services/kustoManagement/lib/models/eventHubDataConnection.js @@ -0,0 +1,138 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing an event hub data connection. + * + * @extends models['DataConnection'] + */ +class EventHubDataConnection extends models['DataConnection'] { + /** + * Create a EventHubDataConnection. + * @property {string} eventHubResourceId The resource ID of the event hub to + * be used to create a data connection. + * @property {string} consumerGroup The event hub consumer group. + * @property {string} [tableName] The table where the data should be + * ingested. Optionally the table information can be added to each message. + * @property {string} [mappingRuleName] The mapping rule to be used to ingest + * the data. Optionally the mapping information can be added to each message. + * @property {string} [dataFormat] The data format of the message. Optionally + * the data format can be added to each message. Possible values include: + * 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', + * 'SINGLEJSON', 'AVRO' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of EventHubDataConnection + * + * @returns {object} metadata of EventHubDataConnection + * + */ + mapper() { + return { + required: false, + serializedName: 'EventHub', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'BaseResource', + className: 'EventHubDataConnection', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + eventHubResourceId: { + required: true, + serializedName: 'properties.eventHubResourceId', + type: { + name: 'String' + } + }, + consumerGroup: { + required: true, + serializedName: 'properties.consumerGroup', + type: { + name: 'String' + } + }, + tableName: { + required: false, + serializedName: 'properties.tableName', + type: { + name: 'String' + } + }, + mappingRuleName: { + required: false, + serializedName: 'properties.mappingRuleName', + type: { + name: 'String' + } + }, + dataFormat: { + required: false, + serializedName: 'properties.dataFormat', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EventHubDataConnection; diff --git a/lib/services/kustoManagement/lib/operations/dataConnections.js b/lib/services/kustoManagement/lib/operations/dataConnections.js new file mode 100644 index 000000000..414c3aeb5 --- /dev/null +++ b/lib/services/kustoManagement/lib/operations/dataConnections.js @@ -0,0 +1,2256 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Returns the list of data connections of the given Kusto database. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnectionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByDatabase(resourceGroupName, clusterName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataConnectionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Checks that the data connection parameters are valid. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. + * + * @param {string} [parameters.dataConnectionName] The name of the data + * connection. + * + * @param {object} [parameters.properties] The data connection properties to + * validate. + * + * @param {string} [parameters.properties.location] Resource location. + * + * @param {string} parameters.properties.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnectionValidationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _dataConnectionValidationMethod(resourceGroupName, clusterName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['DataConnectionValidation']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataConnectionValidationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Returns a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, clusterName, databaseName, dataConnectionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (dataConnectionName === null || dataConnectionName === undefined || typeof dataConnectionName.valueOf() !== 'string') { + throw new Error('dataConnectionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{dataConnectionName}', encodeURIComponent(dataConnectionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {string} parameters.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} parameters The data connection parameters supplied to the + * Update operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {string} parameters.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes the data connection with the given name. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, clusterName, databaseName, dataConnectionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, clusterName, databaseName, dataConnectionName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates or updates a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {string} parameters.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (dataConnectionName === null || dataConnectionName === undefined || typeof dataConnectionName.valueOf() !== 'string') { + throw new Error('dataConnectionName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{dataConnectionName}', encodeURIComponent(dataConnectionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['DataConnection']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} parameters The data connection parameters supplied to the + * Update operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {string} parameters.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (dataConnectionName === null || dataConnectionName === undefined || typeof dataConnectionName.valueOf() !== 'string') { + throw new Error('dataConnectionName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{dataConnectionName}', encodeURIComponent(dataConnectionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['DataConnection']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataConnection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the data connection with the given name. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, clusterName, databaseName, dataConnectionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (dataConnectionName === null || dataConnectionName === undefined || typeof dataConnectionName.valueOf() !== 'string') { + throw new Error('dataConnectionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{dataConnectionName}', encodeURIComponent(dataConnectionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a DataConnections. */ +class DataConnections { + /** + * Create a DataConnections. + * @param {KustoManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByDatabase = _listByDatabase; + this._dataConnectionValidationMethod = _dataConnectionValidationMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdate = _beginUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByDatabaseWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByDatabase(resourceGroupName, clusterName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataConnectionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnectionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByDatabase(resourceGroupName, clusterName, databaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByDatabase(resourceGroupName, clusterName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByDatabase(resourceGroupName, clusterName, databaseName, options, optionalCallback); + } + } + + /** + * Checks that the data connection parameters are valid. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. + * + * @param {string} [parameters.dataConnectionName] The name of the data + * connection. + * + * @param {object} [parameters.properties] The data connection properties to + * validate. + * + * @param {string} [parameters.properties.location] Resource location. + * + * @param {string} parameters.properties.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + dataConnectionValidationMethodWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._dataConnectionValidationMethod(resourceGroupName, clusterName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. + * + * @param {string} [parameters.dataConnectionName] The name of the data + * connection. + * + * @param {object} [parameters.properties] The data connection properties to + * validate. + * + * @param {string} [parameters.properties.location] Resource location. + * + * @param {string} parameters.properties.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataConnectionValidationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnectionValidationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + dataConnectionValidationMethod(resourceGroupName, clusterName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._dataConnectionValidationMethod(resourceGroupName, clusterName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._dataConnectionValidationMethod(resourceGroupName, clusterName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Returns a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, dataConnectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, clusterName, databaseName, dataConnectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, clusterName, databaseName, dataConnectionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, clusterName, databaseName, dataConnectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, clusterName, databaseName, dataConnectionName, options, optionalCallback); + } + } + + /** + * Creates or updates a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {string} parameters.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {string} parameters.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, optionalCallback); + } + } + + /** + * Updates a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} parameters The data connection parameters supplied to the + * Update operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {string} parameters.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} parameters The data connection parameters supplied to the + * Update operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {string} parameters.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the data connection with the given name. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, dataConnectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, clusterName, databaseName, dataConnectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the data connection with the given name. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, clusterName, databaseName, dataConnectionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, clusterName, databaseName, dataConnectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, clusterName, databaseName, dataConnectionName, options, optionalCallback); + } + } + + /** + * Creates or updates a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {string} parameters.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} parameters The data connection parameters supplied to the + * CreateOrUpdate operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {string} parameters.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, optionalCallback); + } + } + + /** + * Updates a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} parameters The data connection parameters supplied to the + * Update operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {string} parameters.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a data connection. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} parameters The data connection parameters supplied to the + * Update operation. + * + * @param {string} [parameters.location] Resource location. + * + * @param {string} parameters.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the data connection with the given name. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, clusterName, databaseName, dataConnectionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, clusterName, databaseName, dataConnectionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the data connection with the given name. + * + * @param {string} resourceGroupName The name of the resource group containing + * the Kusto cluster. + * + * @param {string} clusterName The name of the Kusto cluster. + * + * @param {string} databaseName The name of the database in the Kusto cluster. + * + * @param {string} dataConnectionName The name of the data connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, clusterName, databaseName, dataConnectionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, clusterName, databaseName, dataConnectionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, clusterName, databaseName, dataConnectionName, options, optionalCallback); + } + } + +} + +module.exports = DataConnections; From d9a248df39d488c3445484412fd79a503bb4f4fd Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik Date: Wed, 6 Feb 2019 19:04:03 -0800 Subject: [PATCH 3/3] Update version to 2.0.0 --- lib/services/kustoManagement/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/kustoManagement/package.json b/lib/services/kustoManagement/package.json index 303ab4d61..014307c5e 100644 --- a/lib/services/kustoManagement/package.json +++ b/lib/services/kustoManagement/package.json @@ -2,7 +2,7 @@ "name": "azure-arm-kusto", "author": "Microsoft Corporation", "description": "KustoManagementClient Library with typescript type definitions for node", - "version": "1.0.0-preview", + "version": "2.0.0", "dependencies": { "ms-rest": "^2.4.1", "ms-rest-azure": "^2.5.5"