diff --git a/lib/services/powerbidedicatedManagement/LICENSE.txt b/lib/services/powerbidedicatedManagement/LICENSE.txt index a70e8cf660..5431ba98b9 100644 --- a/lib/services/powerbidedicatedManagement/LICENSE.txt +++ b/lib/services/powerbidedicatedManagement/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) 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. diff --git a/lib/services/powerbidedicatedManagement/README.md b/lib/services/powerbidedicatedManagement/README.md index 9cfa550b9f..cab39bf94f 100644 --- a/lib/services/powerbidedicatedManagement/README.md +++ b/lib/services/powerbidedicatedManagement/README.md @@ -1,37 +1,42 @@ -# Microsoft Azure SDK for Node.js - PowerBIDedicatedManagementClient -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-powerbidedicated -``` - -## How to use - -### Authentication, client creation and getDetails capacities as an example. - -```javascript -const msRestAzure = require("ms-rest-azure"); -const PowerBIDedicatedManagementClient = require("azure-arm-powerbidedicated"); -msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new PowerBIDedicatedManagementClient(creds, subscriptionId); - const resourceGroupName = "testresourceGroupName"; - const dedicatedCapacityName = "testdedicatedCapacityName"; - return client.capacities.getDetails(resourceGroupName, dedicatedCapacityName).then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.log('An error ocurred:'); - 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-powerbidedicated +summary: *content + +--- +# Microsoft Azure SDK for Node.js - PowerBIDedicatedManagementClient +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-powerbidedicated +``` + +## How to use + +### Authentication, client creation and getDetails capacities as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const PowerBIDedicatedManagementClient = require("azure-arm-powerbidedicated"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new PowerBIDedicatedManagementClient(creds, subscriptionId); + const resourceGroupName = "testresourceGroupName"; + const dedicatedCapacityName = "testdedicatedCapacityName"; + return client.capacities.getDetails(resourceGroupName, dedicatedCapacityName).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/powerbidedicatedManagement/lib/models/checkCapacityNameAvailabilityParameters.js b/lib/services/powerbidedicatedManagement/lib/models/checkCapacityNameAvailabilityParameters.js new file mode 100644 index 0000000000..ec4b87d762 --- /dev/null +++ b/lib/services/powerbidedicatedManagement/lib/models/checkCapacityNameAvailabilityParameters.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Details of capacity name request body. + * + */ +class CheckCapacityNameAvailabilityParameters { + /** + * Create a CheckCapacityNameAvailabilityParameters. + * @member {string} [name] Name for checking availability. + * @member {string} [type] The resource type of powerbi dedicated. Default + * value: 'Microsoft.PowerBIDedicated/capacities' . + */ + constructor() { + } + + /** + * Defines the metadata of CheckCapacityNameAvailabilityParameters + * + * @returns {object} metadata of CheckCapacityNameAvailabilityParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CheckCapacityNameAvailabilityParameters', + type: { + name: 'Composite', + className: 'CheckCapacityNameAvailabilityParameters', + modelProperties: { + name: { + required: false, + serializedName: 'name', + constraints: { + MaxLength: 63, + MinLength: 3, + Pattern: '^[a-z][a-z0-9]*$' + }, + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + defaultValue: 'Microsoft.PowerBIDedicated/capacities', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CheckCapacityNameAvailabilityParameters; diff --git a/lib/services/powerbidedicatedManagement/lib/models/checkCapacityNameAvailabilityResult.js b/lib/services/powerbidedicatedManagement/lib/models/checkCapacityNameAvailabilityResult.js new file mode 100644 index 0000000000..76c13e4e07 --- /dev/null +++ b/lib/services/powerbidedicatedManagement/lib/models/checkCapacityNameAvailabilityResult.js @@ -0,0 +1,70 @@ +/* + * 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 checking result of capacity name availibility. + * + */ +class CheckCapacityNameAvailabilityResult { + /** + * Create a CheckCapacityNameAvailabilityResult. + * @member {boolean} [nameAvailable] Indicator of availablity of the capacity + * name. + * @member {string} [reason] The reason of unavailability. + * @member {string} [message] The detailed message of the request + * unavailability. + */ + constructor() { + } + + /** + * Defines the metadata of CheckCapacityNameAvailabilityResult + * + * @returns {object} metadata of CheckCapacityNameAvailabilityResult + * + */ + mapper() { + return { + required: false, + serializedName: 'CheckCapacityNameAvailabilityResult', + type: { + name: 'Composite', + className: 'CheckCapacityNameAvailabilityResult', + modelProperties: { + nameAvailable: { + required: false, + serializedName: 'nameAvailable', + type: { + name: 'Boolean' + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CheckCapacityNameAvailabilityResult; diff --git a/lib/services/powerbidedicatedManagement/lib/models/dedicatedCapacityUpdateParameters.js b/lib/services/powerbidedicatedManagement/lib/models/dedicatedCapacityUpdateParameters.js index a359ee1b5c..038be1b606 100644 --- a/lib/services/powerbidedicatedManagement/lib/models/dedicatedCapacityUpdateParameters.js +++ b/lib/services/powerbidedicatedManagement/lib/models/dedicatedCapacityUpdateParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Provision request specification * diff --git a/lib/services/powerbidedicatedManagement/lib/models/index.d.ts b/lib/services/powerbidedicatedManagement/lib/models/index.d.ts index 88c6d3af6f..48bfd506ab 100644 --- a/lib/services/powerbidedicatedManagement/lib/models/index.d.ts +++ b/lib/services/powerbidedicatedManagement/lib/models/index.d.ts @@ -213,6 +213,39 @@ export interface ErrorResponse { message?: string; } +/** + * @class + * Initializes a new instance of the CheckCapacityNameAvailabilityParameters class. + * @constructor + * Details of capacity name request body. + * + * @member {string} [name] Name for checking availability. + * @member {string} [type] The resource type of powerbi dedicated. Default + * value: 'Microsoft.PowerBIDedicated/capacities' . + */ +export interface CheckCapacityNameAvailabilityParameters { + name?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the CheckCapacityNameAvailabilityResult class. + * @constructor + * The checking result of capacity name availibility. + * + * @member {boolean} [nameAvailable] Indicator of availablity of the capacity + * name. + * @member {string} [reason] The reason of unavailability. + * @member {string} [message] The detailed message of the request + * unavailability. + */ +export interface CheckCapacityNameAvailabilityResult { + nameAvailable?: boolean; + reason?: string; + message?: string; +} + /** * @class diff --git a/lib/services/powerbidedicatedManagement/lib/models/index.js b/lib/services/powerbidedicatedManagement/lib/models/index.js index ea27643097..2a44ea8384 100644 --- a/lib/services/powerbidedicatedManagement/lib/models/index.js +++ b/lib/services/powerbidedicatedManagement/lib/models/index.js @@ -29,5 +29,7 @@ exports.SkuEnumerationForNewResourceResult = require('./skuEnumerationForNewReso exports.SkuDetailsForExistingResource = require('./skuDetailsForExistingResource'); exports.SkuEnumerationForExistingResourceResult = require('./skuEnumerationForExistingResourceResult'); exports.ErrorResponse = require('./errorResponse'); +exports.CheckCapacityNameAvailabilityParameters = require('./checkCapacityNameAvailabilityParameters'); +exports.CheckCapacityNameAvailabilityResult = require('./checkCapacityNameAvailabilityResult'); exports.DedicatedCapacities = require('./dedicatedCapacities'); exports.OperationListResult = require('./operationListResult'); diff --git a/lib/services/powerbidedicatedManagement/lib/models/operation.js b/lib/services/powerbidedicatedManagement/lib/models/operation.js index d0cc4c6e82..c9cbb990fc 100644 --- a/lib/services/powerbidedicatedManagement/lib/models/operation.js +++ b/lib/services/powerbidedicatedManagement/lib/models/operation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Capacities REST API operation. * diff --git a/lib/services/powerbidedicatedManagement/lib/models/skuDetailsForExistingResource.js b/lib/services/powerbidedicatedManagement/lib/models/skuDetailsForExistingResource.js index b6d8b55959..e41cf7c061 100644 --- a/lib/services/powerbidedicatedManagement/lib/models/skuDetailsForExistingResource.js +++ b/lib/services/powerbidedicatedManagement/lib/models/skuDetailsForExistingResource.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * An object that represents SKU details for existing resources * diff --git a/lib/services/powerbidedicatedManagement/lib/models/skuEnumerationForExistingResourceResult.js b/lib/services/powerbidedicatedManagement/lib/models/skuEnumerationForExistingResourceResult.js index 678652760a..8570480105 100644 --- a/lib/services/powerbidedicatedManagement/lib/models/skuEnumerationForExistingResourceResult.js +++ b/lib/services/powerbidedicatedManagement/lib/models/skuEnumerationForExistingResourceResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * An object that represents enumerating SKUs for existing resources * diff --git a/lib/services/powerbidedicatedManagement/lib/models/skuEnumerationForNewResourceResult.js b/lib/services/powerbidedicatedManagement/lib/models/skuEnumerationForNewResourceResult.js index 54d5d36e81..1bb65c3bca 100644 --- a/lib/services/powerbidedicatedManagement/lib/models/skuEnumerationForNewResourceResult.js +++ b/lib/services/powerbidedicatedManagement/lib/models/skuEnumerationForNewResourceResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * An object that represents enumerating SKUs for new resources * diff --git a/lib/services/powerbidedicatedManagement/lib/operations/capacities.js b/lib/services/powerbidedicatedManagement/lib/operations/capacities.js index 32e6d0bb6d..1babe64169 100644 --- a/lib/services/powerbidedicatedManagement/lib/operations/capacities.js +++ b/lib/services/powerbidedicatedManagement/lib/operations/capacities.js @@ -1193,6 +1193,171 @@ function _listSkusForCapacity(resourceGroupName, dedicatedCapacityName, options, }); } +/** + * Check the name availability in the target location. + * + * @param {string} location The region name which the operation will lookup + * into. + * + * @param {object} capacityParameters The name of the capacity. + * + * @param {string} [capacityParameters.name] Name for checking availability. + * + * @param {string} [capacityParameters.type] The resource type of powerbi + * dedicated. + * + * @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 CheckCapacityNameAvailabilityResult} 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 _checkNameAvailability(location, capacityParameters, 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 (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (capacityParameters === null || capacityParameters === undefined) { + throw new Error('capacityParameters cannot be null or undefined.'); + } + 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 (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}/providers/Microsoft.PowerBIDedicated/locations/{location}/checkNameAvailability'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + 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 (capacityParameters !== null && capacityParameters !== undefined) { + let requestModelMapper = new client.models['CheckCapacityNameAvailabilityParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, capacityParameters, 'capacityParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(capacityParameters, 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['CheckCapacityNameAvailabilityResult']().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); + }); +} + /** * Provisions the specified Dedicated capacity based on the configuration * specified in the request. @@ -2149,6 +2314,7 @@ class Capacities { this._list = _list; this._listSkus = _listSkus; this._listSkusForCapacity = _listSkusForCapacity; + this._checkNameAvailability = _checkNameAvailability; this._beginCreate = _beginCreate; this._beginDeleteMethod = _beginDeleteMethod; this._beginUpdate = _beginUpdate; @@ -3129,6 +3295,105 @@ class Capacities { } } + /** + * Check the name availability in the target location. + * + * @param {string} location The region name which the operation will lookup + * into. + * + * @param {object} capacityParameters The name of the capacity. + * + * @param {string} [capacityParameters.name] Name for checking availability. + * + * @param {string} [capacityParameters.type] The resource type of powerbi + * dedicated. + * + * @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. + */ + checkNameAvailabilityWithHttpOperationResponse(location, capacityParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._checkNameAvailability(location, capacityParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Check the name availability in the target location. + * + * @param {string} location The region name which the operation will lookup + * into. + * + * @param {object} capacityParameters The name of the capacity. + * + * @param {string} [capacityParameters.name] Name for checking availability. + * + * @param {string} [capacityParameters.type] The resource type of powerbi + * dedicated. + * + * @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 {CheckCapacityNameAvailabilityResult} - 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 CheckCapacityNameAvailabilityResult} 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. + */ + checkNameAvailability(location, capacityParameters, 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._checkNameAvailability(location, capacityParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkNameAvailability(location, capacityParameters, options, optionalCallback); + } + } + /** * Provisions the specified Dedicated capacity based on the configuration * specified in the request. diff --git a/lib/services/powerbidedicatedManagement/lib/operations/index.d.ts b/lib/services/powerbidedicatedManagement/lib/operations/index.d.ts index 84afd0b10b..df1e5cbdc7 100644 --- a/lib/services/powerbidedicatedManagement/lib/operations/index.d.ts +++ b/lib/services/powerbidedicatedManagement/lib/operations/index.d.ts @@ -724,6 +724,78 @@ export interface Capacities { listSkusForCapacity(resourceGroupName: string, dedicatedCapacityName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Check the name availability in the target location. + * + * @param {string} location The region name which the operation will lookup + * into. + * + * @param {object} capacityParameters The name of the capacity. + * + * @param {string} [capacityParameters.name] Name for checking availability. + * + * @param {string} [capacityParameters.type] The resource type of powerbi + * dedicated. + * + * @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|ServiceError} - The error object. + */ + checkNameAvailabilityWithHttpOperationResponse(location: string, capacityParameters: models.CheckCapacityNameAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Check the name availability in the target location. + * + * @param {string} location The region name which the operation will lookup + * into. + * + * @param {object} capacityParameters The name of the capacity. + * + * @param {string} [capacityParameters.name] Name for checking availability. + * + * @param {string} [capacityParameters.type] The resource type of powerbi + * dedicated. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|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 {CheckCapacityNameAvailabilityResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CheckCapacityNameAvailabilityResult} [result] - The deserialized result object if an error did not occur. + * See {@link CheckCapacityNameAvailabilityResult} 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. + */ + checkNameAvailability(location: string, capacityParameters: models.CheckCapacityNameAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkNameAvailability(location: string, capacityParameters: models.CheckCapacityNameAvailabilityParameters, callback: ServiceCallback): void; + checkNameAvailability(location: string, capacityParameters: models.CheckCapacityNameAvailabilityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Provisions the specified Dedicated capacity based on the configuration * specified in the request. diff --git a/lib/services/powerbidedicatedManagement/lib/powerBIDedicatedManagementClient.d.ts b/lib/services/powerbidedicatedManagement/lib/powerBIDedicatedManagementClient.d.ts index 713f7c82c2..e3c2cb67bc 100644 --- a/lib/services/powerbidedicatedManagement/lib/powerBIDedicatedManagementClient.d.ts +++ b/lib/services/powerbidedicatedManagement/lib/powerBIDedicatedManagementClient.d.ts @@ -34,11 +34,11 @@ export default class PowerBIDedicatedManagementClient extends AzureServiceClient * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); diff --git a/lib/services/powerbidedicatedManagement/lib/powerBIDedicatedManagementClient.js b/lib/services/powerbidedicatedManagement/lib/powerBIDedicatedManagementClient.js index 2d86d21d49..d7bc6297fb 100644 --- a/lib/services/powerbidedicatedManagement/lib/powerBIDedicatedManagementClient.js +++ b/lib/services/powerbidedicatedManagement/lib/powerBIDedicatedManagementClient.js @@ -34,9 +34,9 @@ class PowerBIDedicatedManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { diff --git a/lib/services/powerbidedicatedManagement/package.json b/lib/services/powerbidedicatedManagement/package.json index 7b9881d8ff..4e0106770e 100644 --- a/lib/services/powerbidedicatedManagement/package.json +++ b/lib/services/powerbidedicatedManagement/package.json @@ -7,16 +7,19 @@ "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" }, - "keywords": [ "node", "azure" ], + "keywords": [ + "node", + "azure" + ], "license": "MIT", "main": "./lib/powerBIDedicatedManagementClient.js", "types": "./lib/powerBIDedicatedManagementClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/powerbidedicatedManagement", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } }