diff --git a/lib/services/websiteManagement2/LICENSE.txt b/lib/services/websiteManagement2/LICENSE.txt new file mode 100644 index 0000000000..5431ba98b9 --- /dev/null +++ b/lib/services/websiteManagement2/LICENSE.txt @@ -0,0 +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. diff --git a/lib/services/websiteManagement2/README.md b/lib/services/websiteManagement2/README.md new file mode 100644 index 0000000000..74dfd85526 --- /dev/null +++ b/lib/services/websiteManagement2/README.md @@ -0,0 +1,40 @@ +--- +uid: azure-arm-website +summary: *content + +--- +# Microsoft Azure SDK for Node.js - WebSiteManagementClient +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-website +``` + +## How to use + +### Authentication, client creation and list appServiceCertificateOrders as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const WebSiteManagementClient = require("azure-arm-website"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new WebSiteManagementClient(creds, subscriptionId); + return client.appServiceCertificateOrders.list().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/websiteManagement2/lib/models/billingMeter.js b/lib/services/websiteManagement2/lib/models/billingMeter.js index 0a4e321786..14229378b7 100644 --- a/lib/services/websiteManagement2/lib/models/billingMeter.js +++ b/lib/services/websiteManagement2/lib/models/billingMeter.js @@ -10,20 +10,26 @@ 'use strict'; +const models = require('./index'); + /** - * Billing meter. + * App Service billing entity that contains information about meter which the + * Azure billing system utilizes to charge users for services. * + * @extends models['ProxyOnlyResource'] */ -class BillingMeter { +class BillingMeter extends models['ProxyOnlyResource'] { /** * Create a BillingMeter. * @member {string} [meterId] Meter GUID onboarded in Commerce - * @member {string} [billingLocation] CSM Location - * @member {string} [shortName] Short Name from Azure pricing Page - * @member {string} [friendlyName] Meter Resource Name - * @member {string} [resourceType] ResourceType meter used for + * @member {string} [billingLocation] Azure Location of billable resource + * @member {string} [shortName] Short Name from App Service Azure pricing + * Page + * @member {string} [friendlyName] Friendly name of the meter + * @member {string} [resourceType] App Service resource type meter used for */ constructor() { + super(); } /** @@ -40,37 +46,68 @@ class BillingMeter { name: 'Composite', className: 'BillingMeter', modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + kind: { + required: false, + serializedName: 'kind', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, meterId: { required: false, - serializedName: 'meterId', + serializedName: 'properties.meterId', type: { name: 'String' } }, billingLocation: { required: false, - serializedName: 'billingLocation', + serializedName: 'properties.billingLocation', type: { name: 'String' } }, shortName: { required: false, - serializedName: 'shortName', + serializedName: 'properties.shortName', type: { name: 'String' } }, friendlyName: { required: false, - serializedName: 'friendlyName', + serializedName: 'properties.friendlyName', type: { name: 'String' } }, resourceType: { required: false, - serializedName: 'resourceType', + serializedName: 'properties.resourceType', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/billingMeterCollection.js b/lib/services/websiteManagement2/lib/models/billingMeterCollection.js new file mode 100644 index 0000000000..731a97562d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/billingMeterCollection.js @@ -0,0 +1,68 @@ +/* + * 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'; + +/** + * Collection of Billing Meters + */ +class BillingMeterCollection extends Array { + /** + * Create a BillingMeterCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BillingMeterCollection + * + * @returns {object} metadata of BillingMeterCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'BillingMeterCollection', + type: { + name: 'Composite', + className: 'BillingMeterCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BillingMeterElementType', + type: { + name: 'Composite', + className: 'BillingMeter' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BillingMeterCollection; diff --git a/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js b/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js index 678b354c64..db22658770 100644 --- a/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js +++ b/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js @@ -19,9 +19,9 @@ const models = require('./index'); class DefaultErrorResponseError { /** * Create a DefaultErrorResponseError. - * @member {string} code Standardized string to programmatically identify the - * error. - * @member {string} message Detailed error description and debugging + * @member {string} [code] Standardized string to programmatically identify + * the error. + * @member {string} [message] Detailed error description and debugging * information. * @member {string} [target] Detailed error description and debugging * information. @@ -46,7 +46,7 @@ class DefaultErrorResponseError { className: 'DefaultErrorResponseError', modelProperties: { code: { - required: true, + required: false, readOnly: true, serializedName: 'code', type: { @@ -54,7 +54,7 @@ class DefaultErrorResponseError { } }, message: { - required: true, + required: false, readOnly: true, serializedName: 'message', type: { diff --git a/lib/services/websiteManagement2/lib/models/defaultErrorResponseErrorDetailsItem.js b/lib/services/websiteManagement2/lib/models/defaultErrorResponseErrorDetailsItem.js index f5f3609ef2..5462c48e7a 100644 --- a/lib/services/websiteManagement2/lib/models/defaultErrorResponseErrorDetailsItem.js +++ b/lib/services/websiteManagement2/lib/models/defaultErrorResponseErrorDetailsItem.js @@ -17,9 +17,9 @@ class DefaultErrorResponseErrorDetailsItem { /** * Create a DefaultErrorResponseErrorDetailsItem. - * @member {string} code Standardized string to programmatically identify the - * error. - * @member {string} message Detailed error description and debugging + * @member {string} [code] Standardized string to programmatically identify + * the error. + * @member {string} [message] Detailed error description and debugging * information. * @member {string} [target] Detailed error description and debugging * information. @@ -42,7 +42,7 @@ class DefaultErrorResponseErrorDetailsItem { className: 'DefaultErrorResponseErrorDetailsItem', modelProperties: { code: { - required: true, + required: false, readOnly: true, serializedName: 'code', type: { @@ -50,7 +50,7 @@ class DefaultErrorResponseErrorDetailsItem { } }, message: { - required: true, + required: false, readOnly: true, serializedName: 'message', type: { diff --git a/lib/services/websiteManagement2/lib/models/handlerMapping.js b/lib/services/websiteManagement2/lib/models/handlerMapping.js index b517c55838..ee5dc87e3b 100644 --- a/lib/services/websiteManagement2/lib/models/handlerMapping.js +++ b/lib/services/websiteManagement2/lib/models/handlerMapping.js @@ -24,8 +24,8 @@ class HandlerMapping { * using the specified FastCGI application. * @member {string} [scriptProcessor] The absolute path to the FastCGI * application. - * @member {string} [arguments] Command-line arguments to be passed to the - * script processor. + * @member {string} [argumentsProperty] Command-line arguments to be passed + * to the script processor. */ constructor() { } @@ -58,7 +58,7 @@ class HandlerMapping { name: 'String' } }, - arguments: { + argumentsProperty: { required: false, serializedName: 'arguments', type: { diff --git a/lib/services/websiteManagement2/lib/models/index.d.ts b/lib/services/websiteManagement2/lib/models/index.d.ts index ba97df93da..2ccef7087d 100644 --- a/lib/services/websiteManagement2/lib/models/index.d.ts +++ b/lib/services/websiteManagement2/lib/models/index.d.ts @@ -1114,13 +1114,13 @@ export interface VirtualApplication { * using the specified FastCGI application. * @member {string} [scriptProcessor] The absolute path to the FastCGI * application. - * @member {string} [arguments] Command-line arguments to be passed to the - * script processor. + * @member {string} [argumentsProperty] Command-line arguments to be passed to + * the script processor. */ export interface HandlerMapping { extension?: string; scriptProcessor?: string; - arguments?: string; + argumentsProperty?: string; } /** @@ -2997,16 +2997,16 @@ export interface ErrorEntity { * @constructor * Detailed errors. * - * @member {string} code Standardized string to programmatically identify the + * @member {string} [code] Standardized string to programmatically identify the * error. - * @member {string} message Detailed error description and debugging + * @member {string} [message] Detailed error description and debugging * information. * @member {string} [target] Detailed error description and debugging * information. */ export interface DefaultErrorResponseErrorDetailsItem { - readonly code: string; - readonly message: string; + readonly code?: string; + readonly message?: string; readonly target?: string; } @@ -3016,9 +3016,9 @@ export interface DefaultErrorResponseErrorDetailsItem { * @constructor * Error model. * - * @member {string} code Standardized string to programmatically identify the + * @member {string} [code] Standardized string to programmatically identify the * error. - * @member {string} message Detailed error description and debugging + * @member {string} [message] Detailed error description and debugging * information. * @member {string} [target] Detailed error description and debugging * information. @@ -3026,8 +3026,8 @@ export interface DefaultErrorResponseErrorDetailsItem { * @member {string} [innererror] More information to debug error. */ export interface DefaultErrorResponseError { - readonly code: string; - readonly message: string; + readonly code?: string; + readonly message?: string; readonly target?: string; details?: DefaultErrorResponseErrorDetailsItem[]; readonly innererror?: string; @@ -3463,26 +3463,6 @@ export interface DiagnosticDetectorResponse extends ProxyOnlyResource { responseMetaData?: ResponseMetaData; } -/** - * @class - * Initializes a new instance of the BillingMeter class. - * @constructor - * Billing meter. - * - * @member {string} [meterId] Meter GUID onboarded in Commerce - * @member {string} [billingLocation] CSM Location - * @member {string} [shortName] Short Name from Azure pricing Page - * @member {string} [friendlyName] Meter Resource Name - * @member {string} [resourceType] ResourceType meter used for - */ -export interface BillingMeter { - meterId?: string; - billingLocation?: string; - shortName?: string; - friendlyName?: string; - resourceType?: string; -} - /** * @class * Initializes a new instance of the StackMinorVersion class. @@ -3678,6 +3658,27 @@ export interface ResourceHealthMetadata extends ProxyOnlyResource { signalAvailability?: boolean; } +/** + * @class + * Initializes a new instance of the BillingMeter class. + * @constructor + * App Service billing entity that contains information about meter which the + * Azure billing system utilizes to charge users for services. + * + * @member {string} [meterId] Meter GUID onboarded in Commerce + * @member {string} [billingLocation] Azure Location of billable resource + * @member {string} [shortName] Short Name from App Service Azure pricing Page + * @member {string} [friendlyName] Friendly name of the meter + * @member {string} [resourceType] App Service resource type meter used for + */ +export interface BillingMeter extends ProxyOnlyResource { + meterId?: string; + billingLocation?: string; + shortName?: string; + friendlyName?: string; + resourceType?: string; +} + /** * @class * Initializes a new instance of the CsmMoveResourceEnvelope class. @@ -6896,6 +6897,18 @@ export interface PremierAddOnOfferCollection extends Array { readonly nextLink?: string; } +/** + * @class + * Initializes a new instance of the BillingMeterCollection class. + * @constructor + * Collection of Billing Meters + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface BillingMeterCollection extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the WebAppCollection class. diff --git a/lib/services/websiteManagement2/lib/models/index.js b/lib/services/websiteManagement2/lib/models/index.js index 3dc66f961a..af2e518523 100644 --- a/lib/services/websiteManagement2/lib/models/index.js +++ b/lib/services/websiteManagement2/lib/models/index.js @@ -129,13 +129,13 @@ exports.AnalysisDefinition = require('./analysisDefinition'); exports.DiagnosticAnalysis = require('./diagnosticAnalysis'); exports.DiagnosticCategory = require('./diagnosticCategory'); exports.DiagnosticDetectorResponse = require('./diagnosticDetectorResponse'); -exports.BillingMeter = require('./billingMeter'); exports.StackMinorVersion = require('./stackMinorVersion'); exports.StackMajorVersion = require('./stackMajorVersion'); exports.ApplicationStack = require('./applicationStack'); exports.Recommendation = require('./recommendation'); exports.RecommendationRule = require('./recommendationRule'); exports.ResourceHealthMetadata = require('./resourceHealthMetadata'); +exports.BillingMeter = require('./billingMeter'); exports.CsmMoveResourceEnvelope = require('./csmMoveResourceEnvelope'); exports.GeoRegion = require('./geoRegion'); exports.HostingEnvironmentDeploymentInfo = require('./hostingEnvironmentDeploymentInfo'); @@ -244,6 +244,7 @@ exports.SourceControlCollection = require('./sourceControlCollection'); exports.GeoRegionCollection = require('./geoRegionCollection'); exports.IdentifierCollection = require('./identifierCollection'); exports.PremierAddOnOfferCollection = require('./premierAddOnOfferCollection'); +exports.BillingMeterCollection = require('./billingMeterCollection'); exports.WebAppCollection = require('./webAppCollection'); exports.BackupItemCollection = require('./backupItemCollection'); exports.SiteConfigResourceCollection = require('./siteConfigResourceCollection'); diff --git a/lib/services/websiteManagement2/lib/operations/billingMeters.js b/lib/services/websiteManagement2/lib/operations/billingMeters.js new file mode 100644 index 0000000000..19ed4bd40c --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/billingMeters.js @@ -0,0 +1,483 @@ +/* + * 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; + +/** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @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 BillingMeterCollection} 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 _list(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.'); + } + let billingLocation = (options && options.billingLocation !== undefined) ? options.billingLocation : undefined; + let apiVersion = '2016-03-01'; + // Validate + try { + if (billingLocation !== null && billingLocation !== undefined && typeof billingLocation.valueOf() !== 'string') { + throw new Error('billingLocation 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.Web/billingMeters'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (billingLocation !== null && billingLocation !== undefined) { + queryParameters.push('billingLocation=' + encodeURIComponent(billingLocation)); + } + queryParameters.push('api-version=' + encodeURIComponent(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['BillingMeterCollection']().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); + }); +} + +/** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @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 BillingMeterCollection} 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 _listNext(nextPageLink, 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 (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink 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 requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // 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['BillingMeterCollection']().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); + }); +} + +/** Class representing a BillingMeters. */ +class BillingMeters { + /** + * Create a BillingMeters. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @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. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @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 {BillingMeterCollection} - 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 BillingMeterCollection} 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. + */ + list(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._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @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 {BillingMeterCollection} - 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 BillingMeterCollection} 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. + */ + listNext(nextPageLink, 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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = BillingMeters; diff --git a/lib/services/websiteManagement2/lib/operations/index.d.ts b/lib/services/websiteManagement2/lib/operations/index.d.ts index 2a958a79ea..f99d619675 100644 --- a/lib/services/websiteManagement2/lib/operations/index.d.ts +++ b/lib/services/websiteManagement2/lib/operations/index.d.ts @@ -6894,69 +6894,6 @@ export interface Diagnostics { getSiteDetectorSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } -/** - * @class - * Global - * __NOTE__: An instance of this class is automatically created for an - * instance of the WebSiteManagementClient. - */ -export interface Global { - - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @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. - */ - getBillingMetersWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @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 {Array} - 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. - * - * {Array} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - getBillingMeters(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getBillingMeters(callback: ServiceCallback): void; - getBillingMeters(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - /** * @class * Provider @@ -8845,6 +8782,139 @@ export interface ResourceHealthMetadataOperations { listBySiteSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * BillingMeters + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface BillingMeters { + + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @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. + */ + listWithHttpOperationResponse(options?: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @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 {BillingMeterCollection} - 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. + * + * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} 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. + */ + list(options?: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @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 {BillingMeterCollection} - 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. + * + * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} 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. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * WebApps @@ -9428,19 +9498,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9450,7 +9507,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Creates a new web, mobile, or API app in an existing resource @@ -9837,19 +9894,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9875,9 +9919,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -9900,9 +9944,6 @@ export interface WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9912,7 +9953,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Deletes a web, mobile, or API app, or one of the deployment slots. @@ -9934,9 +9975,6 @@ export interface WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9961,9 +9999,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, name: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, name: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, name: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, name: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -10342,19 +10380,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -10364,7 +10389,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Creates a new web, mobile, or API app in an existing resource @@ -10742,19 +10767,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -10780,9 +10792,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, callback: ServiceCallback): void; - update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -40215,19 +40227,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -40237,7 +40236,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Creates a new web, mobile, or API app in an existing resource @@ -40624,19 +40623,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -40662,9 +40648,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** diff --git a/lib/services/websiteManagement2/lib/operations/index.js b/lib/services/websiteManagement2/lib/operations/index.js index a7f2101d8e..3a92dd8e10 100644 --- a/lib/services/websiteManagement2/lib/operations/index.js +++ b/lib/services/websiteManagement2/lib/operations/index.js @@ -22,10 +22,10 @@ exports.DomainRegistrationProvider = require('./domainRegistrationProvider'); exports.Certificates = require('./certificates'); exports.DeletedWebApps = require('./deletedWebApps'); exports.Diagnostics = require('./diagnostics'); -exports.Global = require('./global'); exports.Provider = require('./provider'); exports.Recommendations = require('./recommendations'); exports.ResourceHealthMetadataOperations = require('./resourceHealthMetadataOperations'); +exports.BillingMeters = require('./billingMeters'); exports.WebApps = require('./webApps'); exports.AppServiceEnvironments = require('./appServiceEnvironments'); exports.AppServicePlans = require('./appServicePlans'); diff --git a/lib/services/websiteManagement2/lib/operations/webApps.js b/lib/services/websiteManagement2/lib/operations/webApps.js index 5512ecb8d8..2770531df4 100644 --- a/lib/services/websiteManagement2/lib/operations/webApps.js +++ b/lib/services/websiteManagement2/lib/operations/webApps.js @@ -858,19 +858,6 @@ function _get(resourceGroupName, name, options, callback) { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -959,9 +946,6 @@ function _createOrUpdate(resourceGroupName, name, siteEnvelope, options, callbac * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -989,7 +973,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { } let deleteMetrics = (options && options.deleteMetrics !== undefined) ? options.deleteMetrics : undefined; let deleteEmptyServerFarm = (options && options.deleteEmptyServerFarm !== undefined) ? options.deleteEmptyServerFarm : undefined; - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; let apiVersion = '2016-08-01'; // Validate try { @@ -1019,9 +1002,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined && typeof deleteEmptyServerFarm !== 'boolean') { throw new Error('deleteEmptyServerFarm must be of type boolean.'); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } 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.'); } @@ -1045,9 +1025,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -1489,19 +1466,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1528,10 +1492,6 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; let apiVersion = '2016-08-01'; // Validate try { @@ -1558,18 +1518,6 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { if (siteEnvelope === null || siteEnvelope === undefined) { throw new Error('siteEnvelope cannot be null or undefined.'); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds 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.'); } @@ -1587,18 +1535,6 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -55282,19 +55218,6 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -55321,10 +55244,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; let apiVersion = '2016-08-01'; // Validate try { @@ -55351,18 +55270,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca if (siteEnvelope === null || siteEnvelope === undefined) { throw new Error('siteEnvelope cannot be null or undefined.'); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds 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.'); } @@ -55380,18 +55287,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -68327,19 +68222,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -68748,19 +68630,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -68826,9 +68695,6 @@ class WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -68872,9 +68738,6 @@ class WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -69295,19 +69158,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -69707,19 +69557,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -107430,19 +107267,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -107851,19 +107675,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts index 11de86f278..0016cb7d6d 100644 --- a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts @@ -62,10 +62,10 @@ export default class WebSiteManagementClient extends AzureServiceClient { certificates: operations.Certificates; deletedWebApps: operations.DeletedWebApps; diagnostics: operations.Diagnostics; - global: operations.Global; provider: operations.Provider; recommendations: operations.Recommendations; resourceHealthMetadataOperations: operations.ResourceHealthMetadataOperations; + billingMeters: operations.BillingMeters; webApps: operations.WebApps; appServiceEnvironments: operations.AppServiceEnvironments; appServicePlans: operations.AppServicePlans; diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.js b/lib/services/websiteManagement2/lib/webSiteManagementClient.js index 0d65abd6c7..beb4798477 100644 --- a/lib/services/websiteManagement2/lib/webSiteManagementClient.js +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.js @@ -2890,10 +2890,10 @@ class WebSiteManagementClient extends ServiceClient { this.certificates = new operations.Certificates(this); this.deletedWebApps = new operations.DeletedWebApps(this); this.diagnostics = new operations.Diagnostics(this); - this.global = new operations.Global(this); this.provider = new operations.Provider(this); this.recommendations = new operations.Recommendations(this); this.resourceHealthMetadataOperations = new operations.ResourceHealthMetadataOperations(this); + this.billingMeters = new operations.BillingMeters(this); this.webApps = new operations.WebApps(this); this.appServiceEnvironments = new operations.AppServiceEnvironments(this); this.appServicePlans = new operations.AppServicePlans(this); diff --git a/lib/services/websiteManagement2/package.json b/lib/services/websiteManagement2/package.json new file mode 100644 index 0000000000..423c98b02d --- /dev/null +++ b/lib/services/websiteManagement2/package.json @@ -0,0 +1,22 @@ +{ + "name": "azure-arm-website", + "author": "Microsoft Corporation", + "description": "WebSiteManagementClient Library with typescript type definitions for node", + "version": "3.0.0-preview", + "dependencies": { + "ms-rest": "^2.3.2", + "ms-rest-azure": "^2.5.5" + }, + "keywords": [ "node", "azure" ], + "license": "MIT", + "main": "./lib/webSiteManagementClient.js", + "types": "./lib/webSiteManagementClient.d.ts", + "homepage": "http://github.com/azure/azure-sdk-for-node", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "http://github.com/Azure/azure-sdk-for-node/issues" + } +}